Solved

Nagios - Trying to monitor bandwidth with check_snmp_int

Posted on 2010-08-12
9
6,379 Views
Last Modified: 2012-05-10
I am trying to use "check_snmp" command to monitor bandwidth on a Cisco Catalyst 3560G switch.  The command I am using is: check_snmp! -H 10.10.10.31 -C slpub -v 2c -n GigabitEthernet0/3 -d 5 -k -w 0,0 -c 0,0.  When running the verification command (nagios -v /etc/nagios/nagios.cfg) I don't receive any errors but on the Nagios web interface I am receiving the following message in the "status information" field:  Usage:check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range].

Does anyone have any clue as to what needs to be in the configuration file to be able to monitor switch interface traffic?
0
Comment
Question by:punjwani
  • 5
  • 4
9 Comments
 
LVL 23

Expert Comment

by:Maciej S
ID: 33422834
1. Try surrounding your parameter with "": check_snmp!"-H 10.10.10.31 -C slpub -v 2c -n GigabitEthernet0/3 -d 5 -k -w 0,0 -c 0,0"
2. As I can see, -o <OID> option is mandatory, but you don't have it defined in your check command
3. I'm not sure if -w and -c options can be set both to 0.
0
 
LVL 1

Author Comment

by:punjwani
ID: 33423776
@oklit - I will try the quotations.  I thought if you use the "-n" option it would look the the port name instead of the OID, but I could be wrong.
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 33424018
I don't have check_snmp plugin installed right now, so I can't check it, but you quoted your error message - there is -o <OID> mentioned (without [ ] - it means that it's mandatory).
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:punjwani
ID: 33424693
I used -o instead of -n and defined the OID (.10103).  This OID referrs to the Gbit0/3 port on the switch.  I am now getting this on the Nagios Web Interface:

 "External command error: snmp_build: unknown failuresnmpget: Error building ASN.1 representation (Can't build OID for variable)"
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 33425225
Did you use full OID in your command?

First, check if pure snmp (snmpget; not check_snmp nagios plugin) works as expected.
Then, try running check_snmp command manually, from command line.
If above works, put it in your nagios configuration file.
0
 
LVL 1

Author Comment

by:punjwani
ID: 33425514
I got the OID from running: snmpwalk -v2c -c slpub $DEVICE NAME$ .1.3.6.1.2.1.31.1.1.1.1

for Gigabit port three I received the following result:
IF-MIB::ifName.10103 = STRING: Gi0/3 (I assumed .10103 is the complete OID)

I will mention if I run a plugin command in the Manubulon folder from the terminal it does work.  However, it is a different plugin.

If I run from terminal:  ./check_snmp_int.pl -H 10.10.10.31 -C slpub GigabitEthernet0/3 -k -w 0,0 -c 0,0
I get results:  GigabitEthernet0/3:UP (67.1/23.6):1 UP: OK

However delta time is set at 5 seconds and there are no labeled units on the returned bandwidth.  I am not familiar with how the command would be entered into the Nagios configuration file either.  Would it be exactly what I have entered in the terminal?  It does not seem that Nagios is recongnizing this plugin even though it is in the /usr/lib/nagios/plugins/manubulon directory  Thus far this has not worked.  

Thank you for your time and help!
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 33427200
If it works from command line, it has to work from nagios :)

Show me your definition of check_snmp command (from nagios config file).
0
 
LVL 1

Author Comment

by:punjwani
ID: 33433572
It seems I may be doing something wrong.
I am using:    check_snmp_int! -H 10.10.10.31 -C slpub -n GigabitEthernet0/3 -d 5 -k -w 0,0 -c 0,0

http://nagios.manubulon.com/snmp_int.html gives information on this plugin.  This plugin resides in /usr/lib/nagios/plugins/manubulon in my current setup of CentOS.

 

0
 
LVL 1

Accepted Solution

by:
punjwani earned 0 total points
ID: 33434917
This is what I have in my test.cfg file so far.  Do you see anything wrong in the check_command for 'Bandwidth'.

Nagios is currently telling me: "No OIDs specified"

#  host definition for 3rd Floor

define host{
use                     generic-switch            ; Name of host template to use
host_name               Test Switch
alias                   3rd Floor
address                 10.10.10.31
check_command           check-host-alive
max_check_attempts      5

}      


# Service definition for 3rd Floor

define service{

      use                        generic-service                  ; Inherit values from a template
      host_name                  Test Switch                        ; The name of the host the service is associated with
      service_description            PING                              ; The service description
      check_command                  check_ping!200.0,20%!600.0,60%      ; The command used to monitor the service
      normal_check_interval      5                              ; Check the service every 5 minutes under normal conditions
      retry_check_interval            1                              ; Re-check the service every minute until its final/hard state is determined
      }

define service{
      use                        generic-service
      host_name                  Test Switch
      service_description            Bandwidth
      check_command                  check_local_mrtgtraf! /var/lib/mrtg/10.10.10.31_1.log! AVG!1000000,2000000 !5000000,5
      normal_check_interval      5
      retry_check_interval            1

}

define service{
      use                        generic-service
      host_name                  Test Switch
      service_description            Uptime
      check_command                  check_snmp! -C slpub -o sysUpTime.0
      normal_check_interval      5
      retry_check_interval            1
}

define service{
      use                  generic-service
      host_name                  Test Switch
      service_description            Bandwidth on Gbit Port 3
      check_command            check_snmp! 10.10.10.31! slpub! -o ifName.10103 -d 5 -k -w0,0 -c0,0
      normal_check_interval      5
      retry_check_interval            1
}
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question