zhouerla 发表于 2015-9-8 07:28:42

cacti安装备忘

  
  这是基于LAMP架构基础上的,LAMP安装之前已经介绍,这里不再讨论
  net-snmp
# yum install net-snmp* -y
# vim /etc/snmp/snmpd.conf
# grep -Ev '^#|^$' /etc/snmp/snmpd.conf
com2sec notConfigUser192.168.0.0/255.255.255.0       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
accessnotConfigGroup ""      any       noauth    exactall none none
view all    included.1                               80
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
disk /
#
============================================================================
修改snmpd.conf
1.查找以下字段:
#    sec.name         source   community
com2sec notConfigUser default    public
将&quot;comunity&quot;字段改为你要设置的密码.比如&quot;bizcnpublic&quot;.
将“default”改为你想哪台机器可以看到你的snmp信息,如10.10.10.10。授权服务器IP
2.查找以下字段:
####
# Finally, grant the group read-only access to the systemview view.
#    group   context sec.model sec.level prefix readwrite notif
access notConfigGroup &quot;&quot;   any    noauthexact systemview none none
将&quot;read&quot;字段改为 all.
代码:
#access notConfigGroup &quot;&quot;   any    noauthexact all none none
3.查找以下字段:
##      incl/excl subtree             mask
#view allincluded .1                80
将该行前面的&quot;#&quot;去掉.

disk /
保存、关闭
============================================================================
# /etc/init.d/snmpd restart
停止 snmpd:                                             [确定]
正在启动 snmpd:                                           [确定]
#

cacti
rrdtool
# yum localinstall rrdtool-devel-1.3.8-6.el6.i686.rpm
# tar xf php_rrdtool.tar.gz
# cd rrdtool
# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
# ./configure --with-php-config=/usr/local/bin/php-config --with-rrdtool=/usr
# make && make install
# vim /usr/local/lib/php.ini
# grep rrdtool -B 1 /usr/local/lib/php.ini
extension_dir=&quot;/usr/local/lib/php/extensions/no-debug-non-zts-20090626/&quot;
extension=&quot;rrdtool.so&quot;
# /etc/init.d/apache restart

cacti
# tar xf cacti-0.8.8a.tar.gz -C /www/
# mv /www/cacti-0.8.8a /www/cacti
# mysql -u root -p
Enter password:
mysql> create database cacti;
mysql> use cacti;
mysql> source /www/cacti/cacti.sql;
mysql> grant all on cacti.* to 'cacti'@'localhost' identified by '123';
mysql> flush privileges;

# vim /www/cacti/include/config.php
$database_type = &quot;mysql&quot;;
$database_default = &quot;cacti&quot;;
$database_hostname = &quot;localhost&quot;;
$database_username = &quot;cacti&quot;;
$database_password = &quot;123&quot;;
$database_port = &quot;3306&quot;;

浏览器登录http://x.x.x.x/cacti/
默认用户名和密码如下(登录后提示修改)
user:admin
password:admin

# crontab -e
*/5 * * * */usr/local/bin/php /www/cacti/poller.php > /dev/null 2>&1
页: [1]
查看完整版本: cacti安装备忘