Hi,
I'm using the 'DiscoverAndAddInterfacesOnNode' script from Github.
# The node ID to discovery interfaces on
$nodeId = 99
# Discover interfaces on the node
$discovered = Invoke-SwisVerb $swis Orion.NPM.Interfaces DiscoverInterfacesOnNode $nodeId
if ($discovered.Result -ne "Succeed") {
Write-Host "Interface discovery failed."
} else {
# Uncomment one of the following to limit the interfaces that get added:
# No. 1: Remove interfaces that are NOT ifType 6 (FastEthernet)
#$discovered.DiscoveredInterfaces.DiscoveredLiteInterface | ?{ $_.ifType -ne 6 } | %{ $discovered.DiscoveredInterfaces.RemoveChild($_) | Out-Null }
# No. 2: Remove interfaces that have a caption of 'lo' (Loopback)
#$discovered.DiscoveredInterfaces.DiscoveredLiteInterface | ?{ $_.Caption.InnerText -eq 'lo' } | %{ $discovered.DiscoveredInterfaces.RemoveChild($_) | Out-Null }
# No. 3: Remove interfaces that are down
$discovered.DiscoveredInterfaces.DiscoveredLiteInterface | ?{ $_.status -ne 1 } | %{ $discovered.DiscoveredInterfaces.RemoveChild($_) | Out-Null }
# Add the remaining interfaces
Invoke-SwisVerb $swis Orion.NPM.Interfaces AddInterfacesOnNode @($nodeId, $discovered.DiscoveredInterfaces, "AddDefaultPollers") | Out-Null
}
I'm trying to work out where the variables are located to define which interfaces to remove from the discovery? The above examples give 'IfType' and 'Caption.innerText' but i was wondering what other variables i can use. For Example I'd like to remove anything that wasn't Up but i can't find where these are listed to work out the correct option.
Any help would be appreciated.
Thanks