cacti安裝記錄 第四階段cacti的基本使用(5)外掛程式模板的應用

來源:互聯網
上載者:User

標籤:

添加主機的時候可以看出,繪圖是要通過圖形模板和資料範本的。但是Cacti自身所帶的模板並不是很多,為了適應需求必然要添加自訂的模板。一般情況下,自訂模板由兩個檔案組成*.php和*.xml前者要放到cacti的scripts檔案夾下,後者要在cacti中匯入。

 

基本流程是先在被監控機上做授權,然後再在監控機上匯入模組進行監控。

 

監控Apache

先在被監控機上查看

[[email protected] ~]# /usr/local/apache/bin/httpd -M

 

status_module這個模組是必須的。

 

[[email protected] ~]# vim /usr/local/apache/conf/httpd.conf

<Location /server-status>

    SetHandler server-status

    Order deny,allow

    Deny from all

    Allow from  本機IP //這是本機IP用於查看web狀態

    Allow from 監控機IP //監控主機IP

</Location>

 

[[email protected] ~]# /usr/local/apache/bin/apachectl restart

 

 

 

從第三方查看到如此資料,就表示已經OK了。

 

**另,因為status這個模組有的是動態編譯有的是靜態,所以mod_status.so不一定要有,只要apache載入了就行了。

 

監控機

[email protected]:/Ddisk/tool/tar/cacti> unzip ApacheStats_0.8.2.zip

[email protected]:/Ddisk/tool/tar/cacti> cd ApacheStats_0.8.2

[email protected]:/Ddisk/tool/tar/cacti/ApacheStats_0.8.2> cp ss_apache_stats.php  

/Ddisk/program/apache/htdocs/cacti/scripts/

** php指令碼拷貝

xml檔案匯入

Console—>Import/Export—>Import Templates點擊右邊的“選擇檔案”

 

選擇檔案

 

點擊右下角“import”匯入

 

之後可以看到相關的資料資訊

 

Console—>Devices選擇主機

 

 在圖型模板裡面可以選擇與apache相關的模板。一共七個。

 

右上的“Create Craphs for this Host”建立圖表

 

全部勾選,單擊右下角的“Create”

 

在頂端graphs選項卡查看,圖如下:

 

**由於模組安裝不全,前四個圖片沒有資料。

 

監控Mysql

與之前的apache類似,先要在被監控機上做授權。

在被監控機上添加一個授權從監控機訪問被監控機mysql服務狀態的帳號。

[[email protected] ~]# mysql

mysql> grant process,super, REPLICATION CLIENT  on *.* to ‘cacti‘@‘監控機IP‘ identified by ‘123456‘;

 

監控機上

[email protected]:/Ddisk/tool/tar/cacti> tar zxvf better-cacti-templates-1.1.8.tar.gz

[email protected]:/Ddisk/tool/tar/cacti> cd better-cacti-templates-1.1.8

[email protected]:/Ddisk/tool/tar/cacti/better-cacti-templates-1.1.8> cp

scripts/ss_get_mysql_stats.php  /Ddisk/program/apache/htdocs/cacti/scripts/

[email protected]:/Ddisk/tool/tar/cacti/mysql-cacti-templates-1.1.2> vim

/Ddisk/program/apache/htdocs/cacti/scripts/ss_get_mysql_stats.php

這裡要修改的主要是被監控端的串連資訊。即剛剛在被監控端所加入的使用者名稱和密碼

**不過這樣一來所有的被監控端的使用者名稱和密碼都要一樣了。恩。

 

cache_dir是快取檔案夾,我把realtime的拿來用了

 

Console—>Import/Export—>Import Templates點擊右邊的“選擇檔案”

 

選擇xml模板

 

Import,匯入

 

OK.模板資訊

 

  

Console—>Devices選擇主機

 

在圖形模板裡面選擇添加mysql的模板。這裡比較多,隨便加了幾個

 

右上的“Create Craphs for this Host”建立圖表

 

全選上,右下角“Create”建立

 

 OK過段時間再到graphs選項卡查看,如


cacti安裝記錄 第四階段cacti的基本使用(5)外掛程式模板的應用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.