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