Thanks for the suggestion. I need to get the information about the node from an external 3rd party API first. Do you have any sugguestions as to how I can get the info using the API and then use it to update the node in NPM?
Is there just one node to update? Or many nodes such that you need to match up how NPM identifies the node and how the external API identifies them?
Currently there are 6 nodes, and there will be a lot more in the future. The individual nodes have unique identifers ("DID") as well as IP addresses. I can manually enter them into NPM to get the database populated, I just need the API to update status info.
Here is some more of the info the API provides:
"status_change": "2017-01-01 00:00:01",
"status_reason": "Lost contact",
Here's one way to tackle this:
- Create a custom property in NPM to hold the API's "DID" number for each node.
- Set the DID property for each relevant node. If you have a spreadsheet with this mapping, you might be able to import these values using the Custom Property Editor tool. But if there are only 6 it would be easier to just put them in manually.
- Disable NPM's Status and Response Time pollers for these nodes using the "List Resources" page for them so NPM isn't constantly overwriting your status values with what it thinks they should be.
- Write a script that does this:
- Run a SWQL query to get the URI and DID for each node that has a non-blank DID property.
- Make the external API call to get the current status information.
- Loop through the devices returned from the API call. For each one:
- Get the URI for corresponding NPM node by matching the DID.
- Map the device's status value to one of the Orion Platform status values.
- Make a SWIS Update call to set the new status value.
- Use some tool to make the script run every few minutes - cron, Windows Task Scheduler, etc.
Very nice, I will try this!
On Fri, Aug 10, 2018 at 2:48 PM tdanner