Page 1 of 1

pnp4nagios generating graphs

Posted: Tue Nov 24, 2015 8:35 am
by alexprinou
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

Re: pnp4nagios generating graphs

Posted: Tue Nov 24, 2015 3:11 pm
by rkennedy
Can you provide clarification for what you're trying to do? What is the file that you have posted?

Re: pnp4nagios generating graphs

Posted: Tue Nov 24, 2015 3:48 pm
by alexprinou
this file and to monitor network traffic mikrotik equipment, I want seprar the graphics in kbps and mbps mbps look like on a graph and in other kbps.

Re: pnp4nagios generating graphs

Posted: Tue Nov 24, 2015 4:46 pm
by rkennedy
Where did you find the above script that is posted? It doesn't look to be returning perfdata.

Re: pnp4nagios generating graphs

Posted: Thu Nov 26, 2015 5:55 am
by alexprinou
This script was that I developed .
Returns perfdata , see the attached image

Re: pnp4nagios generating graphs

Posted: Thu Nov 26, 2015 7:41 pm
by Box293
You'll need to create a pnp template that will calculate that the value is in mbps as your plugin is returning kbps.

I did a talk about this at the Nagios World Conference, you can watch it here:

https://www.youtube.com/watch?v=kqA2KcpUFg4
http://www.slideshare.net/nagiosinc/tro ... and-graphs

It might take a while to get your head around it all. I suggest watching the presentation without any distractions as it can get complicated.