Page 1 of 1

How to check whether my Apache is running or not using ncpa

Posted: Fri Aug 03, 2018 4:19 am
by charangandra
Hi,

Is there any way I can check whether my other services like httpd is running on a remote VM using ncpa passive checks?

[passive checks]
%HOSTNAME%|__HOST__|120 = system/agent_version
%HOSTNAME%|Disk Usage = disk/logical/| --warning 80 --critical 90 --units Gi
%HOSTNAME%|CPU Usage = cpu/percent --warning 80 --critical 90 --aggregate avg
%HOSTNAME%|Swap Usage = memory/swap --warning 80 --critical 90 --units Gi
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
%HOSTNAME%|Process Check = processes -q 'name=httpd' -c 1:1


I tried to use the above config, but Process Count and Process Check both are giving me the same results.

Thanks,
Charan

Re: How to check whether my Apache is running or not using n

Posted: Fri Aug 03, 2018 6:05 am
by charangandra
I've managed to find another plugin to do this.

contents of nrdp.cfg

[passive checks]
%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|Service Check|60 = services -q service=httpd,status=running

log:

2018-08-03 11:00:58,738 86474 INFO Running check: services -q service=httpd,status=running
2018-08-03 11:00:58,848 86474 INFO Message from NRDP server: OK
2018-08-03 11:00:58,849 86474 INFO Meta output from NRDP server: 1 checks processed.

However Nagios is not receiving the service perfdata and service state properly.

Nagios Configuration

define service {
use passive-service
service_description Service Check
host_name WEBSERVER
servicegroups WEB

}

DATATYPE::SERVICEPERFDATA TIMET::1533294186 HOSTNAME::WEBSERVER SERVICEDESC::Service Check SERVICEPERFDATA:: SERVICECHECKCOMMAND::check_dummy!0 HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::UNKNOWN SERVICESTATETYPE::HARD


Am I missing anything here?

Thanks,
Charan

Re: How to check whether my Apache is running or not using n

Posted: Mon Aug 06, 2018 11:22 am
by cdienger
Instead of:

%HOSTNAME%|Service Check|60 = services -q service=httpd,status=running

Try using the following for the config:

%HOSTNAME%|Service Check|60 = services?service=httpd,status=running