Hi Guys,<br><br>I need some help on how to use the <span style="font-weight: bold;">check_iftraffic.pl</span> 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.
<br><br>1. I downloaded the plug in and gave it the appropriate ownership and permissions.<br>2. I added the plugin to the <span style="font-weight: bold;">command.cfg</span> file and this is what I added to the file<br><br>
# 'check_iftraffic' command definition<br><span style="font-weight: bold;">define command{</span><br style="font-weight: bold;"><span style="font-weight: bold;">        command_name    check_iftraffic</span><br style="font-weight: bold;">
<span style="font-weight: bold;">        command_line    $USER1$/check_iftraffic.pl -H $HOSTADDRESS$ -C $USER3$ -i $ARG1$ -b $ARG2$ -u m</span><br style="font-weight: bold;"><span style="font-weight: bold;">        }</span>
<br><br>3. I added the following service to one of my linux servers that has a NIC named eth0, this is what I added<br><br><span style="font-weight: bold;">define service{</span><br style="font-weight: bold;"><span style="font-weight: bold;">
        use                             dns1-service</span><br style="font-weight: bold;"><span style="font-weight: bold;">        host_name                       DNS2</span><br style="font-weight: bold;"><span style="font-weight: bold;">
        service_description             Traffic Load eth0</span><br style="font-weight: bold;"><span style="font-weight: bold;">        check_command                   check_iftraffic!community!eth0!100</span><br style="font-weight: bold;">
<span style="font-weight: bold;">        }</span><br><br>After these, nagios report an unknown error for this service on the web cgi interface, nagios says:<br><br><table class="status" border="0" width="100%"><tbody><tr>
<td class="statusEven"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="left"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="statusEven" align="left" valign="center">
<a href="http://nagios.teledataict.com/nagios/cgi-bin/extinfo.cgi?type=1&host=DNS1">DNS1</a></td>
</tr>
</tbody></table>
</td>
<td align="right" valign="center">
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td align="center" valign="center"><a href="http://nagios.teledataict.com/nagios/cgi-bin/extinfo.cgi?type=1&host=DNS1"><img src="http://nagios.teledataict.com/nagios/images/logos/redhat.png" alt="DNS Servers" title="DNS Servers" border="0" height="20" width="20">
</a></td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
<td class="statusBGUNKNOWN"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="left"><table border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td class="statusBGUNKNOWN" align="left" valign="center"><a href="http://nagios.teledataict.com/nagios/cgi-bin/extinfo.cgi?type=2&host=DNS1&service=Traffic+Load+eth0">Traffic Load eth0</a></td></tr>
</tbody></table>
</td>
<td class="statusBGUNKNOWN" align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td align="center" valign="center"><a href="http://nagios.teledataict.com/nagios/cgi-bin/extinfo.cgi?type=2&host=DNS1&service=Traffic+Load+eth0"><img src="http://nagios.teledataict.com/nagios/images/ndisabled.gif" alt="Notifications for this service have been disabled" title="Notifications for this service have been disabled" border="0" height="20" width="20">
</a></td></tr>
</tbody></table>
</td>
</tr></tbody></table></td>
<td class="statusUNKNOWN">UNKNOWN</td>
<td class="statusBGUNKNOWN" nowrap="nowrap">10-11-2007 15:10:44</td>
<td class="statusBGUNKNOWN" nowrap="nowrap"> 0d  0h  2m 22s</td>
<td class="statusBGUNKNOWN">3/6</td>
<td class="statusBGUNKNOWN">(No output!) </td></tr></tbody></table><br>Can anyone please assist me. When I run this from the plug in directory, I get results, forexample<br><br>snmp:/usr/local/nagios/libexec# <span style="font-weight: bold;">
./check_iftraffic.pl -H <a href="http://41.211.0.42">41.211.0.42</a> -C community -i eth0 -b 100 -u m</span><br>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<br><br><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>