Passage net-snmp 5.1

darcs-hash:20040523174803-41617-36a57ec6ab80a38fa4e5d9b5d486baf2281ce03f.gz
This commit is contained in:
pauget 2004-05-23 19:48:03 +02:00
parent 9a5f2f063e
commit 580fd56162

View file

@ -1,70 +1,70 @@
#!/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 #
# Le script gère le SNMP sur TCP, à la différence de mrtg #
# Nicolas Stransky, décembre 2001 #
# #
# Compatibilité net-snmp 5.1 23/05/2004 -- Fred #
############################################################################
. /root/snmp-community-names
HOSTNAME=komaz.crans.org
COMMUNITY=$KOMAZ_COMMUNITY
#OPTIONS=''
OPTIONS='-T TCP -r 2 -t 3'
OPTIONS='-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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.2 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.3 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.4 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.5 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.6 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.7 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.8 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.9 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.10 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.11 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.12 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.13 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.14 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.15 | awk '{print $4}'
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}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.16 | awk '{print $4}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.17 | awk '{print $4}'
echo ""
echo "komaz-connexions"
;;
will-pede)
snmpget $OPTIONS $HOSTNAME $COMMUNITY enterprises.ucdavis.extTable.extEntry.extOutput.24 | awk '{print $3}'
snmpget $OPTIONS $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.24 | awk '{print $4}'
echo 0
echo ""
echo "will"