Solved

Nagios - Trying to monitor bandwidth with check_snmp_int

Posted on 2010-08-12
9
6,169 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Problem Description:   Couple of months ago we upgraded the ADSL line at our branch office from Home to Business line. The purpose of transforming the service to have static public IP’s. We were in need for public IP’s to publish our web resour…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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.:
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now