From 33d5200edd627c4a5d5acb38f553c1206d319e99 Mon Sep 17 00:00:00 2001 From: Geert Hauwaerts Date: Sun, 21 Feb 2010 00:29:47 +0000 Subject: [PATCH] - Added default config item to filter JunOS system partitions from the GUI. Setting: ignore_junos_os_drives Default: /packages, /dev and /proc git-svn-id: http://www.observium.org/svn/observer/trunk@896 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/storage.php | 13 ++++++++++++- includes/defaults.inc.php | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/html/pages/storage.php b/html/pages/storage.php index eb5fb77d1..17276ba47 100644 --- a/html/pages/storage.php +++ b/html/pages/storage.php @@ -25,7 +25,18 @@ $row = 1; while($drive = mysql_fetch_array($query)) { - if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } + $skipdrive = 0; + + if ($drive["os"] == "junos") { + foreach ($config['ignore_junos_os_drives'] as $jdrive) { + if (preg_match($jdrive, $drive["hrStorageDescr"])) { + $skipdrive = 1; + } + } + } + + if ($skipdrive) { continue; } + if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits']; $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index f0575b9c7..89ea29f50 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -83,5 +83,6 @@ $config['ignore_mount_string'] = array("packages", "devfs", "procfs", "UMA", "MA $config['ignore_mount_regexp'] = array(); $config['ignore_mount_removable'] = 1; # Ignore removable disk storage $config['ignore_mount_network'] = 1; # Ignore network mounted storage +$config['ignore_junos_os_drives'] = array("/, \/packages/", "/, \/dev/", "/, \/proc/"); # Ignore JunOS partitions who are always 100% ?>