午夜无码人妻aⅴ大片色欲张津瑜,国产69久久久欧美黑人A片,色妺妺视频网,久久久久国产综合AV天堂

Cacti插件詳解之——Weathermap(2)

把上面的$ENABLED=false;改為$ENABLED=true;然后保存。之后我們刷新頁面就可以看到如下頁面
Cacti插件詳解之——Weathermap(2)
在這里我們可以創(chuàng)建配置文件,或者從一個配置文件創(chuàng)建一個新的配置文件,或者打開一個已有的配置文件進(jìn)行編輯,這里我們就點擊simple.conf文件做一個簡單的weathermap配置。點擊simple.conf可以看到下圖
Cacti插件詳解之——Weathermap(2)
這里就是weathermap的編輯頁面了,把上面那個幾次菜單翻譯下吧。
Change File可以會到前面的那個界面改變編輯的圖形配置文件。
Add Node就是添加一個節(jié)點,點擊之后鼠標(biāo)會變成變成一個十字,在你想要放Node的地方點一下就可以創(chuàng)建一個Node。
Add Link 就是添加添加一條鏈接,可以把二個Node連接起來,點擊Add Link后點擊Node,再點擊另外一個Node就可以把二個Node連接起來。
Position Legend是調(diào)整那個圖列的位置,點擊之后鼠標(biāo)會編成十字,點擊以下就可以移動到新的位置。
Postion Timestamp就是添加一個圖片創(chuàng)建的時間啊什么信息的。
Map Style 可以調(diào)整這個圖形的風(fēng)格。比如圖形名稱、.圖形大小、圖形背景圖片、輸出圖片目錄、位置等

基本使用的也就這幾個了。點擊一個Node
Cacti插件詳解之——Weathermap(2)
這里可以改Node的大小,Node的名稱和標(biāo)簽名稱,
Info URl是用戶把鼠標(biāo)放在這個Node后會出現(xiàn)一個流量圖片,這個圖片信息來自那里,
Hover Graph URL 這里是當(dāng)用戶點擊這個Node是會跳轉(zhuǎn)到那個圖,在這里可以選擇點擊Pick From Cacti,從cacti中選取,
Icon Filename是圖標(biāo)的圖像,這里可以有很多比如Router、Host、firewall。當(dāng)然也可以自己添加,在weathermap的images里,設(shè)置好有點擊Submit就可以提交更改了.

我們在設(shè)置以下Link,點擊Link的那條線
Cacti插件詳解之——Weathermap(2)
Maximum Bandwidth Into這里是設(shè)置這條Link的最大帶寬,這里根據(jù)你自己的具體配置設(shè)置了,這里端口是1G的端口,出口帶寬是300MB因此我設(shè)置為300MB,Maximum Bandwidth out 是出去的最大流量帶寬,可以根據(jù)自己的具體情況設(shè)置。Data source是流量從那里獲取,這里可以引用mrtg的流量也可以點擊Pick form Cacti從cacti里獲取,Info URl是用戶把鼠標(biāo)放在這個Node后會出現(xiàn)一個流量圖片,這個圖片信息來自那里,Hover Graph URL 這里是當(dāng)用戶點擊這個Node是會跳轉(zhuǎn)到那個圖,這個如果選擇從cacti獲取會自動取得。從mrtg要自己設(shè)置下。別的默認(rèn)就成。這樣我們就我完成了對一張拓?fù)鋱D的編輯。如下就是我設(shè)計的weathermap圖像
Cacti插件詳解之——Weathermap(2)
注意問題:
1,中文顯示,我們可以在配置文件里指定中中文字體的路徑
vi /var/www/html/plugins/weathermap/configs/simple.conf
FONTDEFINE 100 /var/www/html/plugins/weathermap/msyh.ttf 9
msyh.ttf是中文字體的名字./usr/share/fonts/下應(yīng)該會有,指定路徑,前面100是字體編號  后面9字體是大小
Cacti插件詳解之——Weathermap(2)
添加連接線的上行 下行字體
Cacti插件詳解之——Weathermap(2)


 2.每次對圖形進(jìn)行調(diào)整后,都是自動保存的,不用保存(也沒有那個選項!嘿嘿),要在weathermap里看到修改后的效果要等到下次cacti采集器采集后才會繪圖。
3.cacti的日志里可能會顯示
WEATHERMAP: Poller[0] [Map 1] simple.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
等信息,不過我修改php.ini里的設(shè)置也不起作用,不用管它!
4.可以在cacti的里進(jìn)行設(shè)置,如圖,一般默認(rèn)就成
Cacti插件詳解之——Weathermap(2)
二.weathermap獨立的使用。

通過在catci里的設(shè)置,大家會weathermap已經(jīng)有了一個認(rèn)識了,其實它就是用過一個配置文件,繪圖,引用cacti或者mrtg的流量和圖形就成了

1.安裝基本環(huán)境

代碼:
  yum install httpd php php-gd  php-pear rrdtool -y  (rrdtool要添加非官方源) servie http start chkconfig http on service crond start chkconfig crond on wget http://www.network-weathermap.com/fi...rmap-0.97a.zip unzip php-weathermap-0.97a.zip mv weathermap/ /var/www/html/  (瀏覽器訪問地址為:http://xxx.xxx.xxx.xxx/weathermap/ chown -R apache:apache /var/www/html/weathermap/configs/ 
2.配置weathermap

我們要配置我們的圖形配置文件

先編輯editor.php
代碼:
  vi /var/www/html/weathermap/editor.php 
把里面的$ENABLED=false;改為$ENABLED=true;$ignore_cacti=False;改為$ignore_cacti=True;然后保存。
之后我們打開http://xxx.xxx.xxx.xxx/weathermap/editor.php
就可以像在cacti里一樣設(shè)計自己的weathermap圖形了,

特別注意:
1.在這里ICO的路徑要選擇絕對路徑,不讓路徑會有錯誤,導(dǎo)致不能出圖。
2.eidtor.php里可以設(shè)置拓?fù)鋱D輸出的路徑Image的路徑直接寫名稱,不用寫路徑,Html的路徑路徑要寫絕對路徑。
3.在weathermap目錄里有個weathermap文件要設(shè)置rrdtools的路徑。$rrdtool="/usr/bin/rrdtool";
關(guān)于配置文件的我們可以weathermap官網(wǎng)找到
weathermap官網(wǎng)的設(shè)置:http://www.network-weathermap.com/ma...reference.html 具體的參數(shù)這里都有
這里還有一個配置文件的范本http://www.network-weathermap.com/ma...n.html#example
這個是做好的圖形;http://www.network-weathermap.com/ma...e/example.html

3.生成圖形

設(shè)置好圖形配置文件后我們就要生成圖形了,在cacti里這個是通過cacti的采集器實現(xiàn)的,在單獨安裝weathermap的后,需要利用系統(tǒng)的計劃任務(wù)來實現(xiàn)
代碼:
  vi /etc/crontab 
添加如下
代碼:
  */5 * * * * root /usr/bin/php /var/www/html/weathermap/weathermap --config /var/www/html/weathermap/configs/simple.conf --image-uri ../weathermap/test.png 
然后我們要做個硬鏈接不讓png圖片的路徑會有錯誤
代碼:
  ln /test.png /var/www/html/weathermap/test.png 
至此我們的weathermap已經(jīng)做好我們可以打開http://xxx.xxx.xxx.xxx/weathermap/index.html查看拓?fù)鋱D。
我最終的拓?fù)鋱D
Cacti插件詳解之——Weathermap(2)

總結(jié):
1.weathermap的用法就說到這里,基本就是這二種了,還有的是自己做一個html,再嵌套一個weathermap的頁面就像剛開始給大家說的那個中國科大的,就是通過網(wǎng)頁的嵌套做到的,嵌套了mrtg,weathermap的頁面。
2.在單獨使用weathermap時要特別注意路徑問題,不出圖形很有可能是路徑問題,這個問題我也糾結(jié)了很久。
3.最重要的一點,就是關(guān)于weathermap的安全性問題,其實在它的官網(wǎng)也說明了。

代碼:
  地址:http://www.network-weathermap.com/ma...ti-editor.html   When you are happy that the world can't edit your maps, then enable the editor. This is done by editing the top of editor.php and changing $ENABLED=false; to $ENABLED=true;   You should now be able to go to http://your.server/cacti/plugins/weathermap/editor.php in a browser, and get a welcome page that offers to load or create a config file. That's it. All done. Please see the editor manual page for more about using the editor!  You can also edit an existing map from the Cacti web interface, by choosing Manage..Weathermaps and then clicking on the name of a config file in the list of active maps. The editor will open with that map loaded.  Important Security Note: The editor allows anyone who can access editor.php to change the configuration files for your network weathermaps. There is no authentication built-in for editing, even with the Cacti Plugin. This is why the configuration file doesn't exist by default - the editor won't work until you choose to make it work. It's recommended that you either:  change the ownership of configuration files so that the editor can't write to them once they are complete, or use your webserver's authentication and access control facilities to limit who can access the editor.php URL. On apache, this can be done using the FilesMatch directive and mod_access. 
可以看到在默認(rèn)情況下editor.php這個是沒有做驗證的,就是意味每個人都可以編輯你的weathermap圖形配置文件!?。?!發(fā)現(xiàn)很多使用weathermap都沒做限制,有些還是直接到公網(wǎng)的,再次特別提醒,一定要做一個驗證!
下面我提供一種方法。
修改httpd.conf配置文件
代碼:
  vi /etc/httpd/conf/httpd.conf 
在文件最后添加
代碼:
                   Order Deny,Allow             Deny from all             Allow from 127.0.0.1          
然后保存,這個路勁是weathermap的路徑.這樣就可以限制別人訪問editor.php的訪問.設(shè)置好后重啟apache,再訪問那個頁面就會出現(xiàn)這個頁面
Cacti插件詳解之——Weathermap(2)
當(dāng)然也可以做一個基于.htaccess的驗證。

本文內(nèi)容都是本人自己理解,如有錯誤之處,請大牛指正啊,不勝感謝??!

網(wǎng)站題目:Cacti插件詳解之——Weathermap(2)
本文來源:http://www.ekvhdxd.cn/article28/pdcdcp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗自適應(yīng)網(wǎng)站ChatGPT、虛擬主機(jī)定制網(wǎng)站、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)