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

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
charangandra
Posts: 25
Joined: Tue Feb 13, 2018 6:23 am

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

Post 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
charangandra
Posts: 25
Joined: Tue Feb 13, 2018 6:23 am

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

Post 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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked