We are trying to automate the server build process so wanted to know how to add node in solarwinds using powershell for monitoring.
Correct this is for a single node but you can always use a foreach loop to go through a list,
I have a CSV file with all the nodes and there details
and then use this to loop through:
$Nodes = import-csv -path "c:\scripts\book1.csv"
Foreach ($Node in $Nodes)
{
$NewNode = Orion-AddNode -SwisConnection $Swis -NodeName $Node.NodeName -NodeIPAddress $Node.NodeIPAddress -PollingEngineID $Node.PollingEngineID -PollingMethod $Node.PollingMethod -SNMPV2Community $Node.SNMPV2Community
$NodeProperties = Get-SwisObject $swis -Uri $NewNode
$PollerAdds = Orion-SetStdDevicePollers -SwisConnection $Swis -NodeID $NodeProperties.NodeID -PollingType $Node.PollingMethod
$HHPolling = Orion-SetHardwareHealthSensors -SwisConnection $Swis -NodeID $NodeProperties.NodeID -Action Enable -Manufacturer $Node.NodeManufacturer
$PollNodeID = $NodeProperties.OrionIdPrefix + $NodeProperties.NodeID
$PollNow = Invoke-SwisVerb $Swis Orion.Nodes PollNow @($PollNodeID)
}
Both files are attached.
Start here: GitHub - solarwinds/OrionSDK: SDK for the SolarWinds Orion platform, including tools, documentation, and samples in Powe…
I cracked this one last week, not near my laptop for a few days but will try and post something early next week for you.
It's all possible but took a bit of fiddling in our lab instance to get right.
Hi ,
Can you share the idea with us, so that it will helpful to all.
Attached is an early version of my code that i used before our CMDB integration got involved
You'll find three functions at the top:
Orion-AddNode - This creates either an ICMP or SNMP V2 Node
Orion-SetStdDevicePollers - This assigns either the standard ICMP or SNMP Pollers, doesn't include any custom pollers and may be missing anything new
Orion-SetHardwareHealthSensors - This assigns the HH sensors and you have to specify the hardware manufacturer for it to work.
The rest of the script is the variables for the node your adding and the script itself.
It assumes you have the SwisPowerShell module installed and loaded and your Swis connection is called $Swis.
Good luck
If we are using SNMPV3 how do we specify the username and password?