From 2d7ee29d10611290670acb2e467466ce3937c431 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sun, 14 Mar 2010 13:50:14 +0000 Subject: [PATCH] HOST-RESOURCES-MIB storage-based memory polling (COMMENTS PLEASE) git-svn-id: http://www.observium.org/svn/observer/trunk@1026 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-interface-graphs.inc.php | 2 +- html/pages/device/overview/ports.inc.php | 2 +- includes/discovery/mempools-hrstorage.inc.php | 25 +++++++++++++++++++ includes/discovery/mempools.inc.php | 1 + includes/polling/mempools-hrstorage.inc.php | 17 +++++++++++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 includes/discovery/mempools-hrstorage.inc.php create mode 100755 includes/polling/mempools-hrstorage.inc.php diff --git a/html/includes/print-interface-graphs.inc.php b/html/includes/print-interface-graphs.inc.php index a6245beeb..2e623beb0 100644 --- a/html/includes/print-interface-graphs.inc.php +++ b/html/includes/print-interface-graphs.inc.php @@ -17,7 +17,7 @@ foreach($periods as $period) { $graph_array['from'] = $$period; $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400"; - echo(overlib_link("#", generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL)); + echo(overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL)); } ?> diff --git a/html/pages/device/overview/ports.inc.php b/html/pages/device/overview/ports.inc.php index b97c1c87f..4b42e759b 100644 --- a/html/pages/device/overview/ports.inc.php +++ b/html/pages/device/overview/ports.inc.php @@ -26,7 +26,7 @@ if($ports['total']) { $content .= generate_graph_tag($graph_array); $content .= ""; - echo(overlib_link("#", $graph, $content, NULL)); + echo(overlib_link($_SERVER['REQUEST_URI'], $graph, $content, NULL)); echo('
'); diff --git a/includes/discovery/mempools-hrstorage.inc.php b/includes/discovery/mempools-hrstorage.inc.php new file mode 100755 index 000000000..4e05e568b --- /dev/null +++ b/includes/discovery/mempools-hrstorage.inc.php @@ -0,0 +1,25 @@ + $storage) + { + $fstype = $storage['hrStorageType']; + $descr = $storage['hrStorageDescr']; + $size = $storage['hrStorageSize'] * $storage['hrStorageAllocationUnits']; + $used = $storage['hrStorageUsed'] * $storage['hrStorageAllocationUnits']; + $units = $storage['hrStorageAllocationUnits']; + $deny = 1; + + if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam" || $fstype == "hrStorageOther") { $deny = 0; } + + if(!$deny && is_numeric($index)) { + discover_mempool($valid_mempool, $device, $index, "hrstorage", $descr, $units, NULL, NULL); + } + unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $storage_array); + } +} + +?> diff --git a/includes/discovery/mempools.inc.php b/includes/discovery/mempools.inc.php index a89a6d122..4cc1db23c 100755 --- a/includes/discovery/mempools.inc.php +++ b/includes/discovery/mempools.inc.php @@ -2,6 +2,7 @@ echo("Memory : "); +include("mempools-hrstorage.inc.php"); include("mempools-cemp.inc.php"); include("mempools-cmp.inc.php"); include("mempools-junos.inc.php"); diff --git a/includes/polling/mempools-hrstorage.inc.php b/includes/polling/mempools-hrstorage.inc.php new file mode 100755 index 000000000..6c6f3416d --- /dev/null +++ b/includes/polling/mempools-hrstorage.inc.php @@ -0,0 +1,17 @@ +