scripts/snmp/komaz-mrtg
stransky e8a3d6939a Y'a des trucs zarb en ce moment avec le comptage des connexions et MRTG...
N.

darcs-hash:20031106112458-a279a-916aa5c741e11b5694b0feacd160b1af990139d4.gz
2003-11-06 12:24:58 +01:00

68 lines
2.7 KiB
Bash
Executable file

#!/bin/sh
############################################################################
# Script de requette snmp pour le monitoring de komaz par mrtg #
# Le script gère le SNMP v3, à la différence de mrtg, ce qui permet de se #
# connecter sur le port 161, en TCP #
# Nicolas Stransky, décembre 2001 #
############################################################################
. /root/snmp-community-names
HOSTNAME=komaz.crans.org
COMMUNITY=$KOMAZ_COMMUNITY
#OPTIONS=''
OPTIONS='-T TCP -r 2 -t 3'
case "$1" in
komaz-eth0)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.2 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.3 | awk '{print $3}'
echo ""
echo "komaz-eth0"
;;
komaz-eth1)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.4 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.5 | awk '{print $3}'
echo ""
echo "komaz-eth1"
;;
komaz-eth0C)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.6 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.7 | awk '{print $3}'
echo ""
echo "komaz-eth0C"
;;
komaz-eth1C)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.8 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.9 | awk '{print $3}'
echo ""
echo "komaz-eth0"
;;
komaz-eth0E)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.10 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.11 | awk '{print $3}'
echo ""
echo "komaz-eth0"
;;
komaz-eth1E)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.12 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.13 | awk '{print $3}'
echo ""
echo "komaz-eth0"
;;
komaz-load)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.14 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.15 | awk '{print $3}'
echo ""
echo "komaz-eth0"
;;
komaz-connexions)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.16 | awk '{print $3}'
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.17 | awk '{print $3}'
echo ""
echo "komaz-connexions"
;;
esac