Monitoring HTTPD

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Monitoring HTTPD

Post 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...
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring HTTPD

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring HTTPD

Post 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
Former Nagios employee
https://www.mcapra.com/
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring HTTPD

Post by lmiltchev »

Thanks Matt!
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: Monitoring HTTPD

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring HTTPD

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: Monitoring HTTPD

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring HTTPD

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: Monitoring HTTPD

Post 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
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: Monitoring HTTPD

Post 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]#
Locked