Gentoo 安裝cacti 錯誤小結

1.cacti 安裝時區出錯
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/localhost/htdocs/cacti/lib/functions.php on line 486
02/11/2014 06:25:10 AM - SYSTEM STATS: Time:0.1238 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:1 RRDsProcessed:1
OK u:0.00 s:0.00 r:0.02
解決如下
vim /etc/php/cli-php5.5/php.ini
date.timezone = Asia/Shanghai
vim /etc/php/apache2-php5.5/php.ini
date.timezone = Asia/Shanghai

2.安裝cacti-spine   emerge -avq cacti-spine

登陸cacti後設置

Poller Type
The poller type to use. This setting will take effect at next polling interval.       spine (默認是cmd.php)
3.收集的時候出現
POLLER: Poller[0] Maximum runtime of 300 seconds exceeded. Exiting
http://chinaapp.sinaapp.com/thread-tag/poller-poller0-maximum-runtime-of-298-seconds-exceeded-exiting
報錯的原因是因爲: cacti php
crontab裏面默認執行時間超過了300秒,而cacti默認是5分鐘就是300秒去獲取一次數據,所以導致有些服務器的數據沒有獲取。
所以想到了增大spine的進程和線程數。 cacti->Console->setting->Poller->:
修改cacti setting的poller設置. settting–>poller: Maximum Concurrent Poller
Processes 把1改成4 Maximum Threads per Process 把1改成2 Number of PHP Script
Servers 把1改成6 即可
4.crontab -l

*/1 * * * * /usr/bin/php /var/www/localhost/htdocs/cacti/poller.php --force &>/dev/null

5.Settings--poller

Poller Interval
The polling interval in use. This setting will effect how often rrd's are checked and updated. NOTE: If you change this value, you must re-populate the poller cache. Failure to do so, may result in lost data. every minute

Cron Interval
The cron interval in use. You need to set this setting to the interval that your cron or scheduled task is currently running.     every minute

6.monitor 中文亂碼

你需要一箇中文字體

將它放進 /usr/share/fonts目錄中

[root@localhost fonts]# ls

/usr/share/fonts # ls

dejavu  util

然後執行下面的命令刷新字體緩存

[root@localhost ~]# fc-cache -f -v

然後再cacti 中設置 默認字體的路徑爲你使用的中文字體的路徑

測試發現, 字體只能放到系統字體路徑當中, 並要刷新字體緩存

vim /var/www/localhost/htdocs/cacti/plugins/monitor/monitor.php

在monitor.php 文件中過濾 $name = $row['description'];這一行後邊添加如下一行

$name = iconv("UTF-8", "GB2312//IGNORE", $name);

7.圖形監控界面字符全部亂碼,如下圖

wKioL1NOEPXyRAPVAAEUnBqt804929.jpg

解決方法:從windows C:\Windows\Fonts,下面拷貝一個ttf(我拷貝的是simfang.ttf)文件到/usr/share/fonts下面,刷新頁面,字符就正常顯示了。

8.只出現8小時的圖   檢測 Console -> Round Robin Archives     Data Sources   --- RRAs  

Hourly  (1 Minute average)    我在監控的時候沒有用到,修改過後如果已經創建的還是沒有生效,刪除重建就行了

wKiom1NR3G6Dk6n0AAE5K6wXOes760.jpg

以下爲轉載  ;)

一、修改監控查詢區域的長度

1、中文版

配置 -> 設置 -> 外觀 ->數據查詢出將最大區域長度有15改爲30即可。

2、英文版

Console -> Settings -> Visual -> Maximum Field Length: 默認15,修改爲30。

二、修改流量監控的數據模板

我們打開流量監控使用的數據模板。發現流量的繪圖引用的是Interface – Traffic (bits/sec)這個模板。修改過程如下:1、中文版

模板 -> 數據模板 ->Interface – Traffic ->數據源-> 名字,將

  1. |host_description| - Traffic

修改爲

  1. |host_description| - Traffic– |query_ifName|。  

2、英文版

  1. console–Graph Templates–Interface – Traffic Graph Template -> Title (--title) 將|host_description| - Traffic

修改爲

  1. |host_description| - Traffic– |query_ifName|

在後面的框框裏面加上了 – |query_ifName| 這部分內容,以前這裏是沒有的!

三、設置成功

重新添加圖形,我們發現端口已經出來了!

不能正常出圖,注意查看日誌 Console -> Utilities -> View Cacti Log File

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章