as pnp4nagios do generate the graph of my script?
Posted: Sat Apr 18, 2015 9:23 am
I created a script shell script to get the information on my host mikrotik, and I wonder how do I generate the performace date for pnp4nagios generate the graph.
follows the code:
SSH output = $ ssh [email protected] "/ monitor-traffic interface interface = interfaceuniao once" | grep rx-bits-per-second | sed 's /% //'
# IFS = "";
#declare -a Array = ($ outputSSH)
#output = {$ array [1]}
if ["$ output" = "rx-bits-per-second: 10.0Mbps!"]; Then
echo "OK $ output"
exit 0;
elif ["$ output" == "rx-bits-per-second: 10.0Mbps"]; Then
echo "$ output Critical"
exit 2;
else
echo "Warning $ output"
exit 1;
fi
exit 3;
#exit $ STATE_OK
Return code of linux:
nagios:/usr/local/nagios/libexec# ./check_traffic_uniao_rx_centralfazendas
rx-bits-per-second: 174.0kbps
OK
follows the code:
SSH output = $ ssh [email protected] "/ monitor-traffic interface interface = interfaceuniao once" | grep rx-bits-per-second | sed 's /% //'
# IFS = "";
#declare -a Array = ($ outputSSH)
#output = {$ array [1]}
if ["$ output" = "rx-bits-per-second: 10.0Mbps!"]; Then
echo "OK $ output"
exit 0;
elif ["$ output" == "rx-bits-per-second: 10.0Mbps"]; Then
echo "$ output Critical"
exit 2;
else
echo "Warning $ output"
exit 1;
fi
exit 3;
#exit $ STATE_OK
Return code of linux:
nagios:/usr/local/nagios/libexec# ./check_traffic_uniao_rx_centralfazendas
rx-bits-per-second: 174.0kbps
OK