解決cactiez的monitor主機名亂碼

 

  1.  cactiez的monitor主機名亂碼解決: 
  2.  
  3. /usr/share/cacti/site/plugins/monitor/monitor.php 
  4. 需要添加 
  5. $name = iconv("UTF-8", "GB2312//IGNORE", $name); 
  6.   
  7. function render_host($host) { 
  8.  global $thold, $thold_hosts, $config, $muted_hosts; 
  9.  //throw out tree root items 
  10.  if (array_key_exists("name",$host))  {return;} 
  11.  if ($host['id'] <= 0) {return;} 
  12.  // Create the status array (0=unknown1=down2=recovering3=up
  13.  $icolors = array('red.gif', 'red.gif', 'blue.gif', 'green.gif', 'orange.gif', 'muted.gif'); 
  14.  $icolorsdisplay = array('Unknown', '<font color=red><b>Down</b></font>', 'Recovering', 'Up', 'Threshold Breached', '<font color=red><b>Down</b></font> (Muted)'); 
  15.  $result = ""
  16.  $row = $host; 
  17.  // Loop through each host one by one 
  18.  $id = $host['id']; 
  19.  $anchor = $config['url_path'] . "graph_view.php?action=preview&host_id=" . $row['id']; 
  20.  $name = $row['description']; 
  21. $name = iconv("UTF-8", "GB2312//IGNORE", $name); 
  22.  $status = $row['status']; 
  23.  $hostname =  $row['hostname']; 
  24.  $ptime = round($row['cur_time'],2); 
  25.  $d = $row['status_rec_date']; 
  26.  if ($d == "0000-00-00 00:00:00") $d = "Never"
  27.  $avail = round($row['availability'],2); 
  28.  
  29. 原文鏈接:http://cuobiezi51cto.blog.51cto.com/407872/815334
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章