Skip to Main Content
Essential SNMP, 2nd Edition
book

Essential SNMP, 2nd Edition

by Douglas Mauro, Kevin Schmidt
September 2005
Beginner content levelBeginner
462 pages
12h 56m
English
O'Reilly Media, Inc.
Content preview from Essential SNMP, 2nd Edition

Pinging with Cisco

Using ICMP messages (also know as "pinging") to determine if a host is up is a common and simple network monitoring technique. Pinging a small number of hosts is not that challenging. But if you have many hosts that are distributed all over the place, things could get ugly.

If the polling interval used is short enough, you could run into the problem where the nth poll hasn't finished before the nth+1 poll begins. Another problem could be that the machine you want to ping from doesn't have proper routing to the host or hosts you want to monitor.

Cisco routers and some switches support the Cisco ping MIB (download from ftp://ftp.cisco.com/pub/mibs/v2/CISCO-PING-MIB.my). Basically, this feature allows you to have routers perform ICMP operations on your behalf. In effect, you can have a distributed ping system.

In this script,[*] we'll use SNMP to configure a Cisco router to perform pings on our behalf:

 #!/usr/bin/perl use SNMP; # # This script was adapted from the one that comes with Net-SNMP # my %ipsToPing = ( "192.168.0.48" => 333, ); my $router = "192.168.0.130"; my $community = "public"; my $version = 1; my $sess = new SNMP::Session (DestHost => $router, Community => $community, Retries => 1, Version => $version); my $ciscoPingEntry = ".1.3.6.1.4.1.9.9.16.1.1.1"; my $ciscoPingEntryStatus = "$ciscoPingEntry.16"; my $ciscoPingEntryOwner = "$ciscoPingEntry.15"; my $ciscoPingProtocol = "$ciscoPingEntry.2"; my $ciscoPingPacketCount = "$ciscoPingEntry.4"; my $ciscoPingPacketSize ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Essential SNMP

Essential SNMP

Douglas Mauro, Kevin Schmidt
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 0596008406Supplemental ContentErrata Page