pnp4nagios generating graphs

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
alexprinou
Posts: 23
Joined: Sat Apr 18, 2015 9:06 am

pnp4nagios generating graphs

Post 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 user@192.0.0.1 "/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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: pnp4nagios generating graphs

Post by rkennedy »

Can you provide clarification for what you're trying to do? What is the file that you have posted?
Former Nagios Employee
alexprinou
Posts: 23
Joined: Sat Apr 18, 2015 9:06 am

Re: pnp4nagios generating graphs

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: pnp4nagios generating graphs

Post by rkennedy »

Where did you find the above script that is posted? It doesn't look to be returning perfdata.
Former Nagios Employee
alexprinou
Posts: 23
Joined: Sat Apr 18, 2015 9:06 am

Re: pnp4nagios generating graphs

Post by alexprinou »

This script was that I developed .
Returns perfdata , see the attached image
Attachments
perfdata.png
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios generating graphs

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked