How could i check a service that contains a space?
How could i check a service that contains a space?
How could i check a service that contains a space?
for example services on linux: "dsmc sched"
when i exec:
[root@DOUAI nrpe]# /usr/local/nagios/libexec/nrpe/check_services -p "dsmc sched"
dsmc: 2 sched: 3
or
[root@DOUAI nrpe]# /usr/local/nagios/libexec/nrpe/check_services -p "sched"
sched: 3
but i have just 1 service started and not 3.
[root@DOUAI nrpe]# ps -aux | grep dsmc
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 10785 0.0 0.0 408516 17112 pts/1 Sl+ Aug31 0:35 dsmc sched
root 22620 0.0 0.0 103364 796 pts/2 R+ 10:24 0:00 grep dsmc
for example services on linux: "dsmc sched"
when i exec:
[root@DOUAI nrpe]# /usr/local/nagios/libexec/nrpe/check_services -p "dsmc sched"
dsmc: 2 sched: 3
or
[root@DOUAI nrpe]# /usr/local/nagios/libexec/nrpe/check_services -p "sched"
sched: 3
but i have just 1 service started and not 3.
[root@DOUAI nrpe]# ps -aux | grep dsmc
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 10785 0.0 0.0 408516 17112 pts/1 Sl+ Aug31 0:35 dsmc sched
root 22620 0.0 0.0 103364 796 pts/2 R+ 10:24 0:00 grep dsmc
Re: How could i check a service that contains a space?
Do you have the check_procs plugin installed? Try that and see if the output is what you want.
Run it like this from the folder that it is installed in.
Run it like this from the folder that it is installed in.
Code: Select all
./check_procs -a 'dsmc sched'Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How could i check a service that contains a space?
Tgriep you are right, thx..
[root@DOUAI libexec]# ./check_procs -a 'dsmc sched'
PROCS OK: 1 process with args 'dsmc sched' | procs=1;;;0;
[root@DOUAI libexec]# ./check_procs -a 'dsmc sched'
PROCS OK: 1 process with args 'dsmc sched' | procs=1;;;0;
Re: How could i check a service that contains a space?
Is there anything else we can help out with in this particular thread?paulol wrote:Tgriep you are right, thx..
[root@DOUAI libexec]# ./check_procs -a 'dsmc sched'
PROCS OK: 1 process with args 'dsmc sched' | procs=1;;;0;
Former Nagios Employee.
me.
me.
Re: How could i check a service that contains a space?
Just now im trying to exec via nrpe the following script, but it shows me 2 process.
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a dsmc sched'
PROCS WARNING: 2 processes with args 'dsmc' | procs=2;sched;;0;
or
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a 'dsmc sched''
PROCS OK: 2 processes with args 'dsmc' | procs=2;;;0;
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a dsmc sched'
PROCS WARNING: 2 processes with args 'dsmc' | procs=2;sched;;0;
or
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a 'dsmc sched''
PROCS OK: 2 processes with args 'dsmc' | procs=2;;;0;
Re: How could i check a service that contains a space?
In the second command you used a single quote followed by a double quote.. not sure if this is a typo or not.paulol wrote:Just now im trying to exec via nrpe the following script, but it shows me 2 process.
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a dsmc sched'
PROCS WARNING: 2 processes with args 'dsmc' | procs=2;sched;;0;
or
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a 'dsmc sched''
PROCS OK: 2 processes with args 'dsmc' | procs=2;;;0;
Former Nagios Employee.
me.
me.
Re: How could i check a service that contains a space?
[root@DOUAI etc]# /usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a 'dsmc sched' '
PROCS OK: 2 processes with args 'dsmc' | procs=2;;;0;
Its a typo.
PROCS OK: 2 processes with args 'dsmc' | procs=2;;;0;
Its a typo.
Re: How could i check a service that contains a space?
How do you have "check_procs" defined on 10.0.32.83? If you had:
change it to:
and restart xinetd:
Test your check again:
Let me know if this fixed your issue.
Code: Select all
command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$Code: Select all
command[check_procs]=/usr/local/nagios/libexec/check_procs "$ARG1$"Code: Select all
service xinetd restartCode: Select all
/usr/local/nagios/libexec/check_nrpe -H 10.0.32.83 -t 30 -c check_procs -a '-a 'dsmc sched''Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How could i check a service that contains a space?
Code: Select all
vi /usr/local/nagios/etc/nrpe.cfg
command[check_procs]=/usr/local/nagios/libexec/nrpe/check_procs "$ARG1$"PROCS OK: 1 process with args 'dsmc sched' | procs=1;;;0;
Now, it works, but i have to modify this in all my servers.
It will be a difficult job.
Re: How could i check a service that contains a space?
That is good to hear. Shall I close this post?
Be sure to check out our Knowledgebase for helpful articles and solutions!