cacti批量添加

php -q rebuild_poller_cache.php -d
php -q poller_output_empty.php


18/2013 12:45:01 PM - POLLER: Poller[0] WARNING: Poller Output Table not Empty. Potential Data Source Issues for Data Sources: traffic_in(DS[9606]),

 

cacti使用spine代替cmd.php注意事项
http://www.huomo.cn/developer/article-12fb5.html


[cacti]日志报Poller[0] WARNING: Poller Output Table not Empty
http://www.cnblogs.com/nzperfect/archive/2009/08/14/1546117.html

==============================================================

 

php add_device.php --description="$host_ip" --ip="$host_ip" --template=3 --version=2 --community="public"


Cisco - CPU Usage

 


php add_device.php --description="$host_ip" --ip="$host_ip" --template=3 --version=2 --community="public" 
php add_graphs.php --host-id="$host_ids" --graph-type=cg --graph-template-id=4 
php add_tree.php --host-id="$host_ids" --type=node --node-type=host --tree-id=2

 

--snmp-query-id=1


--snmp-query-id=[ID] --snmp-query-type-id=[ID] --snmp-field=[SNMP Field] --snmp-value=[SNMP Value]

    

List Options:
--list-hosts
--list-graph-templates [--host-template-id=[ID]]
--list-input-fields --graph-template-id=[ID]
--list-snmp-queries
--list-query-types --snmp-query-id [ID]
--list-snmp-fields --host-id=[ID] [--snmp-query-id=[ID]]
--list-snmp-values --host-id=[ID] [--snmp-query-id=[ID]] --snmp-field=[Field]

 

[root@www sh]# php /data/www/cacti/cli/add_graphs.php --list-graph-templates
Known Graph Templates:(id, name)
2 Interface - Traffic (bits/sec)

 


[root@www sh]# php /data/www/cacti/cli/add_graphs.php --list-input-fields --graph-template-id=2
Known Input Fields:(name, default, description)
41:output_type Output Type ID
41:index_value Index Value
41:index_type Index Type


[root@www sh]# php /data/www/cacti/cli/add_graphs.php --list-snmp-queries
Known SNMP Queries:(id, name)
1 SNMP - Interface Statistics
2 ucd/net - Get Monitored Partitions
3 Karlnet - Wireless Bridge Statistics
4 Netware - Get Available Volumes
6 Unix - Get Mounted Partitions
7 Netware - Get Processor Information
8 SNMP - Get Mounted Partitions
9 SNMP - Get Processor Information

 

[root@www sh]# php /data/www/cacti/cli/add_graphs.php --list-query-types --snmp-query-id=1
Known SNMP Query Types: (id, name)
2 In/Out Errors/Discarded Packets
3 In/Out Non-Unicast Packets
4 In/Out Unicast Packets
9 In/Out Bytes (64-bit Counters)
13 In/Out Bits
14 In/Out Bits (64-bit Counters)
16 In/Out Bytes
20 In/Out Bits with 95th Percentile
21 In/Out Bits with Total Bandwidth
22 In/Out Bytes with Total Bandwidth

 

[root@www sh]# php /data/www/cacti/cli/add_graphs.php --list-snmp-fields --host-id=34 --snmp-query-id=1
Known SNMP Fields for host-id 34: (name)
ifAlias
ifDescr
ifHighSpeed
ifHwAddr
ifIndex
ifIP
ifName
ifOperStatus
ifSpeed
ifType

 

 

 

 

 

 


http://blogread.cn/it/article.php?id=3645


有时我们要加入大量的机器到 Cacti ,直接修改 Cacti 还是很复杂的。所以最好还是通过他本身提供的工具来实现。 Cacti 早就为我们想到过这个问题了。这些工具就在 cacti/cli 目录中。简单的记录一下使用的方法。

1. 增加主机配置

php add_device.php --description=cdn118 --ip=121.22.x.x --template=3 --version=2 --community=public
# description 是对主机的描述
例如:

php add_device.php --description=cdn118 --ip=121.22.x.x --template=3 --version=2 --community=public

2. 增加监控图模板和图的数据来源
对加入的主机加入图象的生成,这有二种数据需要添加,一种是监控图使用的模板,一种是这个图的数据从 snmp 之类那个信息取得。下面就分别来取操作这二步.
(1. 增加 cacti 的监控图使用的模板

php add_graphs.php --host-id=[] --graph-type=cg --graph-template-id=[]
php add_graphs.php --list-graph-templates # 查看存在的图象模板
php add_graphs.php --list-hosts # 查看存在的主机
例如:

php add_graphs.php --host-id=11 --graph-type=cg --graph-template-id=32

(2. 增加data query的信息
如果data query对应一个图有多个snmp字段要增加,执行多次

php add_graphs.php --host-id=[] --graph-type=ds --graph-template-id=[] --snmp-query-id=[] --snmp-query-type-id=[] --snmp-field=[s] --snmp-value=[s]
在这步很麻烦,需要使用下面这些东西来查 data query 的参数,需要执行下面一步一步查询要增加的data query需要哪些模版,字段和相关的信息

php add_graphs.php --list-snmp-queries
查询 snmp 的询问的类型,是指使用什么方法去查询远程的数据例如: 1 SNMP - 接口统计

php add_graphs.php --list-query-types --snmp-query-id=[]
询问的类型中对应的 type 是什么,简单来讲,就是根据协议(snmp-query-id),可以查到什么东西例如: 14 输入/输出 位(64位计数)

php add_graphs.php --list-snmp-fields --host-id=[] --snmp-query-id=[]
根据host-id和snmp-query-id 来查,这个是指,当使用这个 snmp 查这个信息是,有那些相关的信息,例如: ifName

php add_graphs.php --list-snmp-values --host-id=3 --snmp-query-id=1 --snmp-field=ifName
# 这个是指,查这个信息上的数据中还有那些指定的子字段的值。

例如:

php add_graphs.php --host-id=11 --graph-type=ds --graph-template-id=32 --snmp-query-id=1 --snmp-query-type-id=14 --snmp-field=ifName --snmp-value=eth0

3. 添加树状显示菜单
这个需要使用到 add_tree.php加到菜单中显示
注意这个地方可以添加二种类型,一种是树,一种是节点,如果给一台主机加进去,就是加入一节点

php add_tree.php --type=node --node-type=host --tree-id=[] --host-id=[]
上面的数据需要通过下面的信息来查询:

php add_graphs.php --list-hosts # 查看存在的主机
php -q add_tree.php --list-trees # 查看树的 ID
例如

php add_tree.php --type=node --node-type=host --tree-id=2 --host-id=5

 


php add_device.php –description=”BJZGC-RD-2960-8(192.168.13.8)” –ip=192.168.13.8 –template=12 –version=2 –community=net_@234A –ping_method=icmp
php add_graphs.php –host-id=92 –graph-type=ds –graph-template-id=2 –snmp-query-id=1 –snmp-query-type-id=14 –snmp-field=ifOperStatus –snmp-value=Down
php add_graphs.php –host-id=92 –graph-type=ds –graph-template-id=2 –snmp-query-id=1 –snmp-query-type-id=14 –snmp-field=ifOperStatus –snmp-value=Up

 

转载于:https://www.cnblogs.com/hicnblogs/archive/2013/03/25/2981590.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值