passing strings to remote NRPE server not working using !

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

passing strings to remote NRPE server not working using !

Post by gmills »

Hello,

when passing args remotely do you need to escape the arguments leading ! character?

Code: Select all

define service{
        use                             generic-service
        host_name                       alphprdfuse1i
        service_description             Container PassThru Broker Health
        check_command                   check_nrpe!check_remote_container_broker_health!-a '--user passthru --password B@dC0mpany --url http://localhost:9090/jolokia --mbean org.apache.activemq:type=Broker,brokerName=amq,service=Health --attribute CurrentStatus --string --critical !Good''
        }
[1562954067] Host 3.239.245.209 is asking for command 'check_remote_container_broker_health' to be run...
[1562954067] Running command: /usr/local/nagios/libexec/check_jmx4perl --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
[1562954068] Command completed with return code 2 and output: CRITICAL - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' matches threshold 'Good'
[1562954068] Return Code: 2, Output: CRITICAL - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' matches threshold 'Good'
[1562954068] Connection from 3.239.245.209 closed.

I tried escaping with \ char but doesn't work.

Code: Select all

define service{
        use                             generic-service
        host_name                       alphprdfuse1i
        service_description             Container PassThru Broker Health
        check_command                   check_nrpe!check_remote_container_broker_health!-a '--user passthru --password B@dC0mpany --url http://localhost:9090/jolokia --mbean org.apache.activemq:type=Broker,brokerName=amq,service=Health --attribute CurrentStatus --string --critical \!Good''
        }
[1562954667] Running command: /usr/local/nagios/libexec/check_jmx4perl --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
[1562954667] Command completed with return code 2 and output: CRITICAL - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' matches threshold 'Good'
[1562954667] Return Code: 2, Output: CRITICAL - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' matches threshold 'Good'
[1562954667] Connection from 3.239.245.209 closed.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: passing strings to remote NRPE server not working using

Post by scottwilkerson »

Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked