PNP4Nagios Template for Check_SNMP_int

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
NagiosN00b
Posts: 8
Joined: Wed Jan 31, 2018 7:24 am

PNP4Nagios Template for Check_SNMP_int

Post by NagiosN00b »

Hi all!!

Was looking for the experts to help here ...

I've installed PNP4Nagios and currently using the check_snmp_int plugin (http://nagios.manubulon.com/snmp_int.html) to monitor my network traffic. All is working well however, i would really like to use a cool template for it, other than the existing one and edit a few bits but i don't have any idea to script this. I know the doco is on the PNP4Nagios site but it's a bit intense to what level i'm at right now..

Here are my issues/questions:

1. Currently the graph is listing in bytes as opposed to kb which I'm looking for (as attached).
2. Is it possible to also add the 'Link Speed' as per the image attached? In fact, i'm pretty much looking for this exact tomeplate lol.

This is the existing template i want to change..

Code: Select all

<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_snmp_int.pl (COUNTER)
#
$opt[1] = " --vertical-label \"Bytes\" -b 1000 --title \"Interface Traffic for $hostname / $servicedesc\" ";
$def[1] = "DEF:var1=$RRDFILE[1]:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:var2=$RRDFILE[2]:$DS[2]:AVERAGE " ;
$def[1] .= "LINE1:var1#0000FF:\"in  \" " ;
$def[1] .= "GPRINT:var1:LAST:\"%7.2lf %SB/s last\" " ;
$def[1] .= "GPRINT:var1:AVERAGE:\"%7.2lf %SB/s avg\" " ;
$def[1] .= "GPRINT:var1:MAX:\"%7.2lf %SB/s max\\n\" " ;
$def[1] .= "LINE1:var2#00ff00:\"out \" " ;
$def[1] .= "GPRINT:var2:LAST:\"%7.2lf %SB/s last\" " ;
$def[1] .= "GPRINT:var2:AVERAGE:\"%7.2lf %SB/s avg\" " ;
$def[1] .= "GPRINT:var2:MAX:\"%7.2lf %SB/s max\\n\" ";
if($this->MACRO['TIMET'] != ""){
    $def[1] .= "VRULE:".$this->MACRO['TIMET']."#000000:\"Last Service Check \\n\" ";
}
?>
Any ideas or help would be much appreciated. I just thought templates would have a repo full somewhere to choose but could not find them at all!

Thanks for your time and happy holidays! :)
Attachments
check_snmp_interface_graph.png
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PNP4Nagios Template for Check_SNMP_int

Post by ssax »

Please send me the exact command with all the options you are specifying AND the full output when run from the command line.

check_snmp_int should support different output formats by specifying:

Code: Select all

-B, --kbits
   Make the warning and critical levels in K|M|G Bits/s instead of K|M|G Bytes/s
-G, --giga ; -M, --mega ; -u, --prct
   -G : Make the warning and critical levels in Gbps (with -B) or GBps
   -M : Make the warning and critical levels in Mbps (with -B) or MBps
   -u : Make the warning and critical levels in % of reported interface speed.
Once you send the command I can take a look at your PNP4Nagios template to make sure I get the right information.
NagiosN00b
Posts: 8
Joined: Wed Jan 31, 2018 7:24 am

Re: PNP4Nagios Template for Check_SNMP_int

Post by NagiosN00b »

Hi ssax! Thank you very much!

This is the command I'm running from the terminal

Code: Select all

./check_snmp_int.pl -H localhost -C public -B -M -k -f -Y -n wlan0 -w 200,400 -c 0,600
running from terminal runs as expected and displays in nagios fine. I actually had to include the -f flag to output the perf data for PNP4nagios and then added the -B and -M to have it calculate in MBps.

So, i think the PNP4nagios template is what needs tweaking.
NagiosN00b
Posts: 8
Joined: Wed Jan 31, 2018 7:24 am

Re: PNP4Nagios Template for Check_SNMP_int

Post by NagiosN00b »

This is what it currently looks like in my PNP4Nagios but i would like it tweaked to look like the image in my initial request with 'Link speed' and the 'Total in' and 'Total Out' details..
Attachments
check_snp_int.JPG
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PNP4Nagios Template for Check_SNMP_int

Post by ssax »

Looking at the template now, what version of the plugin are you running?

Code: Select all

/usr/local/nagios/libexec/check_snmp_int.pl -V
I'm not sure that it's going to work, you would need to output the data for link speed and the totals.

Where did you get that image of the way you want it from so that I can try to find the template?
NagiosN00b
Posts: 8
Joined: Wed Jan 31, 2018 7:24 am

Re: PNP4Nagios Template for Check_SNMP_int

Post by NagiosN00b »

Code: Select all

check_snmp_int version : 1.24
That's the one i'm using currently.

I found the image on google. Saying that, i actually found this template. It's different to the one above but similar to how i'd like it..

https://github.com/Tontonitch/pnp_templ ... er/Network

check_snmp_netint.php file

I haven't tried it yet but working on it..
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PNP4Nagios Template for Check_SNMP_int

Post by ssax »

Thank you, I'm still working on this, I should have something for you to test tomorrow. If you don't hear from me by the end of day, please post to the thread so that it pops up on our dashboard.

Thank you
Locked