NRPE argument syntax
Posted: Wed Jul 17, 2019 2:54 pm
Hello,
I am sorry, once I think I get it, well.... boom, slammed down
Everytime I have a new NRPE command to implement I go through a heck of a time discoverying what works.
esp in the sense of using ' and " .
here is an exaple: ( works on both Nagios and NRPE )
on the Nagios server and the NRPE server I can issue the command line and get a successful return.
please notice the " " around the name in the MBean. now to get this to work on the local nagios server I need to encapsulate the entire MBean in single quotes ' .
but this doesn't work for NRPE? I can't seem to get the correct syntax down for NRPE command service using quoting. I've tried so many variations.
This one below gets closer but still a miss
what am I missing, and again, I'm sorry this seems such a simple thing, I'm not getting.
It appears the NRPE server is stripping off the quote characters needed on the MBean - How do you maintain the quotes?
I've tried escaping \ \\ \\\ \\\\ this doesn't work, these are stripped out also. I see in the config that these are nasty characters.
ON the NRPE Server
here is the log on the NRPE server, shows it stripped off the quotes
on the NRPE server if I take that command and run it as is, it fails because the MBean needs the quotes, If I put quotes back on the MBean, It works???
how do you pass such needed characters?
thank you
I am sorry, once I think I get it, well.... boom, slammed down
Everytime I have a new NRPE command to implement I go through a heck of a time discoverying what works.
esp in the sense of using ' and " .
here is an exaple: ( works on both Nagios and NRPE )
on the Nagios server and the NRPE server I can issue the command line and get a successful return.
Code: Select all
./check_jmx4perl --user passthru --password B@dC0mpany --url http://localhost:9090/jolokia --mbean 'org.apache.camel:context=passthrumt1.inboundfile-com.ge.digital.passthru.mt1.inboundFile.CamelContext,type=context,name="com.ge.digital.passthru.mt1.inboundFile.CamelContext"' --attribute StartTimestampCode: Select all
define service{
use local-service
host_name localhost
service_description Container Delta FADEC Context StartedRoutes
check_command check_local_container_context!deltafadec!B@dM0nk3y!http://localhost:9093/jolokia!'org.apache.camel:context=delta-fadec-prod-fadec.Blueprint.Context,type=context,name="fadec.Blueprint.Context"'!StartedRoutes
}
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 3.34.2.87 -c check_remote_container_route -a '--user passthru --password B@dC0mpany --url http://localhost:9090/jolokia --mbean 'org.apache.camel:context=passthrumt1.core-com.ge.digital.passthru.coreCamelContext,type=context,name="com.ge.digital.passthru.coreCamelContext"' --attribute ExchangesCompleted'
UNKNOWN - Error: 404 javax.management.InstanceNotFoundException : org.apache.camel:context=passthrumt1.core-com.ge.digital.passthru.coreCamelContext,type=context,name=com.ge.digital.passthru.coreCamelContext
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 3.34.2.87 -c check_remote_container_route -a "-user passthru --password B@dC0mpany --url http://localhost:9090/jolokia --mbean 'org.apache.camel:context=passthrumt1.core-com.ge.digital.passthru.coreCamelContext,type=context,name="com.ge.digital.passthru.coreCamelContext" --attribute ExchangesCompleted"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 3.34.2.87 -c check_remote_container_route -a "-user passthru --password B@dC0mpany --url http://localhost:9090/jolokia --mbean 'org.apache.camel:context=passthrumt1.core-com.ge.digital.passthru.coreCamelContext,type=context,name='com.ge.digital.passthru.coreCamelContext' --attribute ExchangesCompleted"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).It appears the NRPE server is stripping off the quote characters needed on the MBean - How do you maintain the quotes?
I've tried escaping \ \\ \\\ \\\\ this doesn't work, these are stripped out also. I see in the config that these are nasty characters.
ON the NRPE Server
here is the log on the NRPE server, shows it stripped off the quotes
Code: Select all
[1563400532] Host 3.239.245.209 is asking for command 'check_remote_container_context' to be run...
[1563400532] Running command: /usr/local/nagios/libexec/check_jmx4perl --user iprcmtx --password B@dC0mpany --url http://localhost:9091/jolokia --mbean org.apache.camel:context=fleet.mt1.core-com.ge.digital.fleet.coreCamelContext,type=context,name=com.ge.digital.fleet.coreCamelContext --attribute StartedRoutes ''
how do you pass such needed characters?
Code: Select all
/usr/local/nagios/libexec/check_jmx4perl --user iprcmtx --password B@dC0mpany --url http://localhost:9091/jolokia --mbean 'org.apache.camel:context=fleet.mt1.core-com.ge.digital.fleet.coreCamelContext,type=context,name="com.ge.digital.fleet.coreCamelContext"' --attribute StartedRoutes
OK - [org.apache.camel:context=fleet.mt1.core-com.ge.digital.fleet.coreCamelContext,type=context,name="com.ge.digital.fleet.coreCamelContext",StartedRoutes] : Value 11 in range | [org.apache.camel:context#fleet.mt1.core-com.ge.digital.fleet.coreCamelContext,type#context,name#"com.ge.digital.fleet.coreCamelContext",StartedRoutes]=11;;