Dear Expert
Previously via some efforts, me able to generate PnP graph with single value as below
#!/bin/sh
zusminute=`date +%M`
echo ""Minute $zusminute" | mIn=$zusminute"
exit 0
Now me trying to plot the graph with two values but no idea how to do this, appreciate your help.
#!/bin/sh
zusminute=`date +%M`
zushour=`date +%H`
echo ""Minute $zusminute" | MH=$zusminute | $zushour"
exit 0
Regards
PnP Graph with two values
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: PnP Graph with two values
https://nagios-plugins.org/doc/guidelines.html#AEN200
Have a look at this presentation I did at the Nagios World Conference about performance data:
https://www.youtube.com/watch?v=kqA2KcpUFg4
For Example:'label'=value[UOM];[warn];[crit];[min];[max]
space separated list of label/value pairs
Code: Select all
echo ""Minute $zusminute" | Minute=$zusminute Hour=$zushour"https://www.youtube.com/watch?v=kqA2KcpUFg4
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: PnP Graph with two values
Thanks Mr.Troy
Me trying to aggregate some STM16 links traffic into one PNP graph (I have asked this feature, hope NagiosXI will consider in future)
Just showing two links but there is around 10 links (I omitted script to make it short readable)
Me asking if there is any better way to do this as above not giving values very correctly? Any suggestion/hint....
Dear Mr.Troy, yes I have gone through your lecture and helped me to do this, really thanks (me novice in Linux). However my question still remain to plot two values in one PNP graph (same as Bandwidth graph), me want In & Out both values on one graph.
rrd files we know where stores /usr/local/nagios/share/perfdata/ && /var/lib/mrtg, however this above PNP graph, where values get stored?
Me appreciate your patience , expecting three answers.
Regards
Me trying to aggregate some STM16 links traffic into one PNP graph (I have asked this feature, hope NagiosXI will consider in future)
Just showing two links but there is around 10 links (I omitted script to make it short readable)
Code: Select all
oneIN1=`snmpwalk -v 2c -c public myzusrtr3 ifOutOctets.628`
oneIN2=`snmpwalk -v 2c -c public myzusrtr5 ifOutOctets.633`
let slptm=25
sleep $slptm
twoIN1=`snmpwalk -v 2c -c public myzusrtr3 ifOutOctets.628`
twoIN2=`snmpwalk -v 2c -c public myzusrtr5 ifOutOctets.633`
oneIN1=`echo $oneIN1| cut -d':' -f 4`
oneIN2=`echo $oneIN2| cut -d':' -f 4`
twoIN1=`echo $twoIN1| cut -d':' -f 4`
twoIN2=`echo $twoIN2| cut -d':' -f 4`
ZUS1=`echo $twoIN1-$oneIN1/$slptm*8 | bc`
ZUS2=`echo $twoIN2-$oneIN2/$slptm*8 | bc`
FINAL=`echo $ZUS1+$ZUS2 | bc`
FINAL=`echo $FINAL/1000000 | bc`
echo ""Total $FINAL" | InMbps=$FINAL"Dear Mr.Troy, yes I have gone through your lecture and helped me to do this, really thanks (me novice in Linux). However my question still remain to plot two values in one PNP graph (same as Bandwidth graph), me want In & Out both values on one graph.
rrd files we know where stores /usr/local/nagios/share/perfdata/ && /var/lib/mrtg, however this above PNP graph, where values get stored?
Me appreciate your patience , expecting three answers.
Regards
Zajil NMS
Re: PnP Graph with two values
Can you provide a screenshot of what graphs your current implementation is producing?zaji_nms wrote: Me asking if there is any better way to do this as above not giving values very correctly? Any suggestion/hint....
Former Nagios employee
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: PnP Graph with two values
If you currently have the data from separate service checks and you want to display this in one graph, then Graph Explorer is currently the easiest option.zaji_nms wrote:However my question still remain to plot two values in one PNP graph (same as Bandwidth graph), me want In & Out both values on one graph.
Home
Performance Graphs > Graph Explorer
Multistacked Performance Graph
Here you can select A Host
Then Select the service
Then select the actual Data Type (data source) and then click Add To Graph
You can keep repeating this until you have a graph full of sources then you can click the Dashify icon (top left of the graph) and add this to a dashboard.
Does this answer your question?
Personally I would really like a way to save these Multistack graphs so I don't have to rebuild them each time.
I also thing Highcharts should have a graph templating option like PNP does.
Thats really a difficult question. You are going to have to write a script from scratch (like you are doing) which would account for all scenarios. I think using the graph explorer method above is better, especially if the data already exists in other service checks.zaji_nms wrote:Me trying to aggregate some STM16 links traffic into one PNP graph (I have asked this feature, hope NagiosXI will consider in future)
Just showing two links but there is around 10 links (I omitted script to make it short readable)
Me asking if there is any better way to do this as above not giving values very correctly? Any suggestion/hint....Code: Select all
oneIN1=`snmpwalk -v 2c -c public myzusrtr3 ifOutOctets.628` oneIN2=`snmpwalk -v 2c -c public myzusrtr5 ifOutOctets.633` let slptm=25 sleep $slptm twoIN1=`snmpwalk -v 2c -c public myzusrtr3 ifOutOctets.628` twoIN2=`snmpwalk -v 2c -c public myzusrtr5 ifOutOctets.633` oneIN1=`echo $oneIN1| cut -d':' -f 4` oneIN2=`echo $oneIN2| cut -d':' -f 4` twoIN1=`echo $twoIN1| cut -d':' -f 4` twoIN2=`echo $twoIN2| cut -d':' -f 4` ZUS1=`echo $twoIN1-$oneIN1/$slptm*8 | bc` ZUS2=`echo $twoIN2-$oneIN2/$slptm*8 | bc` FINAL=`echo $ZUS1+$ZUS2 | bc` FINAL=`echo $FINAL/1000000 | bc` echo ""Total $FINAL" | InMbps=$FINAL"
Don't bother querying these files, you should be querying the final location of this data which is the relevant bandwidth check.zaji_nms wrote:/var/lib/mrtg
If you wrote your own service check, then the rrd file will end up in /usr/local/nagios/share/perfdata/HOST/SERVICE_NAME.rrdzaji_nms wrote:however this above PNP graph, where values get stored?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: PnP Graph with two values
Thanks Mr.Troy/tmcdonald
Per your advice, me gave up my way to for the consolidate graph, me achieved and nearly succeed taking help from check_rrdtraf, nothing very special but will share my script with different Topic may be will help other Nagios user and may trigger to Nagios developer to add the feature.
However our traffic ingress traffic (download) is very high compare to egress (out bond traffic), values showing correctly but graph not plotting at all, I don't know may be there is bug, as both graphs are independent, should plot. Can you check further what me thinking is correct? One value download is in 15000 and other egress upload traffic just 4000 Mbps (there is big gap in the values causing graph not to plot), due to this reason I have broke my one script in two.
Combined valued => Mbps:In/Out 19539 / 3622 (but no graph) , below the Data Source showing x (cross mark), even no plotting with nan.
echo ""Mbps:In/Out $TOTALIN / $TOTALOUT" | InMbps=$TOTALIN OutMbps=$TOTALOUT"
exit 0
Broke into two /usr/local/nagios/libexec/(all_stm16_only_in & all_stm16_only_out) , there is two graphs
echo ""InMbps $TOTALIN" | InMbps=$TOTALIN"
exit
echo ""OutMbps $TOTALOUT" | OutMbps=$TOTALOUT"
exit
Regards
Per your advice, me gave up my way to for the consolidate graph, me achieved and nearly succeed taking help from check_rrdtraf, nothing very special but will share my script with different Topic may be will help other Nagios user and may trigger to Nagios developer to add the feature.
However our traffic ingress traffic (download) is very high compare to egress (out bond traffic), values showing correctly but graph not plotting at all, I don't know may be there is bug, as both graphs are independent, should plot. Can you check further what me thinking is correct? One value download is in 15000 and other egress upload traffic just 4000 Mbps (there is big gap in the values causing graph not to plot), due to this reason I have broke my one script in two.
Combined valued => Mbps:In/Out 19539 / 3622 (but no graph) , below the Data Source showing x (cross mark), even no plotting with nan.
echo ""Mbps:In/Out $TOTALIN / $TOTALOUT" | InMbps=$TOTALIN OutMbps=$TOTALOUT"
exit 0
Broke into two /usr/local/nagios/libexec/(all_stm16_only_in & all_stm16_only_out) , there is two graphs
echo ""InMbps $TOTALIN" | InMbps=$TOTALIN"
exit
echo ""OutMbps $TOTALOUT" | OutMbps=$TOTALOUT"
exit
Regards
Zajil NMS
Re: PnP Graph with two values
I'm having a hard time visualizing the issue. Can you post screenshots of the broken graphs?
Former Nagios employee
Re: PnP Graph with two values
Dear tmcdonald
There is something wrong, me removed re-added same issue, however you close the case as me renamed the script, removed the slash (/) , longer name make shorter and somehow its working (graph coming), if bother to much, I will report you via this Forum.
Me opening another post/thread (so in future will help others to open correct post when anyone search) and will put my very basic script.
Regards
There is something wrong, me removed re-added same issue, however you close the case as me renamed the script, removed the slash (/) , longer name make shorter and somehow its working (graph coming), if bother to much, I will report you via this Forum.
Me opening another post/thread (so in future will help others to open correct post when anyone search) and will put my very basic script.
Regards
Zajil NMS
Re: PnP Graph with two values
Fair enough.zaji_nms wrote:however you close the case as me renamed the script
EDIT: Just to add the link to the new thread:
http://support.nagios.com/forum/viewtop ... 16&t=31648
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.