Masato Taruishi
taru****@sourc*****
2004年 6月 25日 (金) 02:53:39 JST
=================================================================== RCS file: plugin/snmp/snmppass,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- plugin/snmp/snmppass 2004/06/24 17:13:03 1.2 +++ plugin/snmp/snmppass 2004/06/24 17:53:38 1.3 @@ -5,17 +5,11 @@ eval `ultrapossum-config init` trap "eval `ultrapossum-config term`" 0 -oids() -{ - /bin/ls -1a $SNMPPASSSCRIPTSDIR | while read line; do echo -n $line | tr -d . ; echo " $line"; done | sort -n | cut -d' ' -f2 - -} - +oids=$SNMPPASSSCRIPTSDIR/oids STATE=NONE while read line do - logger $line case "$STATE" in NONE) if test "x$line" = "xPING"; then @@ -33,14 +27,13 @@ ;; getnext) read mib - logger "getnext: $mib" if test -e "$SNMPPASSSCRIPTSDIR/$mib"; then - nextmib=`oids | egrep -A1 $mib | head -2 | tail -1` + nextmib=`egrep -A1 $mib $oids | head -2 | tail -1` else - nextmib=`oids | egrep -A1 $mib | head -1` + nextmib=`egrep -A1 $mib $oids | head -1` fi if test "x$nextmib" = "x"; then - nextmib=`oids | head -3 | tail -1` + nextmib=`head -1 $oids` fi if test "$mib" = "$nextmib"; then echo "NONE" =================================================================== RCS file: plugin/snmp/update-snmp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- plugin/snmp/update-snmp 2004/06/24 17:13:03 1.8 +++ plugin/snmp/update-snmp 2004/06/24 17:53:38 1.9 @@ -45,6 +45,8 @@ add_endmark "##" $id >> $tmp add_end_vaconf $SNMPD_CONF $tmp $id + + /bin/ls -1a $SNMPPASSSCRIPTSDIR | egrep -v '^\.$' | egrep -v '^\.\.$' | while read line; do echo -n $line | tr -d . ; echo " $line"; done | sort -n | cut -d' ' -f2 > $SNMPPASSSCRIPTSDIR/oids progress "Configuring SNMP... done"