UpTime check via SNMP

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

UpTime check via SNMP

Post by mpedros »

Hi:

I am checking the uptime of a desktop by SNMP and it works correctly.

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance
SNMP OK - 853898 | DISMAN-EVENT-MIB::sysUpTimeInstance=853898
[root@localhost libexec]#
How could I have generated a warning if the value is less than for example "8000 timeticks"? I guess with regular expressions but I do not know how to configure it.

I thank you in advance for the help.
Last edited by mpedros on Sat Jun 15, 2019 9:55 am, edited 1 time in total.
Martin Pedros
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UpTime check via SNMP

Post by scottwilkerson »

Code: Select all

./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -w @8000
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

Re: UpTime check via SNMP

Post by mpedros »

Hi Scott:

Thank you very much for your prompt response, it worked correctly! Do you have any suggestions where I can study these types of expressions for SNMP monitoring?

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -w @8000
SNMP OK - 4833603 | DISMAN-EVENT-MIB::sysUpTimeInstance=4833603;8000;;
[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -w @5000000
SNMP WARNING - *4835102* | DISMAN-EVENT-MIB::sysUpTimeInstance=4835102;5000000;;
[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -c @5000000
SNMP CRITICAL - *4836174* | DISMAN-EVENT-MIB::sysUpTimeInstance=4836174;;5000000;
[root@localhost libexec]#
Thank you and have a nice day!
Martin Pedros
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UpTime check via SNMP

Post by scottwilkerson »

mpedros wrote: Thank you very much for your prompt response, it worked correctly! Do you have any suggestions where I can study these types of expressions for SNMP monitoring?
great!

Here is the resource
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT

This is how official plugins are supposed to work but, many plugins are from the community that may not conform.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

Re: UpTime check via SNMP

Post by mpedros »

Thank you very much Scott, have a nice day!
Martin Pedros
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: UpTime check via SNMP

Post by scottwilkerson »

mpedros wrote:Thank you very much Scott, have a nice day!
You too!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked