博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Cacti数据采集周期修改为一分钟一次的方法
阅读量:4635 次
发布时间:2019-06-09

本文共 1306 字,大约阅读时间需要 4 分钟。

Cacti数据采集周期修改为一分钟一次的方法

Cacti 默认的数据采集周期是5分钟一次

首先,先登录 Cacti,进入 console > Settings > Poller 界面,将 Poller Interval  Cron Interval 均改为 "Every Minute" 选项,然后点击 Save 按钮保存。

然后,进入 Linux,修改 crontab 中的数据采集脚本运行周期为*/1 * * * *,例如:

*/1 * * * * /usr/local/php/bin/php /cacti/poller.php > /dev/null 2>&1

或者:

[root@cacti log]# cat /etc/crontab

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

# For details see man 4 crontabs

# Example of job definition:

# .---------------- minute (0 - 59)

# | .------------- hour (0 - 23)

# | | .---------- day of month (1 - 31)

# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...

# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# | | | | |

# * * * * * user-name command to be executed

*/1 * * * * root /usr/bin/php /var/www/html/poller.php

*/1 * * * * root /usr/sbin/ntpdate 172.26.1.15 && /sbin/hwclock -w

0 1 * * 1 root /var/www/backup.sh

You have mail in /var/spool/mail/root

[root@cacti log]#

 

最后,回到 Cacti,进入 console > Data Templates 界面,修改所用到的数据模板,将Step 设为60,这里的单位是秒。(比较重要,如果没有修改,可能无法出图)

 

完成上述三个步骤后,还需要我们手工清理历史数据后 Cacti 才能正常采集数据和显示图表。

进入 console > System Utilities 界面,点击 "Rebuild Poller Cache"

 

至此我们已经成功将 Cacti 的数据采集周期由5分钟一次修改为1分钟一次了。

如果不能正常显图表,可尝试手工清除 cacti/rra 目录下的 rrd 文件。

转载于:https://www.cnblogs.com/MichaelDD/p/5130563.html

你可能感兴趣的文章
centos7grub2 引导win10
查看>>
基于DCMTK的DICOM相关程序编写攻略
查看>>
win7下的IP-主机名映射
查看>>
Alpha版本项目展示
查看>>
朴素贝叶斯知识点概括
查看>>
CentOS7 通过代理上网
查看>>
Asp.net MVC中的ViewData与ViewBag
查看>>
HDU 1693 Eat the Trees
查看>>
Bootstrap 栅格系统 理解与总结
查看>>
oracle的for和i++
查看>>
YML(2)yml 语法
查看>>
线段树专辑——pku 2886 Who Gets the Most Candies?
查看>>
求一个字符串中连续出现的次数最多的子串
查看>>
寒假作业pta3
查看>>
ubuntu使用记录
查看>>
面试题:查询连续出现的数字
查看>>
JS简单实现自定义右键菜单
查看>>
一个妹子图应用客户端源码
查看>>
day22_面向对象
查看>>
win10+Linux双系统安装及一些配置问题
查看>>