check_procs recommendation

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.
Locked
[email protected]
Posts: 2
Joined: Thu Mar 11, 2021 3:05 pm

check_procs recommendation

Post by [email protected] »

Hello.

We are running Nagios Core 4.4.6 on RHEL7 and monitoring remote RHEL6 and RHEL7 servers.

I would like to check for 5 separate processes running as root. For example:

$ ps -fu root | egrep "snmpd|atd|sshd|crond|kauditd"
root 114 2 0 Mar03 ? 00:00:07 [kauditd]
root 985 1 0 Mar03 ? 00:00:00 /usr/sbin/atd -f
root 988 1 0 Mar03 ? 00:01:15 /usr/sbin/crond -n
root 1200 1 0 Mar03 ? 00:00:03 /usr/sbin/sshd -D
root 1202 1 0 Mar03 ? 00:10:00 /usr/sbin/snmpd -LS0-4d -Lf /dev/null -p /var/run/snmpd.pid -f

I have experimented with check_nrpe and check_procs and --ereg-argument-array. I encounter problems with nrpe such as.:
Client request from X.X.X.X was invalid, bailing out...
Error: Request contained illegal metachars!

The Services Status Details for the remote server will show.:
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

This will work locally.:
/usr/lib64/nagios/plugins/check_procs -w 5:5 --ereg-argument-array "snmpd|atd|sshd|crond|kauditd" -k -u root -t 10
PROCS OK: 5 processes with regex args 'snmpd,atd,sshd,crond,kauditd', UID = 0 (root) | procs=5;5:5;;0;

Could you recommend a method with check_procs to monitor 5 separate processes on those remote Linux servers?

Thanks in advance!
[email protected]
Posts: 2
Joined: Thu Mar 11, 2021 3:05 pm

Re: check_procs recommendation

Post by [email protected] »

Hello.

I decided to split the check_procs into 5 separate checks. There will be 5 separate services under each host. And then the problem will be clear.

Code: Select all

define service {
    use                     fifteenminute-service
    hostgroup_name          linux
    service_description     LINUX ATD
    check_command           check_nrpe!check_procs -a '-C atd -k -t 10 -u root -w 1:1'
    notifications_enabled   1
}

define service {
    use                     fifteenminute-service
    hostgroup_name          linux
    service_description     LINUX CROND
    check_command           check_nrpe!check_procs -a '-C crond -k -t 10 -u root -w 1:1'
    notifications_enabled   1
}

and so on ...

Thanks very much.
Locked