cactiez的monitor主机名乱码解决:
/usr/share/cacti/site/plugins/monitor/monitor.php
需要添加
$name = iconv("UTF-8", "GB2312//IGNORE", $name);
function render_host($host) {
global $thold, $thold_hosts, $config, $muted_hosts;
//throw out tree root items
if (array_key_exists("name",$host)) {return;}
if ($host['id'] <= 0) {return;}
// Create the status array (0=unknown, 1=down, 2=recovering, 3=up)
$icolors = array('red.gif', 'red.gif', 'blue.gif', 'green.gif', 'orange.gif', 'muted.gif');
$icolorsdisplay = array('Unknown', '<font color=red><b>Down</b></font>', 'Recovering', 'Up', 'Threshold Breached', '<font color=red><b>Down</b></font> (Muted)');
$result = "";
$row = $host;
// Loop through each host one by one
$id = $host['id'];
$anchor = $config['url_path'] . "graph_view.php?action=preview&host_id=" . $row['id'];
$name = $row['description'];
$name = iconv("UTF-8", "GB2312//IGNORE", $name);
$status = $row['status'];
$hostname = $row['hostname'];
$ptime = round($row['cur_time'],2);
$d = $row['status_rec_date'];
if ($d == "0000-00-00 00:00:00") $d = "Never";
$avail = round($row['availability'],2);