Cacti使用npc整理nagios出图显示
Cacti使用npc整理nagios出图显示
NPC ----》 services----》 servicedetail

Datainput

数据输入方法----搜"npc" 找到该输入方法

测试:
服务端可以查看数据:
[root@cacti log]# php /var/www/html/plugins/npc/perfdata.php --type=service --id=130 2> /dev/null
CpuUser:0.35 CpuNice:0.00 CpuSystem:0.13 CpuIowait:0.03 CpuSteal:0.00 CpuIdle:99.49
特别注意:CpuUser字段

部分会出现空格等,导致后续数据输出无法生成rrd图形
新建数据模板,选择新生成的数据输入方法
步进:时间采集器的周期,周期是60s就填60s。默认是300s,5分钟

新建图形模板
选择图形,新建的图形值等,要注意选择正常的数据源,即数据模板

加入到对应的主机上

为主机添加图形


如果可以出图,基本上算完成!
整理:
查看数据源:


数据输入方法是否有数据输出:
[root@cacti log]# php /var/www/html/plugins/npc/perfdata.php --type=service --id=130 2> /dev/null
CpuUser:0.35 CpuNice:0.00 CpuSystem:0.13 CpuIowait:0.03 CpuSteal:0.00 CpuIdle:99.49
可以看出rrd图形的文件是:
/var/www/html/rra/57/632.rrd
查看是否有数据更新:
[root@cacti log]# rrdtool lastupdate /var/www/html/rra/57/632.rrd
311cpuuser
1452760381: 0.31
[root@cacti log]#
数据已经进来,0.31。 表明基本没有问题。
如
[root@cacti log]# rrdtool lastupdate /var/www/html/rra/57/632.rrd
311cpuuser
1452760381: u
[root@cacti log]#
U说明没数据进来,可以检查数据输入方法是否有问题。输出字段前面是不是有空格等。
posted on 2016-01-14 16:40 Michael_DD 阅读(498) 评论(0) 收藏 举报
浙公网安备 33010602011771号