项目需要对版本进行比较,对比各种运行的性能,包括 CPU / MEM / IO / Network 等等。
开源的软件有:MRTG / Cacti / Nagios etc.
1. Redhat AS 5
# yum install mrtg net-snmp net-snmp-utils
snmpd configuration
com2sec notConfigUser localhost public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact all all none
view all included .1 80
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
snmpd service restart
# service snmpd restart
snmpd check
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.192.168.1.67 = INTEGER: 2
create mrtg configuration file
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@localhost
create mrtg index file
# indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Add mrtg into crontab
# crontab -l
*/5 * * * * LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg > /dev/null 2>&1
Refer to:
在Centos(RHEL)上安装和配置MRTG
2. LinuxDeepin – Ubuntu 9.12
$ sudo apt-get install snmpd mrtg
$ sudo vi /etc/snmp/snmpd.conf
# sec.name source community
#com2sec paranoid default public #注释掉这行
com2sec readonly default public #再把这行打开
#com2sec readwrite default private
$ sudo /etc/init.d/snmpd restart
生成配置文件:
$ cfgmaker --global "WorkDir: /home/mrtg" public@localhost | sudo tee /etc/mrtg.cfg
生成HTML文件,修改配置文件后需要重新生成一次:
$ sudo indexmaker /etc/mrtg.cfg | sudo tee /home/mrtg/index.html
注:需要通过HTTP服务器进行查看,可以安装使用LNMP。
Refer to:
ubuntu下,给现有网站加个简单的流量监控的方法
用MRTG監控服務器的CPU和Memory
CentOS5.4 安装mrtg
