How to Monitor Switch Uptime

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.
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

How to Monitor Switch Uptime

Post by Alan »

I am trying to figure out how to set the switch.cfg file for monitoring uptime. The OID that I have from the MIB Browser is hrSystemUptime .1.3.6.1.2.1.25.1.1.0

This is the website that I am tying to follow - https://assets.nagios.com/downloads/nag ... uters.html

These are all the ways I have tird to add the OID to the switch.cfg file:

Code: Select all

define service {
    use                 generic-service ; Inherit values from a template
    host_name           Accessories
    service_description Uptime
    check_command       check_snmp!-C CMPublic -o hrSystemUptime.1.3.6.1.2.1.25.1.1.0
}

Code: Select all

define service {
    use                 generic-service ; Inherit values from a template
    host_name           linksys-srw224p
    service_description Uptime
    check_command       check_snmp!-C CMPublic -o sysUpTime.1.3.6.1.2.1.25.1.1.0
}

Code: Select all

define service {
    use                 generic-service ; Inherit values from a template
    host_name           linksys-srw224p
    service_description Uptime
    check_command       check_snmp!-C CMPublic -o .1.3.6.1.2.1.25.1.1.0
}
This is all the output that I get and it always just says the status is critical:

(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp, ...) failed. errno is 2: No such file or directory

When I navigate to /usr/local/nagios/libexec there is a check_smtp
-rwxr-xr-x. 1 nagios nagios 272336 Aug 15 10:07 check_smtp
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to Monitor Switch Uptime

Post by scottwilkerson »

Alan wrote:(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp, ...) failed. errno is 2: No such file or directory
This is /usr/local/nagios/libexec/check_snmp
Alan wrote:When I navigate to /usr/local/nagios/libexec there is a check_smtp
-rwxr-xr-x. 1 nagios nagios 272336 Aug 15 10:07 check_smtp
This is /usr/local/nagios/libexec/check_smtp

check_snmp vs. check_smtp

what is the output of

Code: Select all

ls -l /usr/local/nagios/libexec/check_snmp
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: How to Monitor Switch Uptime

Post by Alan »

Sorry for the delay on this. The output of the command is:

Code: Select all

ls -l /usr/local/nagios/libexec/check_snmp
ls: cannot access /usr/local/nagios/libexec/check_snmp: No such file or directory
I did not even notice it was the check_smtp and not check_snmp. So ya the check_snmp in not there. Do you happen to know how I would get this added?
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: How to Monitor Switch Uptime

Post by Alan »

I do see the plugin in the nagios-plugins-2.2.1.tar.gz and I am using nagios-plugins-2.1.1. I am also running Nagios Core Version 4.1.1. So I think I am going to attempt to upgrade it to Nagios Core is 4.4.5. If I successfully do this will this also update the plugins?

I am going to be following the instructions here on how to upgrade - https://assets.nagios.com/downloads/nag ... ading.html

This post did say "Make sure you have a good backup of your existing Nagios Core installation and configuration files." Is there away to back all these up in the Nagios dashboard somewhere or do I just need to manually back up all the files located here:

/usr/local/nagios/etc/objects
/usr/local/nagios/etc
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to Monitor Switch Uptime

Post by scottwilkerson »

Alan wrote:I do see the plugin in the nagios-plugins-2.2.1.tar.gz and I am using nagios-plugins-2.1.1. I am also running Nagios Core Version 4.1.1. So I think I am going to attempt to upgrade it to Nagios Core is 4.4.5. If I successfully do this will this also update the plugins?

I am going to be following the instructions here on how to upgrade - https://assets.nagios.com/downloads/nag ... ading.html
This will not upgrade, the plugins, to upgrade the plugins you can follow this guide (installing and upgrading plugins are the same procedure)
https://support.nagios.com/kb/article.php?id=569
Alan wrote:This post did say "Make sure you have a good backup of your existing Nagios Core installation and configuration files." Is there away to back all these up in the Nagios dashboard somewhere or do I just need to manually back up all the files located here:

/usr/local/nagios/etc/objects
/usr/local/nagios/etc
Yes
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: How to Monitor Switch Uptime

Post by Alan »

Ok great thanks. Once I get it all updated are you able to tell me what syntax I need to use for the OID?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to Monitor Switch Uptime

Post by scottwilkerson »

Alan wrote:Ok great thanks. Once I get it all updated are you able to tell me what syntax I need to use for the OID?
The OIDs you need to use to monitor systems always depend on the manufacturer of the hardware you are using.

You will need to consult their documentation for those.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: How to Monitor Switch Uptime

Post by Alan »

So I updated Nagios to Nagios Core 4.4.5 but when I go to the /usr/local/nagios/libexec there is still no check_snmp.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to Monitor Switch Uptime

Post by scottwilkerson »

As I stated before:
scottwilkerson wrote:
This will not upgrade, the plugins, to upgrade the plugins you can follow this guide (installing and upgrading plugins are the same procedure)
https://support.nagios.com/kb/article.php?id=569
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: How to Monitor Switch Uptime

Post by Alan »

Sorry about that. I am not sure how I missed that.
Locked