Getting Timeticks result

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Getting Timeticks result

Postby truongquyen » Sat Dec 15, 2018 1:34 am

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
truongquyen
 
Posts: 4
Joined: Mon Nov 26, 2018 3:17 am

Re: Getting Timeticks result

Postby bolson » Mon Dec 17, 2018 11:39 am

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/Plugins/System-Metrics/Uptime/check_snmp_uptime/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Brian Olson
Nagios Support Team
---
Nagios Enterprises, LLC
Email: customersupport@nagios.com
Web: https://www.nagios.com/
bolson
The Closer
 
Posts: 777
Joined: Tue Jul 11, 2017 10:34 am

Re: Getting Timeticks result

Postby truongquyen » Tue Dec 18, 2018 4:14 am

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
truongquyen
 
Posts: 4
Joined: Mon Nov 26, 2018 3:17 am

Re: Getting Timeticks result

Postby bolson » Tue Dec 18, 2018 10:59 am

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Brian Olson
Nagios Support Team
---
Nagios Enterprises, LLC
Email: customersupport@nagios.com
Web: https://www.nagios.com/
bolson
The Closer
 
Posts: 777
Joined: Tue Jul 11, 2017 10:34 am


Return to Community Support

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 26 guests