Here is my original service command definition:
check_tc_jmx!8088!"Administer PoolA manager :id=PoolA" "Number of Warm Servers" Warm_Servers 28 26!!!!!!
At 5 pm, I would like to change this to:
check_tc_jmx!8088!"Administer PoolA manager :id=PoolA" "Number of Warm Servers" Warm_Servers 3 1!!!!!!
At 6 am, I would like to return the command to the original definition.
I am running Nagios Core 5.6.5 and using external commands for the first time. I created the following shell script:
Code: Select all
#!/bin/sh
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
poolahost='plm-biz01-001'
poolaservice='Pool A - Warm Servers'
poolacommand='check_tc_jmx!8088!"Administer PoolA manager :id=PoolA" "Number of Warm Servers" Warm_Servers 3 1!!!!!!'
/bin/printf "[%lu] CHANGE_SVC_CHECK_COMMAND;$poolahost;$poolaservice;$poolacommand\n" $now > $commandfile
[1566353759] External command error: Command failed
[1566354055] Error: External command failed -> CHANGE_SVC_CHECK_COMMAND;plm-biz01-001;Pool A - Warm Servers;check_tc_jmx!8088!"Administer PoolA manager :id=PoolA" "Number of Warm Servers" Warm_Servers 3 1!!!!!!
[1566354055] External command error: Command failed
In /usr/local/nagios/etc/nagios.cfg I have check_external_commands=1 set. There is a newline character at the end of my shell script and the file has nagios:nagios permissions set.
Any ideas what could be causing this error?