歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux 判斷Cacti模板的版本

Linux 判斷Cacti模板的版本

日期:2017/2/28 16:26:33   编辑:Linux教程

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

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

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

這 是一個template中的一段 <hash_040018258d1c9487a6c58dd804f4a012007664>
頭 兩位藍色的數字是template的類型.
接下來的4位紅色數字Cactiversion ,這就是我們要找的東西!!!
接下來的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"
);

Copyright © Linux教程網 All Rights Reserved