HP XC System Software Administration Guide Version 3.1
Example 20-1 Running a Nagios Plug-In from the Command Line
1. Log in as the nagios user.
2. Proceed to the /opt/hptc/nagios/libexec directory.
$ cd /opt/hptc/nagios/libexec
3. Use the ls command to locate the Nagios plug-in you want to execute, for example:
$ ls *_sel
4. Optionally, invoke the Nagios plug-in with the --help option:
$ ./check_sel --help
check_sel [--help] -H hostname [-t timeout]
--help
-H Host to check
--cache file Persistent cache to remember where we last read/processed
default /hptc_cluster/adm/logs/sel/cache/selcache-$nodename.db
--clear Clear the SEL log after reading
--clearifused n Clear the log only if it is past n% full
--ignoreunknownhosts
Ignore unknown hosts, default is to return critical
--last n[dhm] Only log entries from the last n days, hours, or minutes
--logfile file Log output to file,
default /hptc_cluster/adm/logs/sel/sel-{host}.log
--rules file File containing rule patterns, default /opt/hptc/nagios/etc/selRules
--cp cptype Console type string
5. Execute the Nagios plug-in:
$ ./check_sel -H n7
No new entries in event log
$
20.2.5 Using the nrg Command's Analyze Mode
The Nagios Report Generator (nrg) utility features an analyze mode that can help you determine the cause
of a problem and it offers information on the solution.
Enter following command to invoke the nrg utility's analyze mode:
# nrg --mode analyze
Nodelist Description
----------------------- -----------------------------------------------------
nh [Configuration Monitor - NOOUTPUT] A service has
failed to return an output status. Typically this
indicates a plug-in failure. Run the plug-in
directly to observe any error conditions. In some
cases, this exact message is returned from check_nrpe
when a nrpe directive is failing to execute a
command. If you can determine which nrpe command is
being requested by the associated plug-in (see
/opt/hptc/nagios/etc/nrpe_local.cfg for a list) you
can test it using the 'check_nrpe -H nodename -c
command' plug-in.
nh [Environment - ASSUMEDOK] Pending services are
normal, they indicate data has not yet been received
by the Nagios engine. Service *may* be fine, but if
20.2 Nagios Troubleshooting 231