Solved

Nagios - Trying to monitor bandwidth with check_snmp_int

Posted on 2010-08-12
9
6,426 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
Independent Software Vendors: 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!

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Samba using Kerberos to Auth from Active Directory 9 88
Home internet speed 20 43
Configure BGP 22 33
SSSD - Automatic kerberos ticket initialization 1 9
Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
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…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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