Confused about device response
Posted: Tue Sep 18, 2012 3:33 pm
Can someone tell me why I am not getting back anything else but: Unknown argument: 90,90%
Below are my configuration files and script.
switch.cfg
define service{
use generic-service
hostgroup_name Mikrotik_RG411
service_description tx-ccq
check_command mk_tx_ccq!90,90%!80,80%
}
command.cfg
define command{
command_name mk_tx_ccq
command_line $USER1$/mk_tx_ccq -H $HOSTADDRESS$ -U $ARG3$ -w $ARG1$ -c $ARG2$
}
Script:
###########################################
readccq=`cat /tmp/$host-ccq-status.txt|grep tx-ccq| grep -v overall-tx-ccq`
txccq=${readccq//[^0-9]/}
if [ $txccq -ge $warn ]
then
echo "tx-ccq OK = $txccq"
EXITCODE=0
elif [ $txccq -ge $critical ]
then
echo "tx-ccq WARNING less than 90% = $txccq"
EXITCODE=1
else
echo "tx-ccq CRITICAL less than 80% = $txccq"
EXITCODE=2
fi
exit ${EXITCODE}
Goal:
I would like to return the needed values to update nagiosgraph and nagios core.
Thank you,
Mike
Below are my configuration files and script.
switch.cfg
define service{
use generic-service
hostgroup_name Mikrotik_RG411
service_description tx-ccq
check_command mk_tx_ccq!90,90%!80,80%
}
command.cfg
define command{
command_name mk_tx_ccq
command_line $USER1$/mk_tx_ccq -H $HOSTADDRESS$ -U $ARG3$ -w $ARG1$ -c $ARG2$
}
Script:
###########################################
readccq=`cat /tmp/$host-ccq-status.txt|grep tx-ccq| grep -v overall-tx-ccq`
txccq=${readccq//[^0-9]/}
if [ $txccq -ge $warn ]
then
echo "tx-ccq OK = $txccq"
EXITCODE=0
elif [ $txccq -ge $critical ]
then
echo "tx-ccq WARNING less than 90% = $txccq"
EXITCODE=1
else
echo "tx-ccq CRITICAL less than 80% = $txccq"
EXITCODE=2
fi
exit ${EXITCODE}
Goal:
I would like to return the needed values to update nagiosgraph and nagios core.
Thank you,
Mike