'Storage', 'url' => generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'health', 'metric' => 'storage')), 'icon' => $config['icon']['storage'], ); echo generate_box_open($box_args); echo(''); foreach ($drives as $drive) { $skipdrive = FALSE; if ($device["os"] === "junos") { foreach ($config['ignore_junos_os_drives'] as $jdrive) { if (preg_match($jdrive, $drive["storage_descr"])) { $skipdrive = TRUE; } } //$drive["storage_descr"] = preg_replace("/.*mounted on: (.*)/", "\\1", $drive["storage_descr"]); } if ($device['os'] === "freebsd") { foreach ($config['ignore_bsd_os_drives'] as $jdrive) { if (preg_match($jdrive, $drive["storage_descr"])) { $skipdrive = TRUE; } } } if ($drive['storage_ignore']) { $skipdrive = TRUE; } if ($skipdrive) { continue; } $drive["storage_descr"] = rewrite_entity_name($drive["storage_descr"], 'storage', FALSE); //$drive["storage_descr"] = preg_replace("/(.*), type: (.*), dev: (.*)/", "\\1", $drive["storage_descr"]); // '/mnt/Media, type: zfs, dev: Media' //$drive["storage_descr"] = preg_replace("/(.*) Label:(.*) Serial Number (.*)/", "\\1", $drive["storage_descr"]); // E:\ Label:Large Space Serial Number 26ad0d98 $percent = round($drive['storage_perc'], 0); $total = formatStorage($drive['storage_size']); $free = formatStorage($drive['storage_free']); $used = formatStorage($drive['storage_used']); $background = get_percentage_colours($percent); $graph_array = array(); $graph_array['height'] = "100"; $graph_array['width'] = "210"; $graph_array['to'] = $config['time']['now']; $graph_array['id'] = $drive['storage_id']; $graph_array['type'] = $graph_type; $graph_array['from'] = $config['time']['day']; $graph_array['legend'] = "no"; $link_array = $graph_array; $link_array['page'] = "graphs"; unset($link_array['height'], $link_array['width'], $link_array['legend']); $link = generate_url($link_array); $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $drive['storage_descr']); $graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = 'ffffff00'; // $graph_array['style'][] = 'margin-top: -6px'; $minigraph = generate_graph_tag($graph_array); echo(''); } echo("
'.generate_entity_link('storage', $drive).' '.overlib_link($link, $minigraph, $overlib_content).' '.overlib_link($link, print_percentage_bar (200, 20, $percent, $used."/".$total." (".$percent . "%)", "ffffff", $background['left'], $free . " (" . (100 - $percent) . "%)", "ffffff", $background['right']), $overlib_content).'
"); echo generate_box_close(); } unset ($drive_rows); // EOF