由于cacti 1.1.x系列发布后,变化比较大,集成了很多插件,自带自动发现功能,所以记录下来,
1、安装mariadb 10.1
cacti 1.1.0 需要MysqL >= 5.6,所以这里选择mariadb 10.1
yuminstallcentos-release-openstack-ocata-y yuminstallmariadb-server-y systemctlenablemariadb systemctlstartmariadb
2、mariadb参数调整(最低要求)
max_heap_table_size=128M max_allowed_packet=32M tmp_table_size=64M join_buffer_size=64M innodb_buffer_pool_size=512M innodb_doublewrite=off innodb_flush_log_at_timeout=3
导入时区信息
MysqL_tzinfo_to_sql/usr/share/zoneinfo/|MysqL-uroot-pMysqL
3、安装lamp
yuminstallhttpdPHPPHP-MysqLndPHP-gdPHP-snmpPHP-pecl-zendopcachewget-y echo"ServerTokensProd">>/etc/httpd/conf/httpd.conf echo"ServerSignatureOff">>/etc/httpd/conf/httpd.conf systemctlenablehttpd systemctlstarthttpd
4、下载cacti
cd/var/wwww/html wgethttp://www.cacti.net/downloads/cacti-1.1.0.tar.gz tarzxvfcacti-1.1.0.tar.gz mvcacti-1.1.0cacti chown-Rapache:apache/var/www/html/cacti/resource/ chown-Rapache:apache/var/www/html/cacti/scripts chown-Rapache:apache/var/www/html/cacti/log chown-Rapache:apache/var/www/html/cacti/cache/boost chown-Rapache:apache/var/www/html/cacti/cache/mibcache chown-Rapache:apache/var/www/html/cacti/cache/realtime chown-Rapache:apache/var/www/html/cacti/cache/spikekill
5、给cacti建库
MysqL>createdatabasecactidefaultcharsetutf8mb4; MysqL>usecacti; MysqL>source/var/www/html/cacti/cacti.sql; MysqL>grantalloncacti.*to'cactiuser'@'localhost'identifiedby'cactiuser'; MysqL>grantselectonMysqL.time_zone_nametocactiuser@'localhost'; MysqL>flushprivileges;
6、访问http://ip/cacti 进入安装向导
7、默认用户密码admin/admin,首次登陆要求改密码,密码长度和复杂度都比较严格,点赞。
a、定义snmp选项,比如snmpv2,community为abc b、定义扫描网段,比如192.168.0.0/24,定时扫描,发现snmp端口存活的机器自动添加到cacti, c、定义规则,将扫描到的机器,按照操作系统分类,放入不同的tree,划不同的图
9、设置定时任务
*/5****apache/usr/bin/PHP-q/usr/share/cacti/poller.PHP>/dev/null
其他
cacti 1.1.x 支持中文,但是汉化不彻底,手痒的同学可以按照下面的办法汉化:
1、安装
yuminstallgettext-y
cd/var/www/html/cacti/locales/LC_MESSAGES /usr/bin/msgunfmtchinese_china_simplified.mo-ochinese_china_simplified.po
/usr/bin/msgfmtchinese_china_simplified.po-ochinese_china_simplified.mo