measuring bandwidth?

Marc Powell marc at ena.com
Fri Jul 15 17:25:23 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Cam
> Sent: Friday, July 15, 2005 9:58 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] measuring bandwidth?
> 
> Hi,
> 
> I've got some more stuff i'm trying to work out.  We want to measure
> the bandwidth that the server is using and have nagios warn us if it
> get's too high or too low.  Right now i'm monitoring that over SNMP w/
> cacti and it's working good, but that just makes me pretty graphs, and
> i need warnings.  anyway, i'm trying to figure out the best way to do
> this and i wanted to get other people's input.  The problem that i'm
> having is that if i poll the data over SNMP that i just get a
> meaningless COUNTER value.  So i guess what i'm wondering is does
> nagios have anyway to keep track of these things themselves, or do i
> need to write a script sort of like this (psuedo-code):

No, it doesn't. Each plugin only looks at the current values of whatever
it's checking and has no idea of historical values.

> #this file has the SNMP data polled last time nagios ran my script
> OLD = read $foor
> NEW = snmpget localhost ifinOctets.bar #something like that
> echo $NEW > $foo | awk $4 -print
> 
> x = $(($NEW - $OLD))
> 
> if [ $x -lt $SOME_VALUE ]; then
>   print_warning_message
> elif [ $x -gt $OTHER_VALUE ]; then
>   print_another_warning_message
> else
>   print_ok_message
> fi
> 
> is there any problems w/ this approach?  is there a cleaner way to do

That's one way to do it. The other, probably better way would be to use
the check_mrtgtraf plugin or check_rrd_data.pl (in the contrib dir) to
read the rate data directly from the file depending on which format
Cacti uses. The thread below also seems to provide another mechanism --

http://64.233.187.104/search?q=cache:EB26O7k-Ok8J:forums.cacti.net/about
624.html%26highlight%3D+check_rrd_data.pl+rrd&hl=en


> it?  what exactly are the rules for plugin output (it seems like it's
> just 'FOO [OK|WARNING|FAIL]: comments'--is that right?

No, it's not sufficient. Check out the Developer Guidelines at
http://nagiosplug.sourceforge.net/. It's very simple.

--
Marc


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list