MRTG监控windows服务器流量
1.安装简单管理协议(snmp)
2.管理工具--服务--SNMP Service属性--安全,接受团体名称,添加一个团体名称(如public),指定其只能只读权限;
3.接受来自这些主机的SNMP数据包,添加,填入你要使用mrtg监测的服务器IP;
4.如果你有防火墙的话开通udp协议的161端口给你要使用mrtg监测的服务器;
5.重起snmp service即可;
snmpd: unrecognized service
#chkconfig --list | grep snmpd
#mount /dev/dvd /mnt/dvd
need packets:
net-snmp-libs-5.1.2-11.EL4.7
lm_sensors-2.8.7-2.40.3.i386.rpm
net-snmp-5.1.2-11.EL4.7
net-snmp-utils-5.1.2-11.EL4.7
#service snmpd start
(1)首选是定义一个共同体名(community),这里是public,及可以访问这个public的用户名(sec name),这里是notConfigUser。Public相当于用户notConfigUser的密码:)
# sec.name source community
com2sec notConfigUser default public
(2)定义一个组名(groupName)这里是notConfigGroup,及组的安全级别,把notCconfigUser这个用户加到这个组中。
groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
(3)定义一个可操作的范围(view)名, 这里是all,范围是 .1
# name incl/excl subtree mask(optional)
view all included .1 80
(4)定义notConfigGroup这个组在all这个view范围内可做的操作,这时定义了notConfigGroup组的成员可对.1这个范围做只读操作。
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact all none none
#iptables -A INPUT -i eth0 -p udp --dport 161 -s 192.168.1.10 -j ACCEPT
#service iptables save
(1)echo RunAsDaemon:yes>>mrtg.cfg
(2)echo Interval:5>>mrtg.cfg
//系统将会自动生成index.htm在我们指定的WEB目录里面
//系统将会自动生成index.htm在我们指定的WEB目录里面
wperl MRTG --logging=event.log mrtg.cfg
使用windows 2003 resource kit中的Instsrv.exe和srvany.exe。首先安装win2003 rerouse kit
将srvany.exe拷贝到d:MRTGbin 目录
1.添加srvany.exe为服务
instsrv MRTG "d:MRTGbinsrvany.exe"
2. 配置srvany:
在注册表HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMRTG中,添加一个parameters子键。在该子键中添加以下项目:
Application的字串值,内容为c:perlbinwperl.exe ---该值为wperl程序目录。
AppDirectory的字串值,内容为d:MRTGBIN ----该值为MRTG程序目录。
AppParameters的字串值,内容为MRTG --logging=event.log mrtg.cfg。