I am having a problem checking a particular service via nrpe. I am looking to see if this service is running or not.
-a "filter=name like str(MSSQL$WORKER)" "crit=state ne str(running)"
but its also detecting the service MSSQL$SQLEXPRESS
how can i make the argument where it looks' for MSSQL$WORKER only no other service.
checking services with nrpe
Re: checking services with nrpe
Hi localit,
It looks like the the shell is probably interpreting the "$" and is replacing the rest of the string with the contents of the variable "$WORKER" which probably doesn't exist. So the string that ends up being passed on is "MSSQL". Please find our knowledge base article on the subject below:
https://support.nagios.com/kb/article/n ... s-580.html
Thanks and Best Regards,
Keith
It looks like the the shell is probably interpreting the "$" and is replacing the rest of the string with the contents of the variable "$WORKER" which probably doesn't exist. So the string that ends up being passed on is "MSSQL". Please find our knowledge base article on the subject below:
https://support.nagios.com/kb/article/n ... s-580.html
Thanks and Best Regards,
Keith
Re: checking services with nrpe
kfanselow wrote:Hi localit,
It looks like the the shell is probably interpreting the "$" and is replacing the rest of the string with the contents of the variable "$WORKER" which probably doesn't exist. So the string that ends up being passed on is "MSSQL". Please find our knowledge base article on the subject below:
https://support.nagios.com/kb/article/n ... s-580.html
Thanks and Best Regards,
Keith
Thanks for the reply but $WORKER is actually part of the service that its looking for , i need to look for the exact service "MSSQL$WORKER"
I would like for it to detect nothing else but that exact service. Should i put 2 "$$" ? I even tried to exclude the other service it was detecting and that did not work.
Re: checking services with nrpe
Hi localit,
Give this a try:
Here is an example of the behavior I was trying to describe:
Thanks and Best Regards,
Keith
Give this a try:
Code: Select all
-a "filter=name like str(MSSQL\$WORKER)" "crit=state ne str(running)"Code: Select all
sh-4.2$ echo "test$testing"
test
sh-4.2$ echo "test\$testing"
test$testing
Thanks and Best Regards,
Keith
Re: checking services with nrpe
Thanks for that keith, -a "filter=name like str(MSSQL\$WORKER)" "crit=state ne str(running)" worked great for me.
Re: checking services with nrpe
Hi localit,
Glad that worked for you - we'll close out the forum thread.
Thanks and Best Regards,
Keith
Glad that worked for you - we'll close out the forum thread.
Thanks and Best Regards,
Keith