1.出来monitor标签 然后点了 对应的服务器后 显示的图片都是红x解决方案:
出现上述情况 把日志调整为debug打开日志文件出现下面的错误:


ERROR: I don't understand ':58:00 To 2010/03/24 14:58:00\c' in command: 'COMMENT:From 2010/03/23 14:58:00 To 2010/03/24 14:58:00\c'.
ERROR: I don't understand ':58:00 To 2010/03/24 14:58:00\c' in command: 'COMMENT:From 2010/03/23 14:58:00 To 2010/03/24 14:58:00\c'.
ERROR: I don't understand ':58:00 To 2010/03/24 14:58:00\c' in command: 'COMMENT:From 2010/03/23 14:58:00 To 2010/03/24 14:58:00\c'.
ERROR: I don't understand ':58:00 To 2010/03/24 14:58:00\c' in command: 'COMMENT:From 2010/03/23 14:58:00 To 2010/03/24 14:58:00\c'.
ERROR: I don't understand ':58:00 To 2010/03/24 14:58:00\c' in command: 'COMMENT:From 2010/03/23 14:58:00 To 2010/03/24 14:58:00\c'.
solved this problem. In Settings -> RRDTool Utility Version the version the RRDTool is RRDTool 1.0.x and I change to 1.2.x or later and work.
当执行poller.php文件出现如下错误:
/usr/local/bin/php /usr/local/cacti/poller.php
PHP Warning: reset(): Passed variable is not an array or object in /usr/local/cacti/lib/functions.php on line 146

Warning: reset(): Passed variable is not an array or object in /usr/local/cacti/lib/functions.php on line 146
PHP Warning: Variable passed to each() is not an array or object in /usr/local/cacti/lib/functions.php on line 147

Warning: Variable passed to each() is not an array or object in /usr/local/cacti/lib/functions.php on line 147
PHP Warning: reset(): Passed variable is not an array or object in /usr/local/cacti/lib/functions.php on line 146

Warning: reset(): Passed variable is not an array or object in /usr/local/cacti/lib/functions.php on line 146
PHP Warning: Variable passed to each() is not an array or object in /usr/local/cacti/lib/functions.php on line 147

Warning: Variable passed to each() is not an array or object in /usr/local/cacti/lib/functions.php on line 147

编辑lib/functions.php修改function read_default_config_option($config_name)函数为下面
function read_default_config_option($config_name) {
global $config, $settings;
           if (is_array($settings)) {
reset($settings);
while (list($tab_name, $tab_array) = each($settings)) {
if ((isset($tab_array[$config_name])) && (isset($tab_array[$config_name]["default"]))) {
return $tab_array[$config_name]["default"];
}else{
while (list($field_name, $field_array) = each($tab_array)) {
if ((isset($field_array["items"])) && (isset($field_array["items"][$config_name])) && (isset($field_array["items"][$config_name]["default"]))) {
return $field_array["items"][$config_name]["default"];
}
}
}
}
}
}
2出现“auth xxxxxx none” 错误打.snmp_auth_none_notice.patch补丁
(转自定义)二、解决方案
关于如何自定义模板:
1.使用他人的模板:
下载好以后解压,然后把解压出来的东西
脚本放到:scripts文件夹下面
Xml文件:console-->

Import/Export
导入就可以了
参考方案:
snmp提供了发送自定义信息的功能。查看snmpd.conf会看到有一个小节是关于外部脚本的,Executables/scripts。这个小节里面也举了例子,告诉你怎么通过snmp发送信息。
在snmpd.conf任意位置添加一行:
exec .1.3.6.1.4.1.2021.18 tcpCurrEstab /etc/tcpconn.sh
其中tcpCurrEstab是命令的名称,后面是命令以及参数。命令的名称可以随便起。脚本执行的结果类似下面:
# /etc/tcpconn.sh
80
脚本内容如下:
$ cat tcpconn.sh
#!/bin/sh
conn=`netstat -s -t | grep connections\ established |awk '{print $1}'`
echo $conn
重启snmpd,然后远程通过snmpwalk接收一下数据看看:
# snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.2021.18
UCD-SNMP-MIB::ucdavis.18.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.18.2.1 = STRING: "tcpCurrEstab"
UCD-SNMP-MIB::ucdavis.18.3.1 = STRING: "/etc/tcpconn_total.sh"
UCD-SNMP-MIB::ucdavis.18.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.18.101.1 = STRING: "488"
UCD-SNMP-MIB::ucdavis.18.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.18.103.1 = ""
其中我们需要的是UCD-SNMP-MIB::ucdavis.18.101.1 = STRING: “488″这一行:
# snmpwalk -v 1 192.168.1.201 -c public .1.3.6.1.4.1.2021.18.101.1
UCD-SNMP-MIB::ucdavis.18.101.1 = STRING: "488"
能采集到数据之后,就可以配置cacti来接收了。在cacti界面中console->Templates->Data Templates,然后点击右上角的Add,Data Templates中的name是给这个数据模板的命名,Data Source中的name将来显示在Data Sources中,我这里添加“|host_description| - Tcp Conn. - ESTBLISHED”,选get snmp data,Internal Data Source Name也可以随便添,这个用来给rrd文件命名。设置完后就可以save了,save之后会发现下面多了一些选项,在最下面那个添上我们需要的数据的 OID“.1.3.6.1.4.1.2021.18.101.1”,可以保存了。
此后需要创建一个Graph Templates,好让cacti生成图片。在cacti界面中console->Templates->Graph Templates,然后点击右上角的Add,Templates中的name是给这个数据模板的命名,Graph Template中的name是将来显示在图片上面中间的内容,我这里添加“|host_description| - Tcp Conn. - ESTBLISHED”,其他保持默认,保存之后上面会出来一些选项。
在Graph Template Items中添加一个item,Data Source选之前添加的,color选择一个图片的颜色,Graph Item Type选AREA,也就是区域,也可以选其他的线条,Consolidation Function 选择average Text Format设置说明。 Insert Hard Return 是否要在显示图的时候加一个回车,要是图上要表示好几项,一项结束后可以加一个 说明见图2,然后再添加一个,Graph Item Type选GPRINT,Consolidation Function选LAST,也就是当前的值,Text Format输入current。你还可以添加一些Graph Item Type为COMMENT的注释说明等。
现在只要为host添加这个画图模板就可以看到画出来的图了。
图2
(zhuan)6、为什么我的流量达到100M以上图像就不准呢?
这与snmp的版本有关,snmp1的数据是32位而snmp2c以上是64位。
首先要确定你使用的是snmp2c或以上(现在的网络设备一般都支持)。
然后点击Cacti的页面:“Console ->; Create New Graphs ->;Data Query”。你在下面看到
“Select a graph type:”的下拉菜单(默认是“In/Out bits”),要取64bits的数据所以将其改为
“In/Out bits(64-bit Counters)”,然后选择你要监测的网卡即可。
另外,该监测点的“Maximum Value”必须设置为100M以上。
如果是Linux主机要监测100M以上的流量(一般不会发生),需要带“--enable-mfd-rewrites”参数重新编译最新的net-snmp。
机器能ping通 但是 web里面 device显示的都是down,(不能执行poller.php导致)解决问题:现在setting里面general把日志级别调为debug
执行/usr/share/cacti/site/poller.php 出现:

结果出现了下面的结果(原文:http://blog.chinaunix.net/u1/55815/showart_673354.html

05/05/2008 12:00:45 AM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '-31656556', Max Runtime '298', Poller Runs: '1'
05/05/2008 12:00:45 AM - POLLER: Poller[0] NOTE: Cron is configured to run too often! The Poller Interval is '300' seconds, with a minimum Cron period of '300' seconds, but only -31656556 seconds have passed since the poller last ran.
经过查看poller.php源文件,看到
foreach($parms as $parameter) {
@list($arg, $value) = @explode("=", $parameter);

switch ($arg) {
case "-d":
case "--debug":
$debug = TRUE;

break;
case "--force":
$force = TRUE;

break;
case "--version":
case "-V":
case "-H":
case "--help":
display_help();
exit(0);
default:
echo "ERROR: Invalid Argument: ($arg)\n\n";
display_help();
exit(1);
}
}
有--force参数可以使用,于是在我执行后面加入了这个参数
/usr/local/php/bin/php /usr/local/apache2/htdocs/cacti/poller.php --force