Solved

Nagios - Trying to monitor bandwidth with check_snmp_int

Posted on 2010-08-12
9
6,476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

734 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