Page 1 of 1

Getting Timeticks result

Posted: Sat Dec 15, 2018 1:34 am
by truongquyen
Hi all,

How can set up the Nagios for getting the result like this?

[root@PROBE00 ~]# /usr/local/nagios/libexec/check_snmp -H 10.18.0.254 -C public -o sysUpTime.0
SNMP OK - Timeticks: (395527839) 45 days, 18:41:18.39 |

I'm getting this result:

[root@mail ~]# /usr/local/nagios/libexec/check_snmp -H 10.18.0.254 -C public -o sysUpTime.0
SNMP OK - 395059058 | DISMAN-EVENT-MIB::sysUpTimeInstance=395059058


I've tried to copy switch.cfg, commands.cfg to the 1st machine to the 2nd but nothing changed.

Tks,
NTQ

Re: Getting Timeticks result

Posted: Mon Dec 17, 2018 11:39 am
by bolson
Hello truongquyen,

The plugin check_snmp returns what it return; ie:

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 10.18.0.254 -C public -o sysUpTime.0
SNMP OK - 395059058 | DISMAN-EVENT-MIB::sysUpTimeInstance=3950590581
There does not seem to be a provision in the plugin to return the value in days. However, a wrapper script could easily be created to perform the calculation and return the value you're looking for.

Also, this plugin on the exchange might provide what you're looking for:

https://exchange.nagios.org/directory/P ... me/details

Re: Getting Timeticks result

Posted: Tue Dec 18, 2018 4:14 am
by truongquyen
Hi Brian,

Tks for your support but could you tell me how to do it? I tried to unzip the file then copied the check_snmp_uptime to usr/local/nagios/libexec and try to run the cmd but I get the result:

[root@mail libexec]# ./check_snmp_uptime -H 5.1.30.253 -C public -w 50 -c 100
-bash: ./check_snmp_uptime: /bin/bash^M: bad interpreter: No such file or directory

Could you tell me why and what should I do next?
Sorry, I'm newbie.

Tks again,
NTQ

Re: Getting Timeticks result

Posted: Tue Dec 18, 2018 10:59 am
by bolson
Hello truongquyen,

Rather than copying the file to /usr/local/nagios/libexec, Use the monitoring plugins link in the Core Configuration Manager to upload the plugin and select the Convert Line Endings checkbox which will remove the DOS ^M characters from the plugin. Let me know if you have any additional questions.