Tip

Discover the power of the snmpnetstat command

One very convenient and powerful tool for querying device interfaces and routers is the snmpnetstat command. When you run this command it will return information on any SNMP MIB-II compliant device that it can see, including, among others: workstations, servers, printers, routers, and other devices. It's a relatively simple command, and since the command is vendor neutral, it returns information from all of these systems in an identical form.

The snmpnetstat command has several options, including: -a, display socket connections, -i, display all interfaces; -I, display a particular network interface; -o, display summary of interfaces; -n display network address in numeric form; -p, display statistics sorted by networking protocols; -r, show routing tables; and –s, show the by protocol network statistics. Just which of these switches your version of Unix supports can be determined from the man pages with the command man snmpnetstat.

As an example, to obtain the network interfaces on a particular server, you would issue the command # snmpnetstat –i servername public. The returned output will give you: the protocol name, Mtu, network address (for 192.168.1.25 this would be simply 192.168.1), the server address (192.168.1.25), Ipkts, Ierrs, Opkts, Oerrs, and Queue – measures of input and output throughput and errors. This version of the command looks similar to the

Requires Free Membership to View

netstat command, but gives you the interface data you needed.

To get routing data from a Cisco router, you would use the command #snmpnetstat –r cisco-kai3 public. What comes back is a four column display of the routing table destinations, their gateways, flags, and their interface type.

As a final example, you might want to use # snmpnetstat –s servername public to see server statistics. You get back a listing of each protocol used, the input and output; and depending upon the specific protocol errors, discards, requests and deliveries, and so forth. This very useful form of the snmpnetstat command can be used to diagnose server network performance, and give you an idea of what traffic to monitor in order to correct the problems you see.


Barrie Sosinsky is president of consulting company Sosinsky and Associates (Medfield MA). He has written extensively on a variety of computer topics. His company specializes in custom software (database and Web related), training and technical documentation.


This was first published in January 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.