I see that abrist has already responded - but as I crafted this response already, I figured I'd post it in case you find it useful.
Fortunately this is a pretty straightforward process. It sounds like your remote hosts already have SNMP up and running properly - double check that snmpd is running on the linux hosts.
Next, we'll want to install check_uptime.pl on your Nagios XI server. You can either transfer it over via SCP or similar, or you can copy the text and paste it into a new file. Be sure that the check_uptime.pl plugin is installed in the /usr/local/nagios/libexec directory. Check to sure that the execute bit is set - typical permissions are 755.
Code: Select all
chmod 755 /usr/local/nagios/libexec/check_uptime.pl
After the plugin is installed, let's take a look at the help menu:
Code: Select all
/usr/local/nagios/libexec/check_uptime.pl -h
Uptime Plugin for Nagios (check_uptime) v. 0.52
GPL licence, (c) 2008-2012 William Leibzon
Usage: /usr/local/nagios/libexec/check_uptime.pl [-v [debugfilename]] [-T local|unix-host|unix-sys|win|net] [-H <host> (-C <snmp_community>) [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>) [-p <port>]] [-w <warn minutes> -s <crit minutes>] [-f] [-P <previous perf data from nagios $SERVICEPERFDATA$>] [-t <timeout>] | [-V] [--label <string>]
Debug & Console Options:
-v, --verbose[=FILENAME], --debug[=FILENAME]
print extra debugging information.
if filename is specified instead of STDOUT the debug data is written to that file
-h, --help
print this help message
-V, --version
prints version number
Standard Options:
-T, --type=auto|local|unix-host|unis-sys|windows|netswitch
Type of system:
local : localhost (executes 'uptime' command), default if no -C or -l
unix-host : SNMP check from hostUptime (1.3.6.1.2.1.25.1.1.0) OID
unix-sys : SNMP check from sysUptime (1.3.6.1.2.1.1.3.0) OID
win | windows : SNMP check from sysUptime (1.3.6.1.2.1.1.3.0) OID
net | netswitch : SNMP check from snmpEngineTime (1.3.6.1.6.3.10.2.1.3) OID
auto : Autodetect what system by checking sysSystem OID first, default
-w, --warning[=minutes]
Report nagios WARNING alert if system has been up for less then specified
number of minutes. If no minutes are specified but previous preformance
data is fed back with -P option then alert is sent ONLY ONCE when
uptime changes from greater value to smaller
-c, --critical[=minutes]
Report nagios CRITICAL alert if system has been up for less then
specified number of minutes or ONE ALERT if -P option is used and
system's previous uptime is larger then current on
-f, --perfparse
Perfparse compatible output
-P, --prev_perfdata
Previous performance data (normally put '-P $SERVICEPERFDATA$' in
nagios command definition). This is recommended if you dont specify
type of system with -T so that previously checked type of system info
is reused. This is also used to decide on warning/critical condition
if number of seconds is not specified with -w or -c.
--label=[string]
Optional custom label before results prefixed to results
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default: 15)
SNMP Access Options:
-H, --hostname=HOST
name or IP address of host to check (if not localhost)
-C, --community=COMMUNITY NAME
community name for the SNMP agent (used with v1 or v2c protocols)
-2, --v2c
use snmp v2c (can not be used with -l, -x)
-l, --login=LOGIN ; -x, --passwd=PASSWD
Login and auth password for snmpv3 authentication
If no priv password exists, implies AuthNoPriv
-X, --privpass=PASSWD
Priv password for snmpv3 (AuthPriv protocol)
-L, --protocols=<authproto>,<privproto>
<authproto> : Authentication protocol (md5|sha : default md5)
<privproto> : Priv protocols (des|aes : default des)
-p, --port=PORT
SNMP port (Default 161)
Using the above as a guide, we can craft a command that will check the uptime of a remote server using common SNMP OID's. Please take a look at the following examples:
Code: Select all
/usr/local/nagios/libexec/check_uptime.pl -H 192.168.x.x -C public
Code: Select all
/usr/local/nagios/libexec/check_uptime.pl -H 192.168.4.146 -C public -T unix-host
Use the help menu to craft your command. When you're finished, you can define the command in the 'commands' section of CCM and generate services based on it. Please let me know if you need help with that portion of the setup. Thanks!