Hi I want to add new nodes into Orion but I don't know if I can do this with Rest API. Is posible do this?
Yes, this is possible. Here's a sample in Python: orionsdk-python/discover_one_node.py at master · solarwinds/orionsdk-python · GitHub
i saw this sample but how to add the community and custom props?
Community strings for SNMP v1/2 are added by their credential IDs, just like SNMP v3 credential sets.
To set custom property values, you need to wait for the discovery job to complete, get the NodeID of the new node(s) and then update them like this: orionsdk-python/custom_property_update.py at master · solarwinds/orionsdk-python · GitHub
ok, then first i add the new node and then i configure the custom props?
hey guys, sorry for my ignorance, but can anyone please help me with this. I am total noob with regards of APIs and I would appreciate if you can give me some guidance how to actually trigger this script.
If I want to trigger it on a specific event in SolarWinds - would it be the case of setting up simple alert and then attaching an action to it with the above script?
Also, what is best practice in general for triggering such scripts? Where do you store them, how do you trigger them, etc.
I know it may sound silly, but I am very new with APIs and still learning. So, every little helps. If anyone can share an example of complete workflow - this would be awesome
Thanks a million dear Thwackers
With Gratitude,
Alex Soul
"it depends"
If you want to keep it inside of the Orion framework; then yes you could set this up as a reaction to an alert as you mentioned.
However, I personally like to setup my scripts on an external (non-Orion) tools server and then use Windows Scheduled Tasks to query SWIS on a regular interval and provide action as needed. I typically write everything I use in PowerShell, so my save location is almost always something like \Scripts, with logging going into \Scripts\Logs (not the exact paths, but the mindset is there).
High level example:
It really depends on what you goal(s) is/are. I find it's easiest to start with defining what I want to achieve, then going back and mapping out the various ways to achieve it, then choosing a path based on simplicity + scalability. There's ALWAYS multiple ways to approach and achieve success, so the concept of "best practices" in this scenario isn't really that important to follow IMO.