From acf2d85b2fbfb1367f0a04ffcd39acbba2d6dcf5 Mon Sep 17 00:00:00 2001 From: Geert Hauwaerts Date: Fri, 26 Feb 2010 13:07:30 +0000 Subject: [PATCH] - Ignored some FreeBSD OS drives. git-svn-id: http://www.observium.org/svn/observer/trunk@958 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/device/overview/storage.inc.php | 8 ++++++++ html/pages/storage.php | 8 ++++++++ includes/defaults.inc.php | 1 + 3 files changed, 17 insertions(+) diff --git a/html/pages/device/overview/storage.inc.php b/html/pages/device/overview/storage.inc.php index 542d128fa..cd66e1ecb 100644 --- a/html/pages/device/overview/storage.inc.php +++ b/html/pages/device/overview/storage.inc.php @@ -20,6 +20,14 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE device_ $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 = 1; + } + } + } + if ($skipdrive) { continue; } if(is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } $perc = round($drive['storage_perc'], 0); diff --git a/html/pages/storage.php b/html/pages/storage.php index e0aa8b0e7..e373387cd 100644 --- a/html/pages/storage.php +++ b/html/pages/storage.php @@ -35,6 +35,14 @@ while($drive = mysql_fetch_array($query)) { $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 = 1; + } + } + } + if ($skipdrive) { continue; } if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 31514a2cd..f195b4eae 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -96,6 +96,7 @@ $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("/on: \/packages/", "/on: \/dev/", "/on: \/proc/", "^/\/junos$/", "^/\/junos\/dev/$", "/^\/jail\/dev$/"); # Ignore JunOS partitions who are always 100% +$config['ignore_bsd_os_drives'] = array("/^\/dev$/", "/^\/var\/dhcpd\/dev$/", "/^UMA:/"); # Ignore BSD partitions who are always 100% # Ports