1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
# Monitor snmp processes
#
# Arguments are:
#
# [options] --host hostname interface [interface ...]
#
# This script will exit with value 1 if the named interface ('Serial0'
# or 'Serial1.2' or whatever on a Cisco) on the specified host is down.
# The summary output line will be the host names that failed
# and the name of the port.
#
# Since interface names are looked up by their Cisco interface name,
# you don't need to worry about SNMP indices getting renumbered when
# interfaces are added or deleted. A local cache of the interface
# names is maintained in the mon state directory.
#
# Copyright (C) 1998, Brian Moore <bem@cmc.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# modified July 2000 by Ed Ravin <eravin@panix.com>
# * added cache for ifDescr names so we don't need to dump the router's
# table every time (very slow for routers with lots of interfaces)
# * switched to long-name options
# * added timeout option
# * created --host option for host so hostname can go at end
# sample entry in mon.cf:
#
# watch main-router.yourcompany.com
# service interfaces
# description SNMP status of router
# interval 5m
# monitor snmp_interface.mon Serial0/1 Serial0/3 --host
# bugs: unlike most mon scripts, this one only accepts one hostname,
# and there's no easy way for the script to detect that you're calling
# it improperly. Caveat emptor.
|