Hi expert. After the creation of my script for host discovery, I get asked if it's possible to extend the script to scan remote subnet. HostDiscvovey use arp command and create csv file out of it. It can only find directly connected IP/MAC.
For remote network, I've created this other script: PingScan to host objects.
You provide the subnet as an argument, I'll do a ping scan, resove IP to hostname, added a group and create a csv file from replying hosts.The CSV file is then imported into the management database.
You can run it either from expert mode in cli or directly from the SmartConsole with the run script option in GATEWAYS & SERVERS view:
Example: PingScanToHostsObjects.sh 192.168.2 BellSide
This will ping scan 192.168.2.1 to 254, create the group BellSide and will add newly discovered hosts into that group. If the group doesn’t exist, it will create it.
Happy scripting! 🙂