check appache
-
hanya.radwan
- Posts: 194
- Joined: Tue Feb 25, 2014 6:12 am
- Location: palestine
check appache
hi,
I tried to check apache on solaries server, but always the result as the following:
[root@nms ~]# /usr/local/nagios/libexec/check_nrpe -H 10.103.200.63 -t 120 -c check_init_service -a 'httpd'
NRPE: Unable to read output
thanks,
I tried to check apache on solaries server, but always the result as the following:
[root@nms ~]# /usr/local/nagios/libexec/check_nrpe -H 10.103.200.63 -t 120 -c check_init_service -a 'httpd'
NRPE: Unable to read output
thanks,
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check appache
How do you have "check_init_service" defined on the solaris server's nrpe.cfg? Can you verify there is actually a service called httpd running?
-
hanya.radwan
- Posts: 194
- Joined: Tue Feb 25, 2014 6:12 am
- Location: palestine
Re: check appache
this service (check_init_service) not defined in NRPE.cfg file . also there is service named httpd on this server
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check appache
You cannot run a check command through NRPE if it is not defined... Please read over the following document, it will show you how to add new commands in the NRPE.cfg file, for additional plugins:
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
-
hanya.radwan
- Posts: 194
- Joined: Tue Feb 25, 2014 6:12 am
- Location: palestine
Re: check appache
I can't find the plugin of check_init_service
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check appache
If you cannot find it on that server, then it does not exist, so you cannot call it... You will need to find a suitable plugin, either in the nagios plugins package, or via the exchange, then set it up with a new command in the nrpe.cfg file, and restart xinetd if that is what you use to initiate NRPE (default if you ran the xi agent installer).
-
hanya.radwan
- Posts: 194
- Joined: Tue Feb 25, 2014 6:12 am
- Location: palestine
Re: check appache
sorry for late:
I check about process java in remote host , but always the error as following, also I define check_procs command in nrpe.cfg as attached:-
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.103.200.63 -t 120 -c \'check_procs "-c 1:40 -w 1:20" -a "java"\'
OUTPUT: CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
other nrpe service, it is Ok :
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.103.200.63 -t 120 -c check_cpu_stats -a '-w 80,40,30 -c 95,60,40'
OUTPUT: CPU STATISTICS OK : user=1% system=0%, iowait=0%, idle=99%, nice=0.00%, steal=0.00% | CpuUser=1%;80;95;0; CpuSystem=0%;40;60;0; CpuIowait=0%;30;40;0; CpuIdle=99%;0;0;0; CpuNice=0.0%;0;0;0; CpuSteal=0.0%;0;0;0;
I check about process java in remote host , but always the error as following, also I define check_procs command in nrpe.cfg as attached:-
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.103.200.63 -t 120 -c \'check_procs "-c 1:40 -w 1:20" -a "java"\'
OUTPUT: CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
other nrpe service, it is Ok :
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.103.200.63 -t 120 -c check_cpu_stats -a '-w 80,40,30 -c 95,60,40'
OUTPUT: CPU STATISTICS OK : user=1% system=0%, iowait=0%, idle=99%, nice=0.00%, steal=0.00% | CpuUser=1%;80;95;0; CpuSystem=0%;40;60;0; CpuIowait=0%;30;40;0; CpuIdle=99%;0;0;0; CpuNice=0.0%;0;0;0; CpuSteal=0.0%;0;0;0;
You do not have the required permissions to view the files attached to this post.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check appache
You have a couple of things that need fixing.
We'll be ignoring the java bit to start off with, it just makes it easier to explain.
In nrpe.cfg you have this defined:
Which means the command needs to be:
Notice how the command does NOT include the -w -c and -s argument flags. NRPE only needs the values for the arguments.
Which outputs something like:
Now if you DON'T have a secret and you try and run this command:
You will get this output:
Which is basically telling us one of the arguments was not correct (the value for -s was not supplied).
I assume you are not using a secret with NRPE. Also, to check a process the nrpe.cfg needs to know what argument will contain the process name. So this means your nrpe.cfg file needs the following line:
Notice how we changed -s to -a
Edit nrpe, make the changes, save the file and restart the service
Now the command you will execute from your Nagios host will be:
Which will output something like:
This should sort your problem out, let us know how you go.
We'll be ignoring the java bit to start off with, it just makes it easier to explain.
In nrpe.cfg you have this defined:
Code: Select all
command[check_procs]=/opt/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.133 -t 120 -c check_procs -a 1:20 1:40 secretWhich outputs something like:
Code: Select all
PROCS CRITICAL: 141 processesCode: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.133 -t 120 -c check_procs -a 1:20 1:40Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.133 -t 120 -c check_procs -a 1:20 1:40
Usage: check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-t timeout] [-v]I assume you are not using a secret with NRPE. Also, to check a process the nrpe.cfg needs to know what argument will contain the process name. So this means your nrpe.cfg file needs the following line:
Code: Select all
command[check_procs]=/opt/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -a $ARG3$Edit nrpe, make the changes, save the file and restart the service
Code: Select all
service xinetd restartCode: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.133 -t 120 -c check_procs -a 1:20 1:40 javaCode: Select all
PROCS OK: 2 processes with args 'java'As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
hanya.radwan
- Posts: 194
- Joined: Tue Feb 25, 2014 6:12 am
- Location: palestine
Re: check appache
it is working