Masato Taruishi
taru****@sourc*****
2004年 6月 24日 (木) 21:42:37 JST
=================================================================== RCS file: plugin/snmp/01snmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- plugin/snmp/01snmp 2004/06/19 04:25:08 1.1 +++ plugin/snmp/01snmp 2004/06/24 12:42:37 1.2 @@ -26,8 +26,9 @@ SNMP_MIB=$(ultrapossum_getconf SNMP_MIB ".1.3.6.1.4.12345") SNMPD_CONF_IN=$(ultrapossum_getconf SNMPD_CONF_IN "$TEMPLATEDIR/snmpd.conf.in") SNMPD_CONF=$(ultrapossum_getconf SNMPD_CONF "$sysconfdir/snmp/snmpd.conf") - SNMPGEN_IN=$(ultrapossum_getconf SNMPGEN_IN "$MODULEDIR/snmp/snmpgen.in") - SNMPGEN=$(ultrapossum_getconf SNMPGEN "$CONFDIR/snmpgen") + SNMPPASS=$(ultrapossum_getconf SNMPPASSDIR "$MODULEDIR/snmp/snmppass") + SNMPPASSDIR=$(ultrapossum_getconf SNMPPASSDIR "$MODULEDIR/snmp/snmppass.d/") + SNMPPASSSCRIPTSDIR=$(ultrapossum_getconf SNMPPASSSCRIPTSDIR "$CONFDIR/snmppass.d/") fi # Parsing configuration file =================================================================== RCS file: plugin/snmp/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- plugin/snmp/Makefile.am 2004/06/19 04:25:08 1.3 +++ plugin/snmp/Makefile.am 2004/06/24 12:42:37 1.4 @@ -10,11 +10,15 @@ templatedir = $(sysconfdir)/ultrapossum/in.d template_DATA = snmpd.conf.in -modulelocal_DATA = snmpgen.in +modulelocal_SCRIPTS = snmppass EXTRA_DIST = \ update-sasl \ 01snmp \ - snmpgen.in \ - snmp.cf + snmp.cf \ + snmppass.d + +install-data-local: + $(mkinstalldirs) $(DESTDIR)/$(modulelocaldir)/snmppass.d + $(INSTALL_SCRIPT) snmppass.d/snmpgen $(DESTDIR)/$(modulelocaldir)/snmppass.d =================================================================== RCS file: plugin/snmp/snmpd.conf.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- plugin/snmp/snmpd.conf.in 2004/06/19 04:25:08 1.3 +++ plugin/snmp/snmpd.conf.in 2004/06/24 12:42:37 1.4 @@ -3,8 +3,4 @@ group UltraPossum v1 ultrapossum view ultrapossum included #SNMP_MIB# access UltraPossum "" any noauth exact ultrapossum none none -exec #SNMP_MIB#.1 config #CONFDIR#/snmpgen config -exec #SNMP_MIB#.2 status #CONFDIR#/snmpgen status -exec #SNMP_MIB#.3 pid #CONFDIR#/snmpgen pid -exec #SNMP_MIB#.4 since #CONFDIR#/snmpgen since =================================================================== RCS file: plugin/snmp/update-snmp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- plugin/snmp/update-snmp 2004/06/19 04:25:08 1.4 +++ plugin/snmp/update-snmp 2004/06/24 12:42:37 1.5 @@ -31,25 +31,28 @@ sed -e "s/#SNMP_MIB#/$SNMP_MIB/" -e "s!#CONFDIR#!$CONFDIR!" \ -e "s!#SNMP_COMMUNITY#!$SNMP_COMMUNITY!" \ < $SNMPD_CONF_IN >> $tmp + + install -d $SNMPPASSSCRIPTSDIR + /bin/ls $SNMPPASSDIR | while read cmd + do + $SNMPPASSDIR/$cmd oid | while read oid + do + echo "pass_persist $oid $MODULEDIR/snmp/snmppass" >> $tmp + ln -sf $SNMPPASSDIR/$cmd $SNMPPASSSCRIPTSDIR/$oid + done + done + add_endmark "##" $id >> $tmp add_end_vaconf $SNMPD_CONF $tmp $id progress "Configuring SNMP... done" - sed -e "s!#MODULEDIR#!$MODULEDIR!" \ - -e "s/#TYPE#/$TYPE/" -e "s!#SLAPD_PIDFILE#!$SLAPD_PIDFILE!" \ - -e "s!#SLAPD_SLAVE_PIDFILE#!$SLAPD_SLAVE_PIDFILE!" \ - -e "s!#CHROOTDIRECTORY#!$CHROOTDIRECTORY!" < $SNMPGEN_IN > $SNMPGEN - chmod 755 $SNMPGEN - if test -f "/etc/init.d/snmpd"; then - /etc/init.d/snmpd restart 1>&2 - fi } remove() { progress "Removing SNMP... " if test -f $SNMPD_CONF; then strip_vaconf $SNMPD_CONF $id; fi - /bin/rm -f $SNMPGEN + /bin/rm -rf $SNMPPASSSCRIPTSDIR progress "Removing SNMP... done" if test -f "/etc/init.d/snmpd"; then /etc/init.d/snmpd restart 1>&2 @@ -65,6 +68,10 @@ configure ultrapossum-config set .status ULTRAPOSSUM_MODULE_SNMP=installed /bin/rm -f $CONFSTATUS + eval "`ultrapossum-config term`" + if test -f "/etc/init.d/snmpd"; then + /etc/init.d/snmpd restart 1>&2 + fi ;; xremove) remove