Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox

Snmpstatus command

From NetworkCommands



snmpstatus is a part of the net-snmp application suite. It is used to perform a fixed number of predefined SNMP GET requests, (which retrieve information from a device,) and report the information returned in a useful manner, providing the basic status of a device and it's interfaces. Those requests are;

  • The IP address of the entity.
  • sysDescr.0 - A textual description of the entity
  • sysUpTime.0 - The uptime of the entity's SNMP agent
  • ifInUCastPkts.* + ifInNUCastPkts.* - The sum of received packets on all interfaces
  • ifOutUCastPkts.* + ifOutNUCastPkts.* - The sum of transmitted packets on all interfaces
  • ipInReceives.0 - The number of IP input packets
  • ipOutRequests.0 - The number of IP output packets
  • ifOperStatus.* - The operational status of all interfaces - snmpstatus will only report on any interfaces that are down

Contents

Image:Vm-power-on-medium.png Usage Syntax

snmpstatus -v version -c community-string hostname-or-ip

The listed parameters are;

  • -v version - specify the SNMP version to be used; 1 or 2c
  • -c community-string - specify the clear text community string used by the device to authenticate requests
  • hostname-or-ip - specify the hostname or IP address of the device you wish to query

This command relies upon the SNMPv2-MIB, IF-MIB and IP-MIB

Image:Vm-power-on-medium.png Usage Examples

All examples shown use a read-only community string of public and query host 1.2.3.4.

snmpstatus -v 2c -c public 1.2.3.4

Image:utilities-terminal-medium.png Typical Output

Cisco 4000 series modular switch;

[UDP: [1.2.3.4]:161]=>[Cisco Internetwork Operating System Software
IOS (tm) Catalyst 4000 L3 Switch Software (cat4000-I5K91S-M), Version 12.2(18)EW, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1)
TAC Support: http://www.cisco.com/tac
Copyright (c) 1986-2004 by cisco Systems, Inc.] Up: 481 days, 11:35:47.69
Interfaces: 114, Recv/Trans packets: -1208052645/-1781532370 | IP: 1308205526/366344693
45 interfaces are down!

Cisco 7200 series router;

[UDP: [1.2.3.4]:161]=>[Cisco IOS Software, 7200 Software (C7200P-ADVENTERPRISEK9-M), Version 12.4(11)T3, RELEASE SOFTWARE (fc4)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Thu 12-Jul-07 00:44 by prod_rel_team] Up: 269 days, 7:09:25.37
Interfaces: 22, Recv/Trans packets: -263317688/322943667 | IP: 1970887137/66109011
9 interfaces are down!

Image:accessories-text-editor-v2-medium.png Usage Notes

In order to obtain the same information using individual SNMP GET requests, with the snmpget and snmpwalk command you would need to enter;

  • snmpget -v 2c -c tsysintg 10.220.0.253 sysDescr.0
  • snmpget -v 2c -c tsysintg 10.220.0.253 sysUpTime.0
  • snmpwalk -v 2c -c tsysintg 10.220.0.253 ifInUCastPkts
  • snmpwalk -v 2c -c tsysintg 10.220.0.253 ifInNUCastPkts
  • snmpwalk -v 2c -c tsysintg 10.220.0.253 ifOutUCastPkts
  • snmpwalk -v 2c -c tsysintg 10.220.0.253 ifOutNUCastPkts
  • snmpget -v 2c -c tsysintg 10.220.0.253 ipInReceives.0
  • snmpget -v 2c -c tsysintg 10.220.0.253 ipOutRequests.0
  • snmpwalk -v 2c -c tsysintg 10.220.0.253 ifOperStatus


In depth tutorials for the entire net-snmp suite can be found here: http://net-snmp.sourceforge.net/wiki/index.php/Tutorials

The snmpget tutorial can be found here: http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmpget

Image:icemon-medium.png Related Commands

Other commands in the net-snmp application suite;

Image:internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to steve#networkstuff.eu (replacing the # with an @)



Site Toolbox:

Personal tools
This page was last modified on 5 September 2008, at 13:28. - This page has been accessed 45 times. - Disclaimers - About NetworkCommands
Powered by MediaWiki