NCPA service check returns unknown

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

NCPA service check returns unknown

Post by hbouma »

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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA service check returns unknown

Post by lmiltchev »

You have a few options the way I see it:

1. Change uid and gid from nagios to root in the ncpa.cfg file.

Code: Select all

uid = root
gid = root
and restart ncpa_listener service.

Code: Select all

service ncpa_listener restart
2. Check for the rsyslog process (instead of a service).

Example:

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'
3. Use a custom script on the remote machine that checks if rsyslog is running, which you can call via NCPA.

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"
fi
Example check:

Code: 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'
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: NCPA service check returns unknown

Post by hbouma »

Changing it to a process check does work.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA service check returns unknown

Post by ssax »

Ok, are we okay to mark this as resolved and lock the topic?
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: NCPA service check returns unknown

Post by hbouma »

Go ahead
Locked