monicazhang 发表于 2015-12-20 10:00:05

教你如何在FreeBSD下安装Cacti教程(3)

来自:网络 五、编辑开机启动项             Cacti实施

vi /etc/rc.conf [*]
在内容尾添加以下几行

snmpd_flags="-a" snmpd_pidfile="/var/run/snmpd.pid" snmptrapd_enable="YES" snmptrapd_flags="-a -p /var/run/snmptrapd.pid" [*]
上面snmpd和snmptrapd两点好像一种是标准写法,一种是缩写方法的。         Cacti培训六、安装cacti

# cd /data/cacti.my    # fetch downloads/cacti-0.8.7c.tar.gz # tar -zxvf cacti-0.8.7c.tar.gz # cd cacti-0.8.7c [*]
配置cacti 

 vi ./include/config.php $database_hostname = "localhost"; $database_username = "cacti"; */mysql中cacti的用户名/* $database_password = "cacti"; */mysql中cacti用户的密码/* $database_port = "3389"; */mysql监控端口/* vi ./include/global.php $database_hostname = "localhost"; $database_username = "cacti"; */mysql中cacti的用户名/* $database_password = "cacti"; */mysql中cacti用户的密码/* $database_port = "3389"; [*]
在mysql中配置cacti数据库及cacti用户信息               Cacti配置

#mysql -u root -p mysql>create database cacti default character set utf8; mysql> use cacti; mysql> source /data/cacti.my /cacti-0.8.7c/cacti.sql; mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti'; [*]mysql> flush privileges
;现在我们在nginx里创建一个虚拟主机来访问cacti,我们在nginx.conf 配置文件里添加以下配置块:             监控软件

server { listen 80; server_name cacti.my ; root /data/cacti.my /cacti-0.8.7c; location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/local/www/nginx-dist; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass h ; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/cacti.my /cacti-0.8.7c$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } [*]
重启nginx             开源监控软件

#/usr/local/etc/rc.d/nginx reload [*]
现在cacti已经完成.在浏览器里输入cacti访问地址就可以看到cacti的安装界面了,这里我们用的域名为 []h .             Cacti安装 想做Nagios, Zabbix,Cacti,iTop各种交流的,可以进入开源监控工具Nagios交流QQ群号 :476809427
页: [1]
查看完整版本: 教你如何在FreeBSD下安装Cacti教程(3)