Linux 判斷Cacti模板的版本

來源:互聯網
上載者:User

標籤:cacti 更新版本 模板 匯入 出錯 低版本

  經常有人在 import從網上download的cacti template時發生”Error: XML: Hash version does not exist” 錯誤。

這是因為 export template的cacti和import template的cacti的版本不同引起的。為了保證相容性,cacti有一個機制會阻止從新版本cacti匯出的模板被導回到舊版本的cacti 中。

那麼如何判斷一個模板所使用的cacti版本呢?方法是查看template中的hash後邊的字串的值。舉例如下:

這 是一個template中的一段 <hash_040018258d1c9487a6c58dd804f4a012007664>
頭 兩位藍色的數字是template的類型.
接下來的4位紅色數字 Cacti version ,這就是我們要找的東西!!!
接下來的32位元字是系統隨機產生.

每個cacti版本對應的數 字記錄在/var/www/html/cactig/include/global_arrays.php檔案中,具體參考下邊我摘錄的部分:

$hash_version_codes = array(
"0.8.4"  => "0000",
"0.8.5"  => "0001",
"0.8.5a" => "0002",
"0.8.6"  => "0003",
"0.8.6a" => "0004",
"0.8.6b" => "0005",
"0.8.6c" => "0006",
"0.8.6d" => "0007",
"0.8.6e" => "0008",
"0.8.6f" => "0009",
"0.8.6g" => "0010",
"0.8.6h" => "0011",
"0.8.6i" => "0012",
"0.8.6j" => "0013",
"0.8.7"  => "0014",
"0.8.7a" => "0015",
"0.8.7b" => "0016",
"0.8.7c" => "0017",
"0.8.7d" => "0018"
);


如果高版本的內容根低版本內容變化不大,或者不影響使用,那麼你可以替換該字串。(記得做好備份)

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/54/48/wKiom1R94aLTSX01AALj5V1wWLI661.jpg" title="1.png" alt="wKiom1R94aLTSX01AALj5V1wWLI661.jpg" />


本文出自 “Professor哥” 部落格,請務必保留此出處http://professor.blog.51cto.com/996189/1585749

Linux 判斷Cacti模板的版本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.