Dplacements.
-- Fred darcs-hash:20031217213823-41617-2b1634b66f37440fd1d6fd256e803305ef12c89e.gz
This commit is contained in:
parent
235e4bc18c
commit
cc9905c099
1 changed files with 23 additions and 22 deletions
45
snmp/bat.sh
45
snmp/bat.sh
|
@ -9,29 +9,28 @@
|
||||||
|
|
||||||
. /root/snmp-community-names
|
. /root/snmp-community-names
|
||||||
|
|
||||||
HOSTNAME=microrep
|
#HOSTNAME=microrep
|
||||||
COMMUNITY=$OLD_BACKBONE_COMMUNITY
|
#COMMUNITY=$OLD_BACKBONE_COMMUNITY
|
||||||
USERNAME=$BACKBONE_USER
|
USERNAME=$BACKBONE_USER
|
||||||
MIBFILE=/usr/scripts/snmp/Des5200.mib
|
#MIBFILE=/usr/scripts/snmp/Des5200.mib
|
||||||
|
|
||||||
test -f $MIBFILE || exit 0
|
#test -f $MIBFILE || exit 0
|
||||||
|
|
||||||
GETVALUES() {
|
#GETVALUES() {
|
||||||
snmpget -m $MIBFILE $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifOutOctets.$2 | awk '{print $4}'
|
# 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}'
|
# snmpget -m $MIBFILE $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifInOctets.$2 | awk '{print $4}'
|
||||||
echo ""
|
# echo ""
|
||||||
echo "$1"
|
# echo "$1"
|
||||||
|
#}
|
||||||
|
|
||||||
|
GETOUTVALUE3() {
|
||||||
|
snmpget -v 3 $1 -u $USERNAME interfaces.ifTable.ifEntry.ifOutOctets.$2 | awk '{print $4}'
|
||||||
}
|
}
|
||||||
|
|
||||||
GETOUTVALUE() {
|
GETINVALUE3() {
|
||||||
snmpget -m $MIBFILE $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifOutOctets.$1 | awk '{print $4}'
|
snmpget -v 3 $1 -u $USERNAME interfaces.ifTable.ifEntry.ifInOctets.$2 | awk '{print $4}'
|
||||||
}
|
}
|
||||||
|
|
||||||
GETINVALUE() {
|
|
||||||
snmpget -m $MIBFILE $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifInOctets.$1 | awk '{print $4}'
|
|
||||||
}
|
|
||||||
|
|
||||||
# La même chose en snmpv3
|
|
||||||
GETVALUES3() {
|
GETVALUES3() {
|
||||||
snmpget -v 3 $2 -u $USERNAME interfaces.ifTable.ifEntry.ifOutOctets.$3 | awk '{print $4}'
|
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}'
|
snmpget -v 3 $2 -u $USERNAME interfaces.ifTable.ifEntry.ifInOctets.$3 | awk '{print $4}'
|
||||||
|
@ -48,25 +47,28 @@ case "$1" in
|
||||||
GETVALUES3 $1 backbone 80
|
GETVALUES3 $1 backbone 80
|
||||||
;;
|
;;
|
||||||
batc)
|
batc)
|
||||||
GETVALUES3 $1 backbone 81
|
echo " $(GETOUTVALUE3 backbone 81) + $(GETOUTVALUE3 backbone 82) " | bc
|
||||||
|
echo " $(GETINVALUE3 backbone 81) + $(GETINVALUE3 backbone 82) " | bc
|
||||||
|
echo ""
|
||||||
|
echo "$1"
|
||||||
;;
|
;;
|
||||||
batg)
|
batg)
|
||||||
GETVALUES3 $1 backbone 28
|
GETVALUES3 $1 backbone 28
|
||||||
;;
|
;;
|
||||||
batp)
|
batp)
|
||||||
GETVALUES $1 18
|
GETVALUES3 $1 multiprise 14
|
||||||
;;
|
;;
|
||||||
batm)
|
batm)
|
||||||
GETVALUES3 $1 backbone 27
|
GETVALUES3 $1 backbone 27
|
||||||
;;
|
;;
|
||||||
bath)
|
bath)
|
||||||
GETVALUES $1 17
|
GETVALUES3 $1 multiprise 11
|
||||||
;;
|
;;
|
||||||
bati)
|
bati)
|
||||||
GETVALUES3 $1 multiprise 14
|
GETVALUES3 $1 multiprise 12
|
||||||
;;
|
;;
|
||||||
batj)
|
batj)
|
||||||
GETVALUES $1 19
|
GETVALUES3 $1 multiprise 13
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
@ -78,4 +80,3 @@ case "$1" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue