pnp4nagios generating graphs
Posted: Tue Nov 24, 2015 8:35 am
Hello, I would like to know how to pnp4nagios generate two graphs at the same time, one for type and another kbps to mbps.
My left in Nagios is so
# bash -x check_traffic_sentinela_rx_cidade
cd /home/nagios
rm -rf check_traffic_sentinela_rx_cidade.txt
outputSSH=$ ssh [email protected] "/interface monitor-traffic interface=interface-sentinela once"|grep rx-bits-per-second|sed 's/%//' > check_traffic_sentine$
livre=$(grep Mbps check_traffic_sentinela_rx_cidade.txt)
output=$(sed 's/rx-bits-per-second: //;s/Mbps//;s/kbps//;s/bps//g' check_traffic_sentinela_rx_cidade.txt)
output=$(echo $output | cut -d . -f 1 )
mostra=$(sed 's/rx-bits-per-second://g' check_traffic_sentinela_rx_cidade.txt)
if [ -z "$livre" ] ; then
livre2=$(grep k check_traffic_sentinela_rx_cidade.txt)
livre2=$(grep . check_traffic_sentinela_rx_cidade.txt)
if [ -n "livre2" ]; then
echo " $output"kbps" | rx=$output"kbps" "
exit 0;
elif [ -z "livre2" ] ; then
echo " 0kbps | rx=0kbps "
exit 0;
fi
elif [ -n "$livre" ]; then
if [ $output -ge 20 ]; then
echo " $output"Mbps" | rx=$output"Mbps" "
exit 2;
else
echo " $output"Mbps" | rx=$output"Mbps""
exit 0;
fi
else
echo " ERROR - SEM RETORNO NO ARQUIVO check_traffic_sentinela_rx_cidade.txt"
exit 1;
fi
exit 3;
I would like to generate a graph for kbps and another for mbps
My left in Nagios is so
# bash -x check_traffic_sentinela_rx_cidade
cd /home/nagios
rm -rf check_traffic_sentinela_rx_cidade.txt
outputSSH=$ ssh [email protected] "/interface monitor-traffic interface=interface-sentinela once"|grep rx-bits-per-second|sed 's/%//' > check_traffic_sentine$
livre=$(grep Mbps check_traffic_sentinela_rx_cidade.txt)
output=$(sed 's/rx-bits-per-second: //;s/Mbps//;s/kbps//;s/bps//g' check_traffic_sentinela_rx_cidade.txt)
output=$(echo $output | cut -d . -f 1 )
mostra=$(sed 's/rx-bits-per-second://g' check_traffic_sentinela_rx_cidade.txt)
if [ -z "$livre" ] ; then
livre2=$(grep k check_traffic_sentinela_rx_cidade.txt)
livre2=$(grep . check_traffic_sentinela_rx_cidade.txt)
if [ -n "livre2" ]; then
echo " $output"kbps" | rx=$output"kbps" "
exit 0;
elif [ -z "livre2" ] ; then
echo " 0kbps | rx=0kbps "
exit 0;
fi
elif [ -n "$livre" ]; then
if [ $output -ge 20 ]; then
echo " $output"Mbps" | rx=$output"Mbps" "
exit 2;
else
echo " $output"Mbps" | rx=$output"Mbps""
exit 0;
fi
else
echo " ERROR - SEM RETORNO NO ARQUIVO check_traffic_sentinela_rx_cidade.txt"
exit 1;
fi
exit 3;
I would like to generate a graph for kbps and another for mbps