Page 1 of 1

Change frequncy Nagios runs some plugins.

Posted: Mon Jun 11, 2012 10:59 am
by FaneMSM
Can somebody help me how to change the frequency Nagios runs some plugins. For example: I would like Nagios to run only the check_snmp plugin every one second.

Re: Change frequncy Nagios runs some plugins.

Posted: Mon Jun 11, 2012 11:46 am
by agriffin
You will need to change interval_length from 60 to 1 in nagios.cfg. This will necessitate changing ALL check_interval values to be measured in seconds rather than minutes. You can then set the check_interval to 1 for your check_snmp service to check every second. Please note that this is probably a bad idea though, and you probably don't really need to be accurate to 1 second.

Re: Change frequncy Nagios runs some plugins.

Posted: Mon Jun 11, 2012 11:54 am
by FaneMSM
Thank you for your fast reply. You made my day1 :D

Re: Change frequncy Nagios runs some plugins.

Posted: Mon Jun 11, 2012 12:13 pm
by agriffin
Glad I could help!

Re: Change frequncy Nagios runs some plugins.

Posted: Thu Jun 14, 2012 8:59 am
by FaneMSM
Hi,
Do you now if I can convert the result that check_snmp returns??

For example: My check_snmp returns a string "82000000.8" and I would like to convert it into a double because I would like to monitor the change of the result with nagiosgraph.

Thank you in advance,
Stefan

Re: Change frequncy Nagios runs some plugins.

Posted: Fri Jun 15, 2012 10:24 am
by agriffin
You could filter it with another program. For example:

Code: Select all

$USER1$/check_snmp opts | sed 's/.*/& | label=&/'

Re: Change frequncy Nagios runs some plugins.

Posted: Sat Jun 16, 2012 10:08 am
by FaneMSM
Please, could you be a little bit more specific ?

for example my command is:

define command{
command_name check_atr
command_line $USER1$/check_snmp -H $HOSTADDRESS -C public iso.3.6.1.4.1.xxxxx
}

and it returns a string like 82048243.7

The other command is:
define command{
command_name check_owd
command_line $USER1$/check_snmp -H $HOSTADDRESS -C public iso.3.6.1.4.1.xxxxx
}

and it returns a string like 0.000123.

And I would like the to return an integer or a double value so I can use nagiosgraph.

Please help me as soon as possible,
Stefan

Re: Change frequncy Nagios runs some plugins.

Posted: Sat Jun 16, 2012 10:49 am
by FaneMSM
Actually the result is:
SNMP OK - "82015315.6" |
SNMP OK - "0.000217" |

Re: Change frequncy Nagios runs some plugins.

Posted: Sat Jun 16, 2012 12:04 pm
by FaneMSM
I am sorry for bothering you but I forgot to say that if you can I would like a full example because I am a little newbie with Nagios.
This is a part of my bachelor degree project and I have no idea what to do further and in 4 day I have to finish everything.

IF you want you can reply to my email: [email protected]

Thank you in advance,
Stefan

Re: Change frequncy Nagios runs some plugins.

Posted: Mon Jun 18, 2012 9:54 am
by agriffin
As far as I know, you can't "convert" an SNMP string to a double. Instead, I'm suggesting you post-process the check result to add performance data for Nagios to read.

Code: Select all

define command{
    command_name check_atr
    command_line $USER1$/check_snmp -H $HOSTADDRESS -C public iso.3.6.1.4.1.xxxxx | sed 's/.*"\([0-9.-]*\)" |/& | atr=\1/'
}


define command{
    command_name check_owd
    command_line $USER1$/check_snmp -H $HOSTADDRESS -C public iso.3.6.1.4.1.xxxxx | sed 's/.*"\([0-9.-]*\)" |/& | owd=\1/'
}
The sed command transforms the check results into something like this:
SNMP OK - "82015315.6" | atr=82015315.6
SNMP OK - "0.000217" | owd=0.000217