centos7 cacti php7,Centos7 cacti 使用笔记

17270ce95af85a4a2d33846cd5831d99.png

1. 请参考如下网址进行基本安装与配置

http://tecadmin.net/install-cacti-on-centos-rhel-systems/

You can do yum install cacti –nogpgcheck to install the packages

Then yum install snmpd

2. Add a readonly community to snmpd.conf.

Then you can use snmpget/snmpwalk to get interface statistics

Add a line below com2sec line

rocommunity 123

3. Use snmpget/snmpwalk to try to get some info

snmpwalk -v2c -c123 localhost

4. visit http://YOURIP/cacti to see the result

If not accesable, please google the log error

The log is under /var/log/httpd/

5. After the configuration described on the website and you can visit cacti web console, you need to do several other things

1) set the timezone to Asia/Shanghai at several places. This is because cacti default use UTC which is not the same with your system’s timezone setting

2) Edit php’s timezone

/etc/php.ini:

timezone=Asia/Shanghai

3) set system’s timezone

systemctl list-timezones,

systemctl set-timezone Asia/Shanghai

4) set cacti’s timezone

In cmd.php, global.php, global_arrays.php etc, add following line

date_default_timezone_set('Asia/shanghai');

###############

6. Add a device and draw some statistics on “graph” tab

1) Management | devices | Add | fill it and save it | Add associated data query ->snmp iterface statitiscts | Ad

2) Create graph for this host | select the host, select which interface you want to draw | Create

3)management | data sources | select the data source you just created | Edit data template | Change the maximum value of traffic_in/traffic_out to 1000000000

4) management | graph tree | select default tree | Add | select host, select the newly created host | create

5) You should see the graph under graph tab now.

7. Debug cact web console

1) 查看rrd文件是否取到数据

rrdtool info /usr/share/cacti/rra/ --->查看这个rra文件的创建参数, rrdtool create的参数

rrdtool fetch /usr/share/cacti/rra/ AVERAGE/MAX --->这个命令就是查看是否能够画出图来的,如果能够读到数,就应该能画出图

rrdtool dump /usr/share/cacti/rra/ ---->这个命令可以查看RRA里面的原始值,但是画图并不用这个原始值,要用CF函数聚合一下再画

2) 在web页面设置cacti的loglevel, 使能data source debugging, graph debugging

loglevel在configuration | settings | general | Poller specific logging | Poller Logging Level

data source debuging在 management | data sources | 随便点击一个data source进入datasource页面 | Turn on data source debug mode

graph debugging 在management | graph management | 随便点击一个graph进入graph页面 | Turn on graph debug mode

3) 设置Poller的log

在centos 7上更改/etc/cron.d/cacti如下:

将>dev/null 改成 > your_log_file即可

然后service crond restart

4) 查看各种Log

/var/log/cacti/cacti.log

/var/log/httpd/*.log

your_log_file set in /etc/cron.d/cacti

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值