check_snmp value need to multiply/divide

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

check_snmp value need to multiply/divide

Post by zaji_nms »

Dear Expert

We fetching APC load/power values .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.3 via $USER1$/check_snmp
but the raw values need to divide/multiply. How to do that?

the return value is 49 however in real its 4.9 A, in this case how to divide that raw value?

Regards
Zajil NMS
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Re: check_snmp value need to multiply/divide

Post by mp4783 »

It depends upon what you want to do with it. I'm not sure that Nagios XI allows for integrated "post-processing" of performance data (which is technically what this is).

One way to handle this would be to use an event handler to perform the calculation and then have it pass that back for further processing.

Another, more difficult, way to do this would be to craft a custom SNMP OID on the monitored host, assuming the host uses a general purpose operating system like Linux and it supports a standard SNMP architecture like Net-SNMP. If it does, go to the Net-SNMP web site and look at the "exec" function. Basically, in the snmpd.conf file you insert an entry that defines a custom OID and a command to run when it is polled. This command would execute a script that would perform a local snmpget, then execute your calculation, then pass the result back to the polling client as the result of the client's SNMP poll (e.g. snmpget).

Here's a link to get you started: http://www.net-snmp.org/wiki/index.php/FAQ:Agent_07

Here's an example of an "exec" entry in snmpd.conf. Please note that the use of "exec" has been deprecated, but new syntax follows the same basic concept.

Code: Select all

exec .1.3.6.1.4.1.2021.300.1.8.1 MYSYSTEM_CHECK_VALUE /usr/local/nagios/libexec/check_mysystem.ksh 4
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_snmp value need to multiply/divide

Post by hsmith »

Thanks for all of your answers today @mp4783 :)


@zaji_nms,

Does this clear it up for you?
Former Nagios Employee.
me.
Locked