I have 2 REHL 6 64bit servers that are failing on 1 service check. The process is running, but the check returns an unknown state. What types of things should I look for to troubleshoot the agent check against this service? Other services work fine.
root@SERVER1 [/root]
$ ps -ef | grep rsyslog
root 1657 1 0 Aug12 ? 00:01:24 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
root@SERVER2 [/root]
$ ps -ef | grep rsyslog
root 1901 1 0 Aug01 ? 00:04:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
NCPA service check returns unknown
Re: NCPA service check returns unknown
You have a few options the way I see it:
1. Change uid and gid from nagios to root in the ncpa.cfg file.
and restart ncpa_listener service.
2. Check for the rsyslog process (instead of a service).
Example:
3. Use a custom script on the remote machine that checks if rsyslog is running, which you can call via NCPA.
Example script:
Example check:
4. Upgrade to CentOS 7
On RHEL 7, nagios user will be able to check the status on all services. This works differently, compared to RHEL 6.
1. Change uid and gid from nagios to root in the ncpa.cfg file.
Code: Select all
uid = root
gid = rootCode: Select all
service ncpa_listener restartExample:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t '<your token>' -M 'processes' -q 'name=rsyslog,match=search'Example script:
Code: Select all
#!/bin/bash
service=$1
count=$(ps -ef | grep -v grep | grep $service | wc -l)
if [ "$count" = "0" ]; then
echo "$service is NOT running"
else
echo "$service is running"
fiCode: Select all
/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t '<your token>' -M 'plugins/check_rsyslog.sh' -q 'args=rsyslog'On RHEL 7, nagios user will be able to check the status on all services. This works differently, compared to RHEL 6.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA service check returns unknown
Changing it to a process check does work.
Re: NCPA service check returns unknown
Ok, are we okay to mark this as resolved and lock the topic?