This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Is it possible to collect non-snmp information in NPM?

I'm wondering if it is possible to collect information I get with a python script into NPM somehow?

Our previous monitoring system allowed me to define an 'attribute' and then populate it with a tcpsock call.  It proved to be very useful in a number of situations.  So far I'm not seeing any similar mechanism in NPM however.

Right now for example, I have a need to monitor which routers have a specific file present in their flash.  I can easily do this with a python script which will parse the results of 'dir bootflash:' looking for the filename.  But I don't see any way to get that information into NPM.  I'm pretty new to NPM so I could be missing something obvious.

I know there is an snmp oid I can walk to get the contents of the flash, but I don't see how I could construct a universal poller on that oid that would return just that filename if it exists.  It would return the entire contents of flash.

If it was possible to do it with the python script it would be better because that would generalize to any future need that I didn't have an oid for.

Thanks.

  • Script monitors are a part of SAM, Server and Application Monitor.  That would be an additional expense. 

    Honestly I don't know how people get by without (at a minimum) their network, server, and virtual monitoring all in the same place.

  • We do have SAM, although I do not personally use it.  I did look at the scripting capability there, but it didn't seem that it would work for what I want it for.  I didn't see how the output of a script run by sam node could populate a value of multiple npm nodes.

    I could have a python script run on one of the linux sam nodes loop through all of my routers and determine whether the file exists in flash.  But then how do I 'send' that data to the various npm nodes that represent those routers?

    Am I missing something?

    Thanks.

  • I think I just realized there is a fairly obvious solution, at least for this particular use case.

    I can create a custom property called 'Has_16.6.7_Image' and have the script make an API call to set the value of the custom property to either True or False.

  • Yeah, it works the opposite way.  What you are trying to do and I have tried unsuccessfully, is have a script that updates the status of a monitor on each node.  but what SAM does is run the script against each node.

    Run the script PER npm Node with the node name or IP address as a parameter.  Then the script outputs for just that node, using the "statistic" and "message" lines of output.

    Another solution I have used, is to run your big everything script on the orion server as a scheduled task, but if there is a problem, such as the flash file doesn't exist, then instead of just outputing to the screen, also create a file like "c:\flashes\10.x.x.x-error.txt".  Then on each node you create an application monitor with the component "File Existance Monitor", and the file is c:\flashes\${IP}-error.txt.  On the component you also set the "File Exist Setting" to "File must not exist", so it will go into an error state if the file does exist.  Don't forget in your big script to delete the files for nodes that are back into a good state, or maybe deletes all of the files in the folder before it runs... whatever you feel comfortable with.

    An option I have NOT tried, but it would be closer to what you originally asked for:  Download the OrionSDK and in the script set a custom property on the nodes.  Then create an alert based on the content of that custom property. 

  • One solution you could use is have the script send Syslog messages to Orion then they will be in the Syslog table. You can then create your alerting against that.

  • Thanks for the suggestions.  I'll be keeping them in mind for future use cases.  For this one, I'm going with the 'custom property and have the script update that with the api' method.

  • Your Linux servers can run bash or perl scripts in response to polling private MIBs.  Then an exit code can be returned.  A Universal Device Poller polling the private MIB can map (enumerate function) the output. 

    If a SAM node, that private MIB return code (returned by bash or perl) can be further processed with custom up/down/warning thresholds.

    The *nix script could return the end state format you desire too without UnDP conversion/ enumeration. 

    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sect-system_monitoring_tools-net-snmp-extending

    Here is some querying of a Cisco environment:

    Net-SNMP

    Cisco Embedded Event Manager can expose information via SNMP:

    Cisco EEM Basic Overview and Sample Con... - Cisco Community

    action_snmp_object_value

    Sets a Simple Network Management Protocol (SNMP) object ID and value to be returned for the SNMP get request.

    Cisco EEM can optionally use Tcl scripts or expose information via SNMP.

    Saving the best for last...this is the most direct way to see flash via SNMP that I know of:

    ciscoFlashFileEntry = 1.3.6.1.4.1.9.9.10.1.1.4.2.1.1

    OID for listing contents of FLASH - Cisco Community

  • If I'm following you correctly, that sounds like a very interesting idea.  I could create an eem script to test for the existence of the file in question and then create an arbitrary oid that would return a value indicating whether the file existed or not.

    I'm eager to give that a try.

    Thanks.

  • I have never made anything with EEM, but have seen the results of others' efforts.  If you have permissions on the Cisco side, I can see a glimmer of hope based on what I have seen and have read.

    Here is EEM generation of a syslog example.  The syslog is then tied to an alert: 

    My Default Route Is Gone! Integrating Embedded Event Manager (EEM) into SolarWinds | Prosperon Networks

  • That's is a great way as well emoticons_happy.png