Cacti snmp找不到網卡的問題,請幫忙解決
net-snmp版本5.0.9
編譯配置:
./configure --with-default-snmp-version="3" --with-sys-contact="root@localhost" --with-sys-location="beijing" --with-logfile
="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" --with-libwrap
snmp安裝完成後,配置了一下snmpd.conf
內容為:
rocommunity abc_snmp
com2sec notConfigUser default abc_snmp
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.2
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.2
view systemview included .1.3.6.1.2.1.2.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1.3.6.1.4.1.2021.10.1.3.1
view systemview included .1.3.6.1.4.1.2021.10.1.3.2
view systemview included .1.3.6.1.4.1.2021.10.1.3.3
view systemview included .1.3.6.1.4.1.2021.4.3.0
view systemview included .1.3.6.1.4.1.2021.4.4.0
view systemview included .1.3.6.1.4.1.2021.4.5.0
view systemview included .1.3.6.1.4.1.2021.4.6.0
view systemview included .1.3.6.1.4.1.2021.4.11.0
view all included .1 80
access notConfigGroup "" any noauth exact all none none
syslocation abc
syscontact abc@abcd
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
然後把編譯目錄下/dist/snmpd-init.d cp到/etc/rc.d/init.d/snmpd
然後修改/etc/rc.d/init.d/snmpd
#!/bin/sh
#
# snmpd This shell script takes care of starting and stopping
# the net-snmp SNMP daemon
#
# chkconfig: - 26 74
# description: snmpd is net-snmp SNMP daemon.
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
name="snmpd"
prog="/usr/local/sbin/snmpd"
[ -x $prog -a -f /usr/local/share/snmp/snmpd.conf ] || exit 0
start() {
# Start daemons.
echo -n $"Starting $name: "
daemon $prog -Cc /etc/snmp/snmpd.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $name: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $name
RETVAL=$?
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/$name ]; then
stop
start
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
修改的內容主要是把啟動時的命令添加了參數 -Cc /etc/snmp/snmpd.conf 修改snmpd讀取的配置文件
在cacti添加了這個伺服器以後,取不到數據,不知道為什麼,請高人指導!
《解決方案》
Cacti版本是0.8.6h for linux,數據獲取方式是Cactid,Cactid默認編譯.
我覺得問題應該不是Cactid,因為我以前用cmd.php取數據也是沒有取到
《解決方案》
請看cacti下 的log/cacti.log查找問題
《解決方案》
你要抓的網卡是千M還是百M,是32位還是64位?
下一個新的net-snmp從新編譯安裝試試。
configure 時加個--enable-mfd-rewrites
《解決方案》
我現在嚴重懷疑是我的cacti端的net-snmp版本太低.正在重新編譯5.4版的.希望有些奇迹. 我的網卡32位1000M的