自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Cacti的安裝配置

運維 系統(tǒng)運維
Cacti的安裝配置:Cacti是一套基于PHP、MySQL、SNMP及RRDTool開發(fā)的網(wǎng)絡(luò)流量監(jiān)測圖形分析工具。Cacti提供了非常強大的數(shù)據(jù)和用戶管理功能,本文講述的是Cacti的安裝配置。

  Cacti的安裝配置

  1.使用如下命令來安裝cacti,這個會自動安裝需要的組件。

  1.   [root@tigertall php.d]# yum install cacti  
  2.  

  2.創(chuàng)建mysql數(shù)據(jù)庫

  1.   [root@tigertall php.d]# mysqladmin -uroot -phandomse create cacti  
  2.  

  3.導(dǎo)入默認的cacti數(shù)據(jù)庫

  如果使用yum默認安裝,創(chuàng)建數(shù)據(jù)庫的腳本

  默認在/usr/share/doc/cacti-0.8.7f/cacti.sql

  1.   [root@tigertall php.d]# cd /usr/share/doc/cacti-0.8.7f/  
  2.  

  執(zhí)行創(chuàng)建數(shù)據(jù)庫的命令

  1.   [root@tigertall 0.8.7.f]# mysql -uroot -phandomse cacti < cacti.sql 
  2.  

  4.創(chuàng)建cacti數(shù)據(jù)庫的用戶和密碼,

  登錄到數(shù)據(jù)庫

  1.   [root@tigertall 0.8.7.f]# mysql -u root -p 'pass'  
  2.  

  用戶授權(quán),請把用戶名,數(shù)據(jù)庫和密碼換成自己需要的設(shè)置。

  1.   mysql> GRANT ALL ON cacti.* TO cactiuser@localhost  
  2.  
  3.   --> IDENTIFIED BY 'password';  
  4.  

  刷新權(quán)限

  1.   mysql> flush privileges;  
  2.  

  5.編輯cacti配置,做數(shù)據(jù)連接設(shè)置

  1.   [root@tigertall include]# vi /usr/share/cacti/include/config.php  
  2.  

  這里有cacti連接使用的數(shù)據(jù)庫類型,用戶名,密碼信息

  1.   /* make sure these values refect \*/  
  2.  
  3.   /* your actual database/host/user/password */  
  4.  
  5.   $database_type = "mysql";  
  6.  
  7.   $database_default = "cacti";  
  8.  
  9.   $database_hostname = "localhost";  
  10.  
  11.   $database_username = "cactiuser";  
  12.  
  13.   $database_password = "cactiuser";  
  14.  
  15.   $database_port = "3306";  
  16.  
  17.   /* Default session name - Session name must */  
  18.  
  19.   /* contain alpha characters */  
  20.  
  21.   #$cacti_session_name = "Cacti";  
  22.  

  把上述配置按照自己的需要設(shè)置

  6.目錄權(quán)限設(shè)置

  1.   [root@tigertall include]# cd /usr/share/cacti/  
  2.  
  3.   [root@tigertall cacti]# ll rra  
  4.  
  5.   lrwxrwxrwx 1 root root 18 Jul 17 15:07 rra -> /var/lib/cacti/rra  
  6.  
  7.   [root@tigertall cacti]# ll log  
  8.  
  9.   lrwxrwxrwx 1 root root 15 Jul 17 15:07 log -> /var/log/cacti/  
  10.  

  從上述可以看到,rra實際上是var/lib/cacti/rra的一個軟鏈接,

  log則是/var/log/cacti的一個軟鏈接。

  更改上述目錄的權(quán)限,按需要更改屬主,下面生成數(shù)據(jù)會用到這個用戶。

  1.   [root@tigertall cacti]# chown -R gaohu rra/ log/  
  2.  

  7.配置自動作業(yè)時間

  編輯crontab。

 

  1.   [root@tigertall log]# crontab -e  
  2.  

  增加如下內(nèi)容,

  1.   */5 * * * * php /usr/share/cacti/poller.php > /dev/null 2>&1  
  2.  

  注意:

  這個地方不能按照官方文檔來,不能加上執(zhí)行的用戶名,

  crontab根本沒有執(zhí)行用戶這個參數(shù)的,官方文檔是這樣的:

  1.   */5 * * * * gaohu php /usr/share/cacti/poller.php > /dev/null 2>&1  
  2.  

  按照這個設(shè)置,會報錯的:

  1.   07/17/2010 10:59:57 PM - POLLER: Poller[0] WARNING:  
  2.  
  3.   Cron is out of sync with the Poller Interval!  
  4.  
  5.   The Poller Interval is '300' seconds,  
  6.  
  7.   with a maximum of a '300' second Cron,  
  8.  
  9.   but 419 seconds have  
  10.  
  11.   passed since the last poll!  
  12.  

  會告警說設(shè)置的是300秒,結(jié)果400多秒了還沒有執(zhí)行過。Cacti下如果磁盤監(jiān)控不到、如果圖出不來、網(wǎng)卡流量達到100M以上圖像有問題如果碰到這一系列的問題該怎么辦?本文講述的是Cacti下的問題的解決技巧。

  以上內(nèi)容意思是,每隔五分鐘,執(zhí)行下php腳本,統(tǒng)計下數(shù)據(jù)。

  一個由此引發(fā)的問題見***。

  8.登錄服務(wù)器

  初始登錄時,用戶名和密碼為admin,登錄后,會要求立即切換密碼。

【編輯推薦】

怎樣備份Cacti的數(shù)據(jù)

Cacti取不到遠程主機的數(shù)據(jù)

Cacti取不到CPU和內(nèi)存的數(shù)據(jù)

責(zé)任編輯:zhaolei 來源: php-oa
相關(guān)推薦

2011-04-02 15:26:51

Cacti安裝

2011-04-02 15:17:59

2011-04-02 15:26:58

Cacti安裝

2011-03-25 15:01:44

Cacti安裝

2011-04-02 15:17:48

Cacti安裝

2011-04-02 15:26:45

Cacti安裝

2010-01-13 11:17:50

2011-04-02 15:30:20

Cacti安裝

2011-03-31 15:51:51

cacti

2011-04-01 12:22:35

2011-04-02 15:30:41

Cacti安裝

2011-03-25 11:02:19

Cacti安裝

2014-01-16 14:20:38

CactiCacti監(jiān)控

2011-03-30 15:05:40

MRTG安裝

2011-11-08 21:55:58

MRTG 配置

2011-02-25 17:48:52

2010-06-07 11:22:28

2011-02-23 10:43:17

2011-03-02 10:41:41

Vsftpd安裝

2011-04-01 15:00:35

點贊
收藏

51CTO技術(shù)棧公眾號