having trouble using strings on return
Posted: Fri Jul 12, 2019 11:23 am
Is there anything special Nagios configuration needs to support the command returning and accepting Strings?
I'm new, trying something new, and of course, struggling....
on command line, I can do ..
OK - [org.apache.activemq:type=Broker,brokerName=amq,service=Health,CurrentStatus] : 'Good' as expected
for Nagios monitorng server
Command.cfg
Local Service def
** Handling check result for service 'Container Delta MRO Broker Health' on host 'localhost' from 'Core Worker 15854'...
[1562947372.677475] [016.1] [pid=15850] HOST: localhost, SERVICE: Container Delta MRO Broker Health, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 1, OUTPUT: (No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
However, nagios doesn't seem to understand or recognize Strings - I know it is either how I'm using it OR there is an option in need of enabling, if so, does this require recompiling ???
thank you again !!! I'm getting there
I'm new, trying something new, and of course, struggling....
on command line, I can do ..
Code: Select all
./check_jmx4perl --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'for Nagios monitorng server
Command.cfg
Code: Select all
define command{
command_name check_local_container_broker_health
command_line $USER1$/check_jmx4perl --user $ARG1$ --password $ARG2$ --url $ARG3$ --mbean $ARG4$ --attribute $ARG5$ $ARG6$
}
Code: Select all
define service{
use local-service
host_name localhost
service_description Container PassThru Broker Health
check_command check_local_container_broker_health!passthru!B@dC0mpany!http://localhost:9090/jolokia!org.apache.activemq:type=Broker,brokerName=amq,service=Health!CurrentStatus!--string --critical '!Good'
}
[1562947372.677475] [016.1] [pid=15850] HOST: localhost, SERVICE: Container Delta MRO Broker Health, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 1, OUTPUT: (No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
However, nagios doesn't seem to understand or recognize Strings - I know it is either how I'm using it OR there is an option in need of enabling, if so, does this require recompiling ???
thank you again !!! I'm getting there