Create NetScan and then cause them to be Invoked (run) without killing the farm #39
h3steinhauer
started this conversation in
General
Replies: 1 comment
-
Use Caution the $_ string is not being shown in the text - but when I go to edit it, the $_ is there. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are migrating from another monitor and have exported the Device Ips to import into LM. But there is concern that list may not have all the devices.
The thought was to summarize the device list and turn that list into pools of ip-3 subnet ranges to do NetScan search to ensure it is complete. (ip-3 is a short form to mean the first 3 nodes of the IP Address).
Using the PowerShell processes, this was easy to create the NetScan - New-LMNetScan with -Name $namescn -SubnetRange $scanIP
where $scanIP was created from the ip-3 - then add .0/24 to force a scan of that whole subnet.
But using the Invoke-LMNetscan - it is easy to overrun the Collector that is dong the net scans.
I found by adding the powershell - Start-Sleep -seconds 30 This help to prevent that overrun and allowed it to have a chance to finish and not 'timeout' when all them were being queued up at once.
We ended up with 390 subnet that needed to be scanned. So even with 2 per minute - this was going to take awhile to complete.
We put all the devices into the UnMonitored list and then used the Inventory and visual sorting and grouping to put them into the proper groups. Still a lot of manual work, but much better than creating all those NetScans by hand.
There were some workstations that were caught with this, and we still wanted to exclude those.
The final steps were simple steps.
$scan = $ ($.'netscanip') + "0/24" # creates the subnet field to use in the -SubnetRange field
$netscanip = Import-Csv -Path c:\temp\netscan-ip.csv # summary of the IP Subnets that needed scanning
$netscanip | % {
$namescan = lvl-ip-range-" + $($.'netscanip')
New-LMNetScan -CollectorId 78 -Name $namescan -SubnetRange $scan . . . # other parms as needed.
}
#that created all the Netscans that will be run in the next section.
As this is creating them all at once - the scan IDs will be sequential - so get the first one and the last for the next section.
for ($i=269; $i -lt 659; $i++) ( Invoke-LMNetscan -id $i
Start-Sleep -seconds 30)
done and verify they all finished and did not time out.
Note -if they did time out, you can get the -ID number and then put that into an array and repeat the loop call again.
like
$failed = 490, 491, 492, 500, 510, 520
Foreach ($i in $failed) ( Invoke-LMNetscan -id $i
Start-Sleep -seconds 30)
Beta Was this translation helpful? Give feedback.
All reactions