Page 1 of 2

Monitoring HTTPD

Posted: Wed Nov 21, 2018 6:01 pm
by donnyforbes
Informix run something called OAT which is really HTTPD. I want to monitor this on my linux server. What is the best way to do this.
Basically I need to be notified when the service is not running...

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 9:45 am
by lmiltchev
Do you have an agent installed on the Informix machine? Are you currently monitoring it (for example via NCPA, NRPE, SNMP, etc.)? I would recommend trying NCPA first if you haven't done this already.

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 10:00 am
by mcapra
donnyforbes wrote:Basically I need to be notified when the service is not running...
Piggy-backing off @lmiltchev, NCPA makes checking the status of some init unit/service pretty easy:
https://www.nagios.org/ncpa/help.php#ap ... s-services

More general purpose info about checking init systems:
https://support.nagios.com/kb/article/s ... s-775.html

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 10:32 am
by lmiltchev
Thanks Matt!

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 11:57 am
by donnyforbes
Yes on this Linux Machine that I want to monitored httpd on we are using NRPE. Please give me detail on how to monitor httpd.
On the same machine I am monitor connection manager and informix that is working as well. I just need to get httpd monitored now.
Please advise.

Thanks

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 12:11 pm
by lmiltchev
You can try using the check_procs plugin. Test the plugin first by running it locally (on the remote box):

Code: Select all

/path/to/check_procs -c 1: -C OAT
The check should turn critical if less than 1 process, called "OAT" is found. I am not sure if this is the actual name of the process - can't test it in-house. What do you see when you run "ps -ef" from the CLI?

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 12:21 pm
by donnyforbes
ok do I test from the remote servers running informix or from the nagios server itself?

Here is what I see
0:05:56 /usr/infx1210fc8/OAT/Apache_2.4.2/bin/httpd -f /usr/infx1210fc8/OAT/Apache_2.4.2/conf/httpd.conf -k start

Code: Select all

root     55448     1  0 Nov05 ?        00:00:50 /usr/infx1210fc8/OAT/Apache_2.4.2/bin/httpd -f /usr/infx1210fc8/OAT/Apache_2.4.2/conf/httpd.conf -k start
daemon   55449 55448  0 Nov05 ?        00:05:44 /usr/infx1210fc8/OAT/Apache_2.4.2/bin/httpd -f /usr/infx1210fc8/OAT/Apache_2.4.2/conf/httpd.conf -k start
daemon   55450 55448  0 Nov05 ?        00:05:45 /usr/infx1210fc8/OAT/Apache_2.4.2/bin/httpd -f /usr/infx1210fc8/OAT/Apache_2.4.2/conf/httpd.conf -k start
daemon   55451 55448  0 Nov05 ?        00:05:47 /usr/infx1210fc8/OAT/Apache_2.4.2/bin/httpd -f /usr/infx1210fc8/OAT/Apache_2.4.2/conf/httpd.conf -k start

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 12:53 pm
by lmiltchev
Test running the plugin on the remove machine first, in order to make sure it works locally.

What is the output of the following command, run as root and as nagios user?

Code: Select all

/path/to/check_procs -c 1: -C httpd

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 1:14 pm
by donnyforbes
lmiltchev wrote:Test running the plugin on the remove machine first, in order to make sure it works locally.

What is the output of the following command, run as root and as nagios user?

Code: Select all

/path/to/check_procs -c 1: -C httpd
How can I find the path to check_procs? is there a default one?

Thanks

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 1:21 pm
by donnyforbes
Ok here is the output from the remote server...

Code: Select all

[root@huey ~]# /usr/local/nagios/libexec/check_procs -c 1: -C httpd
PROCS OK: 5 processes with command name 'httpd' | procs=5;;1:;0;
[root@huey ~]#

Code: Select all

[root@huey libexec]# su - nagios
Last login: Mon Nov 19 14:17:05 PST 2018 on pts/0
[nagios@huey ~]$ /usr/local/nagios/libexec/check_procs -c 1: -C httpd
PROCS OK: 5 processes with command name 'httpd' | procs=5;;1:;0;
[nagios@huey ~]$
output from NAGIOS Server

Code: Select all

[root@nag libexec]# /usr/local/nagios/libexec/check_procs -c 1: -C httpd
PROCS OK: 11 processes with command name 'httpd' | procs=11;;1:;0;
You have mail in /var/spool/mail/root
[root@nag libexec]#