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

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

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

Postby charangandra » Fri Aug 03, 2018 4:19 am

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

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

Postby charangandra » Fri Aug 03, 2018 6:05 am

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

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

Postby cdienger » Mon Aug 06, 2018 11:22 am

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


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 27 guests