Page 2 of 2

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 1:34 pm
by donnyforbes
if this works from the remote server and the Nagios server how do I now add it in the NagiosXI console?

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 1:41 pm
by lmiltchev
On the remote server, you can set the following command in the nrpe.cfg file (if you don't have it already):

Code: Select all

command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$
and restart NRPE, so that changes can take effect.

Test your check by running the following command from the command line on the Nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <remote ip> -c check_procs -a '-c 1: -C httpd'
If it works as expected, set up a service in Nagios XI.

Example config:

Code: Select all

define service {
    host_name                   myhost
    service_description         Procs HTTPD
    use                         xiwizard_nrpe_service
    check_command               check_nrpe!check_procs!-a '-c: 1 -C httpd'
    max_check_attempts          5
    check_interval              5
    retry_interval              1
    check_period                xi_timeperiod_24x7
    notification_interval       60
    notification_period         xi_timeperiod_24x7
    notifications_enabled       1
    contacts                    nagiosadmin
    _xiwizard                   linux-server
    register                    1
}

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 1:47 pm
by donnyforbes
here is the output. looks like it ran

Code: Select all

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

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 1:53 pm
by lmiltchev
Yeah, it seems like it's working as expected. Try stopping the httpd process on the remote server, and test your check again. You should get a "critical".

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 2:00 pm
by donnyforbes
I don't see where to put this in at.
check_nrpe!check_procs!-a '-c: 1 -C httpd'

I have done what you asked just not sure what to put in $ARG! etc.. Please advise or show me if you can.

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 2:03 pm
by donnyforbes
I got it figured out thanks. I added this in $ARG1$ check_procs -a '-c 1: -C httpd'

we are good now.

Re: Monitoring HTTPD

Posted: Mon Nov 26, 2018 2:05 pm
by lmiltchev
Great! I am glad I could help!

Is it OK if we close this topic now?

Re: Monitoring HTTPD

Posted: Tue Nov 27, 2018 11:31 am
by donnyforbes
Sure you can close this. Again thanks for your assistance.