having trouble using strings on return
Re: having trouble using strings on return
Hmm, can you try wrapping the user macro in double quotes in the service definition to see if this is going to fix the issue?
Code: Select all
define service{
use generic-service
host_name alphprdfuse1i
service_description Container Delta FADEC Broker Health
check_command check_nrpe!check_remote_container_broker_health!-a '--user deltafadec --password B@dM0nk3y --url http://localhost:9093/jolokia --mbean org.apache.activemq:type=Broker,brokerName=amq,service=Health --attribute CurrentStatus --string --critical "$USER3$"'
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: having trouble using strings on return
Hi lmiltchev
I've attached the screen shot. thanks again
I've attached the screen shot. thanks again
Re: having trouble using strings on return
Have you tried wrapping the user macro in double quotes?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: having trouble using strings on return
actually yes, I tried double and single quotes
NRPE is still seeing the splat ! as a field delimiter ????
NRPE is still seeing the splat ! as a field delimiter ????
Re: having trouble using strings on return
How is "check_remote_container_broker_health" defined on the remote box?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: having trouble using strings on return
Code: Select all
command[check_remote_container_broker_health]=/usr/local/nagios/libexec/check_jmx4perl $ARG1$ $ARG2$
[1563223708] Command completed with return code 2 and output: CRITICAL - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' matches threshold 'Good'
[1563223708] Return Code: 2, Output: CRITICAL - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' matches threshold 'Good'
Question, does the NRPE system need to be compiled or built with some option to allow this to take place?
Re: having trouble using strings on return
OK, try this:
1. Modify your command to look like this:
Save, exit, and restart NRPE (or xinetd, depending on how you are running NRPE) so that changes can take effect.
2. In your service, pass everything in $ARG1$, but "Good". Pass "Good" in $ARG2$. Don't pass "!Good" - the "!" is already in $ARG2$ on the remote box.
This *should* work, at least it worked for us in-house.
1. Modify your command to look like this:
Code: Select all
command[check_remote_container_broker_health]=/usr/local/nagios/libexec/check_jmx4perl $ARG1$ '!$ARG2$'
2. In your service, pass everything in $ARG1$, but "Good". Pass "Good" in $ARG2$. Don't pass "!Good" - the "!" is already in $ARG2$ on the remote box.
This *should* work, at least it worked for us in-house.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: having trouble using strings on return
lmiltchev
well, I be.. that worked. tricks of the trade, still leaning. thank you so much!!!
NRPE Server
well, I be.. that worked. tricks of the trade, still leaning. thank you so much!!!
Code: Select all
define command{
command_name check_remote_container_broker_health
command_line $USER1$/check_jmx4perl $ARG1$ $ARG2$
}
Code: Select all
define service{
use generic-service
host_name alphprdfuse1i
service_description Container Delta FADEC Broker Health
check_command check_nrpe!check_remote_container_broker_health!-a "--user deltafadec --password B@dM0nk3y --url http://localhost:9093/jolokia --mbean org.apache.activemq:type=Broker,brokerName=amq,service=Health --attribute CurrentStatus --string --critical" "Good"
}
Code: Select all
command[check_remote_container_broker_health]=/usr/local/nagios/libexec/check_jmx4perl $ARG1$ '!$ARG2$'
Re: having trouble using strings on return
I am glad I was able to help!well, I be.. that worked. tricks of the trade, still leaning. thank you so much!!!
I am closing this topic now. If you have any further questions, please start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!