Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Nagios - Trying to monitor bandwidth with check_snmp_int

Posted on 2010-08-12
9
Medium Priority
?
6,803 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
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!

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

926 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