Masato Taruishi
taru****@sourc*****
2004年 6月 25日 (金) 03:18:05 JST
=================================================================== RCS file: plugin/snmp/snmppass.d/operations,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- plugin/snmp/snmppass.d/operations 2004/06/24 17:13:03 1.2 +++ plugin/snmp/snmppass.d/operations 2004/06/24 18:18:05 1.3 @@ -6,6 +6,10 @@ oid=$1 if test "x$oid" = "xoid"; then + for i in 4 5 6 7 + do + echo "$SNMP_MIB.1.$i.0" + done for i in 1 2 3 4 5 6 7 8 9 10 do echo "$SNMP_MIB.2.$i.0" @@ -13,44 +17,62 @@ exit 0 fi -# ldap <operation> -ldap() +# statistics <statictics> +statistics() +{ + ldapsearch -x -p $LDAPLISTENPORT -h $HOST -b "cn=Statistics,cn=Monitor" -LLL cn=$1 monitorCounter | grep monitor | cut -d' ' -f2 +} + +# operation <operation> +operation() { - ldapsearch -x -b "cn=Monitor" -LLL cn=$1 monitorOpCompleted | grep monitor | cut -d' ' -f2 + ldapsearch -x -p $LDAPLISTENPORT -h $HOST -b "cn=Operations,cn=Monitor" -LLL cn=$1 monitorOpCompleted | grep monitor | cut -d' ' -f2 } echo "$oid" echo "integer" case "$oid" in + $SNMP_MIB.1.4.0) + statistics "Bytes" + ;; + $SNMP_MIB.1.5.0) + statistics "PDU" + ;; + $SNMP_MIB.1.6.0) + statistics "Referrals" + ;; + $SNMP_MIB.1.7.0) + statistics "Entries" + ;; $SNMP_MIB.2.1.0) - ldap "Bind" + operation "Bind" ;; $SNMP_MIB.2.2.0) - ldap "Unbind" + operation "Unbind" ;; $SNMP_MIB.2.3.0) - ldap "Add" + operation "Add" ;; $SNMP_MIB.2.4.0) - ldap "Delete" + operation "Delete" ;; $SNMP_MIB.2.5.0) - ldap "Modrdn" + operation "Modrdn" ;; $SNMP_MIB.2.6.0) - ldap "Modify" + operation "Modify" ;; $SNMP_MIB.2.7.0) - ldap "Compare" + operation "Compare" ;; $SNMP_MIB.2.8.0) - ldap "Search" + operation "Search" ;; $SNMP_MIB.2.9.0) - ldap "Abandon" + operation "Abandon" ;; $SNMP_MIB.2.10.0) - ldap "Extended" + operation "Extended" ;; *) exit 1