diff --git a/snmp/bat.sh b/snmp/bat.sh deleted file mode 100755 index 5e6e56c6..00000000 --- a/snmp/bat.sh +++ /dev/null @@ -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 diff --git a/snmp/komaz-mrtg b/snmp/komaz-mrtg deleted file mode 100755 index a485b5e0..00000000 --- a/snmp/komaz-mrtg +++ /dev/null @@ -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