check_iftraffic.pl plugin

Alex Dehaini alexdehaini at gmail.com
Thu Oct 11 19:35:17 CEST 2007


Frederik,

It works now but the values I am getting is different from what by my
MRTG/Cacti is giving me.

The check_iftraffic.pl plugin gives me

Total RX Bytes: 1434.86 MB, Total TX Bytes: 2213.91 MB
Average Traffic: 3.66 kB/s (0.0%) in, 3.77 kB/s (0.0%) out

My MTRG gives me

inbound = 50
outbound = 75

Why is the plugin giving me a different value? I know the MRTG value is
correct because when I work the eth0 interface with snmp, it gives me the
same value as the MRTG.

Thanks or your help so far.

Regards,
Alex


On 10/11/07, Vanhee Frederik <fvanhee at gmail.com> wrote:
>
> Alex Dehaini wrote:
> > Frederik,
> >
> > I run the plugin from the command line. How do I disable the embedded
> > perl intepreter. Can you furnish me with your syntax on how you used
> > this plugin.
> >
> > Thanks
> >
> > On 10/11/07, *Vanhee Frederik* <fvanhee at gmail.com
> > <mailto:fvanhee at gmail.com>> wrote:
> >
> >     Alex Dehaini wrote:
> >     > Thanks Marc,
> >     >
> >     > I got the plug in from www.nagiosexchange.org
> >     <http://www.nagiosexchange.org>
> >     > <http://www.nagiosexchange.org <http://www.nagiosexchange.org>>,
> >     sorry I didn't specify that earlier
> >     >
> >     > I gave the traffic files in /tmp nagios group and user ownership
> and
> >     > after that, I ran the following command as the nagios user and
> >     this is
> >     > the result I got
> >     >
> >     > nagios at snmp:/usr/local/nagios/libexec$ ./check_iftraffic.pl -H
> >     > 41.211.0.42 <http://41.211.0.42> <http://41.211.0.42> -C
> >     britania -i eth0 -b 100 -u m
> >     > Total RX Bytes: 1395.95 MB, Total TX Bytes: 2173.82 MB<br>Average
> >     > Traffic: 0.00 kB/s (0.0%) in, 0.00 kB/s (0.0%) out|
> >     inUsage=0.0,85,98
> >     > outUsage=0.0,85,98 inAbsolut=1429448 outAbsolut=2225990
> >     > nagios at snmp:/usr/local/nagios/libexec$ ./check_iftraffic.pl -H
> >     > 41.211.0.42 <http://41.211.0.42> <http://41.211.0.42> -C
> >     britania -i eth0 -b 100 -u m
> >     > Use of uninitialized value in scalar chomp at ./check_iftraffic.pl
> >     > line 185, <FILE> line 1.
> >     > Total RX Bytes: 1395.99 MB, Total TX Bytes: 2173.86 MB<br>Average
> >     > Traffic: 4.12 kB/s (0.0%) in, 4.12 kB/s (0.0%) out|
> >     inUsage=0.0,85,98
> >     > outUsage=0.0,85,98 inAbsolut=1429448 outAbsolut=2225990
> >     > nagios at snmp:/usr/local/nagios/libexec$ ./check_iftraffic.pl -H
> >     > 41.211.0.42 <http://41.211.0.42> <http://41.211.0.42> -C
> >     britania -i eth0 -b 100 -u m
> >     > Use of uninitialized value in scalar chomp at ./check_iftraffic.pl
> >     > line 185, <FILE> line 1.
> >     > Total RX Bytes: 1396.02 MB, Total TX Bytes: 2173.89 MB<br>Average
> >     > Traffic: 3.60 kB/s (0.0%) in, 3.64 kB/s (0.0%) out|
> >     inUsage=0.0,85,98
> >     > outUsage=0.0,85,98 inAbsolut=1429493 outAbsolut=2226035
> >     >
> >     > I reckon this means that the plug in is working when ran from the
> >     > nagios plugin directory via the command line. However, the UNKNOWN
> >     > error still remains as reported from the the web cgi.
> >     >
> >     > Am I missing something?
> >     >
> >     > Alex
> >     >
> >     >
> >     >
> >     >
> >     > On 10/11/07, *Marc Powell* <marc at ena.com <mailto:marc at ena.com>
> >     <mailto:marc at ena.com <mailto:marc at ena.com>>> wrote:
> >     >
> >     >
> >     >
> >     >     > -----Original Message-----
> >     >     > From: nagios-users-bounces at lists.sourceforge.net
> >     <mailto:nagios-users-bounces at lists.sourceforge.net>
> >     >     <mailto:nagios-users-bounces at lists.sourceforge.net
> >     <mailto:nagios-users-bounces at lists.sourceforge.net>>
> >     >     [mailto:nagios-users- <mailto:nagios-users-> <mailto:
> >     nagios-users- <mailto:nagios-users->>
> >     >     > bounces at lists.sourceforge.net
> >     <mailto:bounces at lists.sourceforge.net>
> >     >     <mailto:bounces at lists.sourceforge.net
> >     <mailto:bounces at lists.sourceforge.net> >] On Behalf Of Alex Dehaini
> >     >     > Sent: Thursday, October 11, 2007 10:17 AM
> >     >     > To: nagios-users at lists.sourceforge.net
> >     <mailto:nagios-users at lists.sourceforge.net>
> >     >     <mailto: nagios-users at lists.sourceforge.net
> >     <mailto:nagios-users at lists.sourceforge.net>>
> >     >     > Subject: [Nagios-users] check_iftraffic.pl plugin
> >     >     >
> >     >     > Hi Guys,
> >     >     >
> >     >     > I need some help on how to use the check_iftraffic.pl plug
> >     in. I
> >     >     want
> >     >     > nagios to notify me if any of my servers reach a
> >     150kbits/sec on
> >     >     their
> >     >     > NIC. This is what I have done so far.
> >     >     >
> >     >     > 1. I downloaded the plug in and gave it the appropriate
> >     >     ownership and
> >     >     > permissions.
> >     >
> >     >     When asking questions about a non-standard plugin, it's very
> >     >     helpful to
> >     >     provide specific details about where you got it from. How do
> we
> >     >     know the
> >     >     check_iftraffic.pl that google tells us about as the top hit
> is
> >     >     the same
> >     >     one you're using?
> >     >
> >     >
> >     >
> >     >     > UNKNOWN        10-11-2007 15:10:44     0d 0h 2m
> >     22s    3/6     (No
> >     >     output!)
> >     >
> >     >     "NO output!" typically means the plugin is reporting errors.
> >     >
> >     >     > Can anyone please assist me. When I run this from the plug
> in
> >     >     directory, I
> >     >     > get results, forexample
> >     >     >
> >     >     > snmp:/usr/local/nagios/libexec# ./check_iftraffic.pl -H
> >     >     41.211.0.42 <http://41.211.0.42> <http://41.211.0.42> -C
> >     >     > community -i eth0 -b 100 -u m
> >     >     > Total RX Bytes: 1381.80 MB, Total TX Bytes: 2155.67
> >     MB<br>Average
> >     >     Traffic:
> >     >     > 10.23 kB/s (0.1%) in, 12.45 kB/s ( 0.1%) out|
> >     inUsage=0.1,85,98
> >     >     > outUsage=0.1,85,98 inAbsolut=1410835 outAbsolut=2202385
> >     >
> >     >     This implies a permissions issue. Testing as root isn't
> >     useful since
> >     >     nagios isn't running the plugin as root. Do the same test
> again,
> >     >     except
> >     >     as the nagios user. I'll bet you get different and more
> >     informative
> >     >     results.
> >     >
> >     >
> >     >
> >     >     I'm going to take a very arbitrary guess and assume that I'm
> >     >     looking at
> >     >     the same plugin as you. It uses a temporary file, hard-coded
> as
> >     >     /tmp/traffic. Based on your test above, that file is almost
> >     certainly
> >     >     owned by root and probably isn't modifiable by the nagios
> >     user. Change
> >     >     ownership/permissions of the file or remove it entirely,
> >     then test
> >     >     again
> >     >     as the nagios user.
> >     >
> >     >     --
> >     >     Marc
> >     >
> >     >
> >     >
> >
> -------------------------------------------------------------------------
> >     >     This SF.net email is sponsored by: Splunk Inc.
> >     >     Still grepping through log files to find problems?  Stop.
> >     >     Now Search log events and configuration files using AJAX and a
> >     >     browser.
> >     >     Download your FREE copy of Splunk now >>
> http://get.splunk.com/
> >     >     < http://get.splunk.com/>
> >     >     _______________________________________________
> >     >     Nagios-users mailing list
> >     >     Nagios-users at lists.sourceforge.net
> >     <mailto:Nagios-users at lists.sourceforge.net>
> >     >     <mailto:Nagios-users at lists.sourceforge.net
> >     <mailto: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
> >     >
> >     >
> >     >
> >     >
> >     > --
> >     > Alex Dehaini
> >     > Developer
> >     > Site - www.alexdehaini.com <http://www.alexdehaini.com> <
> >     http://www.alexdehaini.com>
> >     > Email - alexdehaini at gmail.com <mailto:alexdehaini at gmail.com>
> >     <mailto:alexdehaini at gmail.com <mailto:alexdehaini at gmail.com>>
> >     >
> >
> ------------------------------------------------------------------------
> >
> >     >
> >     >
> >
> -------------------------------------------------------------------------
> >     > This SF.net email is sponsored by: Splunk Inc.
> >     > Still grepping through log files to find problems?  Stop.
> >     > Now Search log events and configuration files using AJAX and a
> >     browser.
> >     > Download your FREE copy of Splunk now >> http://get.splunk.com/
> >     >
> >
> ------------------------------------------------------------------------
> >     >
> >     > _______________________________________________
> >     > Nagios-users mailing list
> >     > Nagios-users at lists.sourceforge.net
> >     <mailto:Nagios-users at lists.sourceforge.net>
> >     > https://lists.sourceforge.net/lists/listinfo/nagios-users
> >     <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
> >     Hello Alex,
> >
> >     I think I know  what the problem is; your plugin is supposed to give
> >     only one line of output (unles you use Nagios 3).
> >     However, upon your execution, the first line of output is :
> >
> >     "Use of uninitialized value in scalar chomp at
> >     ./check_iftraffic.pl line
> >     185, <FILE> line 1."
> >
> >     So I think there is a problem with the plugin or the perl
> interpreter.
> >     Do you use the embedded perl interpreter ?
> >     I use the same plugin from NagiosExchange but don't experience any
> >     problems with it. I always disable the embedded perl interpreter
> >     in Nagios.
> >
> >     Good luck,
> >
> >     Frederik
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Alex Dehaini
> > Developer
> > Site - www.alexdehaini.com <http://www.alexdehaini.com>
> > Email - alexdehaini at gmail.com <mailto:alexdehaini at gmail.com>
> > ------------------------------------------------------------------------
> >
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems?  Stop.
> > Now Search log events and configuration files using AJAX and a browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
> Hello Alex,
>
> here are my checkcommand definition and my service check definition :
>
> define command{
>     command_name    check_switchport_traffic
>     command_line    $USER1$/check_iftraffic.pl -H $HOSTADDRESS$ -C
> community -i $ARG1$ -b 100000000 -u=k
>     }
>
> check_command            check_switchport_traffic!port1
>
>
> The only way to disable the embedded perl interpreter (Nagios 2) is to
> recompile Nagios with the option '--disable-embedded-perl' or something
> similar.
>
> Frederik
>
>
>


-- 
Alex Dehaini
Developer
Site - www.alexdehaini.com
Email - alexdehaini at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20071011/29102aa2/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
-------------- next part --------------
_______________________________________________
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