Linux/net-snmp+PHP の変更点
*net-snmpとPHP [#r8607717]
**バージョン [#od38ebdd]
-PHP 5.2.6
-net-snmp 5.1.4
net-snmpのバージョンを最新の5.4.2.1をインストールすると、
下記のエラーでPHPのコンフィグが通らない
configure: error: SNMP sanity check failed. Please check config.log for more information.
**net-snmp [#u71388d3]
http://www.net-snmp.org/
ここからソースをダウンロード
# tar zxvf net-snmp-5.1.4.2.tar.gz
# cd net-snmp-5.1.4.2
#./configure \
--with-mib-modules=ucd-"snmp/diskio ucd_snmp" \
--enable-shared --enable-ucd-snmp-compatibility \
--with-openssl=/usr/local/ssl --sysconfdir=/etc
# make
# make install
# mkdir /etc/snmp
# cp EXAMPLE.conf /etc/snmp/snmpd.conf
**snmpd起動スクリプト [#scd43f30]
# vi /etc/init.d/snmpd
#!/bin/bash
# ucd-snmp init file for snmpd
#
# chkconfig: 345 50 50
# description: Simple Network Management Protocol (SNMP) Daemon
#
# processname: /usr/local/sbin/snmpd
# config: /usr/local/share/snmp/snmpd.conf
# pidfile: /var/run/snmpd
# securlevel: 10
# source function library
. /etc/rc.d/init.d/functions
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd -a"
RETVAL=0
prog="snmpd"
start() {
echo -n $"Starting $prog: "
daemon /usr/local/sbin/snmpd $OPTIONS
RETVAL=$?
echo
touch /var/lock/subsys/snmpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc /usr/local/sbin/snmpd
RETVAL=$?
echo
rm -f /var/lock/subsys/snmpd
return $RETVAL
}
reload(){
stop
start
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/snmpd ] && restart
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
condrestart)
condrestart
;;
status)
status snmpd
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
**PHP [#t3ee6ac2]
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--enable-cli \
--enable-pear \
--with-tsrm-pth \
--with-gd --with-zlib \
--with-freetype-dir=/usr/local \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--enable-force-cgi-redirect \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-trans-sid \
--enable-versioning \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-sockets \
--with-snmp=/usr/local