Inutiles, requtes snmp directement dans mrtg

darcs-hash:20040601232537-41617-9be20140439e456d5a6ee48a43c319de30b9c79b.gz
This commit is contained in:
pauget 2004-06-02 01:25:37 +02:00
parent ecb057783d
commit 349822508d
2 changed files with 0 additions and 109 deletions

View file

@ -1,82 +0,0 @@
#!/bin/sh
############################################################################
# Script de requette snmp pour le monitoring des ports des switchs #
# #
# Nicolas Stransky, juin 2k1 #
# Mise à jour pour switchs HP en snmpv3, Fred décembre 2003 #
############################################################################
. /root/snmp-community-names
#HOSTNAME=microrep
#COMMUNITY=$OLD_BACKBONE_COMMUNITY
USERNAME=$BACKBONE_USER
#MIBFILE=/usr/scripts/snmp/Des5200.mib
#test -f $MIBFILE || exit 0
#GETVALUES() {
# snmpget -m $MIBFILE $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifOutOctets.$2 | awk '{print $4}'
# snmpget -m $MIBFILE $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifInOctets.$2 | awk '{print $4}'
# echo ""
# echo "$1"
#}
GETOUTVALUE3() {
snmpget -v 3 $1 -u $USERNAME interfaces.ifTable.ifEntry.ifOutOctets.$2 | awk '{print $4}'
}
GETINVALUE3() {
snmpget -v 3 $1 -u $USERNAME interfaces.ifTable.ifEntry.ifInOctets.$2 | awk '{print $4}'
}
GETVALUES3() {
snmpget -v 3 $2 -u $USERNAME interfaces.ifTable.ifEntry.ifOutOctets.$3 | awk '{print $4}'
snmpget -v 3 $2 -u $USERNAME interfaces.ifTable.ifEntry.ifInOctets.$3 | awk '{print $4}'
echo ""
echo "$1"
}
case "$1" in
bata)
GETVALUES3 $1 backbone 79
;;
batb)
GETVALUES3 $1 backbone 80
;;
batc)
echo " $(GETOUTVALUE3 backbone 81) + $(GETOUTVALUE3 backbone 82) " | bc
echo " $(GETINVALUE3 backbone 81) + $(GETINVALUE3 backbone 82) " | bc
echo ""
echo "$1"
;;
batg)
GETVALUES3 $1 backbone 28
;;
batp)
GETVALUES3 $1 multiprise 14
;;
batm)
GETVALUES3 $1 backbone 27
;;
bath)
GETVALUES3 $1 backbone 30
;;
bati)
GETVALUES3 $1 backbone 29
;;
batj)
GETVALUES3 $1 multiprise 13
;;
*)
echo "Monitoring des switchs par snmp. Voir /etc/mrtg.cfg"
echo "Usage : /usr/scripts/snmp/bat.sh bata|batb|batc|batg|bath|bati|batj|batm|batp">&2
exit 1
;;
esac
exit 0

View file

@ -1,27 +0,0 @@
#!/bin/sh
############################################################################
# Script de requette snmp pour le monitoring de komaz par mrtg #
# 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
OPTIONS='-r 2 -t 3'
case "$1" in
komaz-connexions)
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 $SNMP_KOMAZ enterprises.ucdavis.extTable.extEntry.extOutput.24 | awk '{print $4}'
echo 0
echo ""
echo "will"
;;
esac