From 306578111844c5b2f8292e3e40c2fb7e48033e2b Mon Sep 17 00:00:00 2001 From: Rosiak Date: Fri, 6 Nov 2015 17:48:50 +0100 Subject: [PATCH 01/11] Add innodb config example to daily Fix issue-2400 --- daily.php | 1 + 1 file changed, 1 insertion(+) diff --git a/daily.php b/daily.php index e5e06884b..8569f1c9a 100644 --- a/daily.php +++ b/daily.php @@ -37,6 +37,7 @@ The ' . $config['project_name'] . ' team.'; echo 'Current size: '.($pool_size / 1024 / 1024).' MiB'.PHP_EOL; echo 'Minimum Required: '.($pool_used / 1024 / 1024).' MiB'.PHP_EOL; echo 'To ensure integrity, we\'re not going to pull any updates until the buffersize has been adjusted.'.PHP_EOL; + echo 'Config proposal: "innodb_buffer_pool_size = '.pow(2,ceil(log(($pool_used / 1024 / 1024),2))).'M"'.PHP_EOL; } exit(2); } From 8196b19096be64f3f3879d89a189372dbc8df313 Mon Sep 17 00:00:00 2001 From: Richard Kojedzinszky Date: Sun, 8 Nov 2015 18:27:00 +0100 Subject: [PATCH 02/11] I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index bae7770ff..0fc344279 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -67,4 +67,5 @@ Contributors to LibreNMS: - Richard Hartmann (RichiH) - Robert Gornall (rgormley) +- Richard Kojedzinszky (rkojedzinszky) [1]: http://observium.org/ "Observium web site" From ca595e1e9d56f0db995e39e8929eae19d79b635d Mon Sep 17 00:00:00 2001 From: Richard Kojedzinszky Date: Sun, 8 Nov 2015 18:27:19 +0100 Subject: [PATCH 03/11] FIX 95th percent lines in negative range --- html/includes/graphs/generic_data.inc.php | 2 +- html/includes/graphs/generic_multi_bits.inc.php | 4 ++-- html/includes/graphs/generic_multi_data.inc.php | 4 ++-- html/includes/graphs/generic_multi_data_separated.inc.php | 2 +- html/includes/graphs/generic_multi_seperated.inc.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/html/includes/graphs/generic_data.inc.php b/html/includes/graphs/generic_data.inc.php index e13fce80c..63b75fde4 100644 --- a/html/includes/graphs/generic_data.inc.php +++ b/html/includes/graphs/generic_data.inc.php @@ -87,7 +87,7 @@ $rrd_options .= ' VDEF:tot=octets,TOTAL'; $rrd_options .= ' VDEF:95thin=inbits,95,PERCENT'; $rrd_options .= ' VDEF:95thout=outbits,95,PERCENT'; -$rrd_options .= ' VDEF:d95thout=doutbits,5,PERCENT'; +$rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST'; if ($format == 'octets' || $format == 'bytes') { $units = 'Bps'; diff --git a/html/includes/graphs/generic_multi_bits.inc.php b/html/includes/graphs/generic_multi_bits.inc.php index caa765e4d..5233fdb81 100644 --- a/html/includes/graphs/generic_multi_bits.inc.php +++ b/html/includes/graphs/generic_multi_bits.inc.php @@ -57,7 +57,7 @@ if ($i) { $rrd_options .= ' CDEF:doutbits=doutoctets,8,*'; $rrd_options .= ' VDEF:95thin=inbits,95,PERCENT'; $rrd_options .= ' VDEF:95thout=outbits,95,PERCENT'; - $rrd_options .= ' VDEF:d95thout=doutbits,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST'; if ($_GET['previous'] == 'yes') { $rrd_options .= ' CDEF:'.$in.'octetsX='.$in_thingX.$pluses; @@ -68,7 +68,7 @@ if ($i) { $rrd_options .= ' CDEF:doutbitsX=doutoctetsX,8,*'; $rrd_options .= ' VDEF:95thinX=inbitsX,95,PERCENT'; $rrd_options .= ' VDEF:95thoutX=outbitsX,95,PERCENT'; - $rrd_options .= ' VDEF:d95thoutX=doutbitsX,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutXn=doutbitsX,-1,* VDEF:d95thoutXn95=d95thoutXn,95,PERCENT CDEF:d95thoutXn95n=doutbitsX,doutbitsX,-,d95thoutXn95,-1,*,+ VDEF:d95thoutX=d95thoutXn95n,FIRST'; } if ($legend == 'no' || $legend == '1') { diff --git a/html/includes/graphs/generic_multi_data.inc.php b/html/includes/graphs/generic_multi_data.inc.php index 90f5c908e..d3ab6c2e2 100644 --- a/html/includes/graphs/generic_multi_data.inc.php +++ b/html/includes/graphs/generic_multi_data.inc.php @@ -66,7 +66,7 @@ if ($i) { $rrd_options .= ' CDEF:doutbits=doutoctets,8,*'; $rrd_options .= ' VDEF:95thin=inbits,95,PERCENT'; $rrd_options .= ' VDEF:95thout=outbits,95,PERCENT'; - $rrd_options .= ' VDEF:d95thout=doutbits,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST'; if ($_GET['previous'] == 'yes') { $rrd_options .= ' CDEF:'.$in.'octetsX='.$in_thingX.$pluses; @@ -77,7 +77,7 @@ if ($i) { $rrd_options .= ' CDEF:doutbitsX=doutoctetsX,8,*'; $rrd_options .= ' VDEF:95thinX=inbitsX,95,PERCENT'; $rrd_options .= ' VDEF:95thoutX=outbitsX,95,PERCENT'; - $rrd_options .= ' VDEF:d95thoutX=doutbitsX,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutXn=doutbitsX,-1,* VDEF:d95thoutXn95=d95thoutXn,95,PERCENT CDEF:d95thoutXn95n=doutbitsX,doutbitsX,-,d95thoutXn95,-1,*,+ VDEF:d95thoutX=d95thoutXn95n,FIRST'; } if ($legend == 'no' || $legend == '1') { diff --git a/html/includes/graphs/generic_multi_data_separated.inc.php b/html/includes/graphs/generic_multi_data_separated.inc.php index 7865d03de..e73ac4e85 100644 --- a/html/includes/graphs/generic_multi_data_separated.inc.php +++ b/html/includes/graphs/generic_multi_data_separated.inc.php @@ -111,7 +111,7 @@ if (!$nototal) { $rrd_options .= ' VDEF:95thin=inbits,95,PERCENT'; $rrd_options .= ' VDEF:95thout=outbits,95,PERCENT'; - $rrd_options .= ' VDEF:d95thout=doutbits,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST'; $rrd_options .= ' VDEF:totin=inoctets,TOTAL'; $rrd_options .= ' VDEF:totout=outoctets,TOTAL'; diff --git a/html/includes/graphs/generic_multi_seperated.inc.php b/html/includes/graphs/generic_multi_seperated.inc.php index 9b37f3751..8549b3b33 100644 --- a/html/includes/graphs/generic_multi_seperated.inc.php +++ b/html/includes/graphs/generic_multi_seperated.inc.php @@ -111,7 +111,7 @@ if ($_GET['previous'] == 'yes') { $rrd_options .= ' CDEF:doutbitsX=doutBX,8,*'; $rrd_options .= ' VDEF:95thinX=inbitsX,95,PERCENT'; $rrd_options .= ' VDEF:95thoutX=outbitsX,95,PERCENT'; - $rrd_options .= ' VDEF:d95thoutX=doutbitsX,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutXn=doutbitsX,-1,* VDEF:d95thoutXn95=d95thoutXn,95,PERCENT CDEF:d95thoutXn95n=doutbitsX,doutbitsX,-,d95thoutXn95,-1,*,+ VDEF:d95thoutX=d95thoutXn95n,FIRST'; } if ($_GET['previous'] == 'yes') { @@ -132,7 +132,7 @@ if (!$args['nototal']) { $rrd_options .= ' CDEF:doutbits=doutB,8,*'; $rrd_options .= ' VDEF:95thin=inbits,95,PERCENT'; $rrd_options .= ' VDEF:95thout=outbits,95,PERCENT'; - $rrd_options .= ' VDEF:d95thout=doutbits,5,PERCENT'; + $rrd_options .= ' CDEF:d95thoutn=doutbits,-1,* VDEF:d95thoutn95=d95thoutn,95,PERCENT CDEF:d95thoutn95n=doutbits,doutbits,-,d95thoutn95,-1,*,+ VDEF:d95thout=d95thoutn95n,FIRST'; $rrd_options .= ' VDEF:totin=inB,TOTAL'; $rrd_options .= ' VDEF:avein=inbits,AVERAGE'; $rrd_options .= ' VDEF:totout=outB,TOTAL'; From 0eeb4d2ef865cefc0101fe554dacae00ce55ab4d Mon Sep 17 00:00:00 2001 From: Falk Stern Date: Tue, 10 Nov 2015 10:03:47 +0100 Subject: [PATCH 04/11] Fixed a bug from scrutinizer --- html/includes/authentication/active_directory.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/includes/authentication/active_directory.inc.php b/html/includes/authentication/active_directory.inc.php index 316017855..5aea2e11b 100644 --- a/html/includes/authentication/active_directory.inc.php +++ b/html/includes/authentication/active_directory.inc.php @@ -127,7 +127,7 @@ function get_userid($username) { global $config, $ds; $attributes = array('objectsid'); - $result = ldap_search($ds, $config['auth_ad_base_dn'], + $search = ldap_search($ds, $config['auth_ad_base_dn'], "(samaccountname={$username})", $attributes); $entries = ldap_get_entries($ds, $search); @@ -148,6 +148,7 @@ function deluser($username) { function get_userlist() { global $config, $ds; $userlist = array(); + $userhash = array(); $ldap_groups = get_group_list(); From 2326061e6889c2f9f1a2cc281bb6c30d56bd3e4b Mon Sep 17 00:00:00 2001 From: Falk Stern Date: Tue, 10 Nov 2015 10:38:42 +0100 Subject: [PATCH 05/11] Removed unused variables and updated coding style --- .../authentication/active_directory.inc.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/html/includes/authentication/active_directory.inc.php b/html/includes/authentication/active_directory.inc.php index 5aea2e11b..0773a108e 100644 --- a/html/includes/authentication/active_directory.inc.php +++ b/html/includes/authentication/active_directory.inc.php @@ -41,33 +41,36 @@ function authenticate($username, $password) { return $user_authenticated; - } else { + } + else { // group membership is not required and user is valid return 1; }; - } else { + } + else { return 0; } - } else { + } + else { echo ldap_error($ds); } return 0; } -function reauthenticate($sess_id, $token) { +function reauthenticate() { // not supported so return 0 return 0; } -function passwordscanchange($username='') { +function passwordscanchange() { // not supported so return 0 return 0; } -function changepassword($username, $newpassword) { +function changepassword() { // not supported so return 0 return 0; } @@ -79,7 +82,7 @@ function auth_usermanagement() { } -function adduser($username, $password, $level, $email='', $realname='', $can_modify_passwd='1') { +function adduser() { // not supported so return 0 return 0; } @@ -219,7 +222,8 @@ function get_fullname($username) { $entries = ldap_get_entries($ds, $result); if ($entries['count'] > 0) { $membername = $entries[0]['name'][0]; - } else { + } + else { $membername = $username; } @@ -263,7 +267,8 @@ function get_dn($samaccountname) { $entries = ldap_get_entries($ds, $result); if ($entries['count'] > 0) { return $entries[0]['dn']; - } else { + } + else { return ''; } } From 16df0fdd2e3882725d4081f06c87ec2e568b80bd Mon Sep 17 00:00:00 2001 From: Falk Stern Date: Tue, 10 Nov 2015 10:39:42 +0100 Subject: [PATCH 06/11] Coding style --- html/includes/authentication/active_directory.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/authentication/active_directory.inc.php b/html/includes/authentication/active_directory.inc.php index 0773a108e..659f5cba6 100644 --- a/html/includes/authentication/active_directory.inc.php +++ b/html/includes/authentication/active_directory.inc.php @@ -45,7 +45,7 @@ function authenticate($username, $password) { else { // group membership is not required and user is valid return 1; - }; + } } else { return 0; From d326869675f06d41fc161795c7f71270c8568b54 Mon Sep 17 00:00:00 2001 From: Falk Stern Date: Tue, 10 Nov 2015 10:47:50 +0100 Subject: [PATCH 07/11] Removed unused variables --- html/includes/authentication/active_directory.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/authentication/active_directory.inc.php b/html/includes/authentication/active_directory.inc.php index 659f5cba6..03788f90d 100644 --- a/html/includes/authentication/active_directory.inc.php +++ b/html/includes/authentication/active_directory.inc.php @@ -142,7 +142,7 @@ function get_userid($username) { } -function deluser($username) { +function deluser() { // not supported so return 0 return 0; } From a4eb4391c53b70121c0ff29bb40b92ee99c094c0 Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Tue, 10 Nov 2015 11:06:03 +0100 Subject: [PATCH 08/11] Add Ceph support --- .../application/ceph_osd_performance.inc.php | 27 ++++++ .../graphs/application/ceph_pool_df.inc.php | 58 +++++++++++++ .../graphs/application/ceph_pool_io.inc.php | 28 ++++++ .../graphs/application/ceph_pool_iops.inc.php | 26 ++++++ .../application/ceph_pool_objects.inc.php | 24 ++++++ html/pages/device/apps/ceph.inc.php | 85 +++++++++++++++++++ includes/polling/applications/ceph.inc.php | 69 +++++++++++++++ includes/polling/unix-agent.inc.php | 3 +- 8 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 html/includes/graphs/application/ceph_osd_performance.inc.php create mode 100644 html/includes/graphs/application/ceph_pool_df.inc.php create mode 100644 html/includes/graphs/application/ceph_pool_io.inc.php create mode 100644 html/includes/graphs/application/ceph_pool_iops.inc.php create mode 100644 html/includes/graphs/application/ceph_pool_objects.inc.php create mode 100644 html/pages/device/apps/ceph.inc.php create mode 100644 includes/polling/applications/ceph.inc.php diff --git a/html/includes/graphs/application/ceph_osd_performance.inc.php b/html/includes/graphs/application/ceph_osd_performance.inc.php new file mode 100644 index 000000000..f089041bc --- /dev/null +++ b/html/includes/graphs/application/ceph_osd_performance.inc.php @@ -0,0 +1,27 @@ + 'Pool stats', + 'ceph_osdperf' => 'OSD Performance', + 'ceph_df' => 'Usage', +); + +$rrddir = $config['rrd_dir'].'/'.$device['hostname']; + +foreach ($graphs as $key => $text) { + echo '

'.$text.'

'; + $graph_array['height'] = '100'; + $graph_array['width'] = '215'; + $graph_array['to'] = $config['time']['now']; + $graph_array['id'] = $app['app_id']; + + if ($key == "ceph_poolstats") { + foreach (glob($rrddir."/app-ceph-".$app['app_id']."-pool-*") as $rrd_filename) { + if (preg_match("/.*-pool-(.+)\.rrd$/", $rrd_filename, $pools)) { + $pool = $pools[1]; + echo '

'.$pool.' Reads/Writes

'; + $graph_array['type'] = 'application_ceph_pool_io'; + $graph_array['pool'] = $pool; + + echo ""; + include 'includes/print-graphrow.inc.php'; + echo ''; + + echo '

'.$pool.' IOPS

'; + $graph_array['type'] = 'application_ceph_pool_iops'; + $graph_array['pool'] = $pool; + + echo ""; + include 'includes/print-graphrow.inc.php'; + echo ''; + } + } + } elseif ($key == "ceph_osdperf") { + foreach (glob($rrddir."/app-ceph-".$app['app_id']."-osd-*") as $rrd_filename) { + if (preg_match("/.*-osd-(.+)\.rrd$/", $rrd_filename, $osds)) { + $osd = $osds[1]; + echo '

'.$osd.' Latency

'; + $graph_array['type'] = 'application_ceph_osd_performance'; + $graph_array['osd'] = $osd; + + echo ""; + include 'includes/print-graphrow.inc.php'; + echo ''; + } + } + } elseif ($key == "ceph_df") { + foreach (glob($rrddir."/app-ceph-".$app['app_id']."-df-*") as $rrd_filename) { + if (preg_match("/.*-df-(.+)\.rrd$/", $rrd_filename, $pools)) { + $pool = $pools[1]; + if ($pool == "c") { + echo '

Cluster Usage

'; + $graph_array['type'] = 'application_ceph_pool_df'; + $graph_array['pool'] = $pool; + + echo ""; + include 'includes/print-graphrow.inc.php'; + echo ''; + } else { + echo '

'.$pool.' Usage

'; + $graph_array['type'] = 'application_ceph_pool_df'; + $graph_array['pool'] = $pool; + + echo ""; + include 'includes/print-graphrow.inc.php'; + echo ''; + + echo '

'.$pool.' Objects

'; + $graph_array['type'] = 'application_ceph_pool_objects'; + $graph_array['pool'] = $pool; + + echo ""; + include 'includes/print-graphrow.inc.php'; + echo ''; + } + } + } + } + +} diff --git a/includes/polling/applications/ceph.inc.php b/includes/polling/applications/ceph.inc.php new file mode 100644 index 000000000..711433843 --- /dev/null +++ b/includes/polling/applications/ceph.inc.php @@ -0,0 +1,69 @@ +', $section); + if ($section == "poolstats") { + foreach (explode("\n", $data) as $line) { + if (empty($line)) + continue; + list($pool,$ops,$wrbytes,$rbytes) = explode(':', $line); + $ceph_rrd = $ceph_rrddir.'/app-ceph-'.$app['app_id'].'-pool-'.$pool.'.rrd'; + if (!is_file($ceph_rrd)) { + rrdtool_create( + $ceph_rrd, + '--step 300 \ + DS:ops:GAUGE:600:0:U \ + DS:wrbytes:GAUGE:600:0:U \ + DS:rbytes:GAUGE:600:0:U '.$config['rrd_rra'] + ); + } + + print "Ceph Pool: $pool, IOPS: $ops, Wr bytes: $wrbytes, R bytes: $rbytes\n"; + rrdtool_update($ceph_rrd, array("ops" => $ops, "wrbytes" => $wrbytes, "rbytes" => $rbytes)); + } + } elseif ($section == "osdperformance") { + foreach (explode("\n", $data) as $line) { + if (empty($line)) + continue; + list($osd,$apply,$commit) = explode(':', $line); + $ceph_rrd = $ceph_rrddir.'/app-ceph-'.$app['app_id'].'-osd-'.$osd.'.rrd'; + if (!is_file($ceph_rrd)) { + rrdtool_create( + $ceph_rrd, + '--step 300 \ + DS:apply_ms:GAUGE:600:0:U \ + DS:commit_ms:GAUGE:600:0:U '.$config['rrd_rra'] + ); + } + + print "Ceph OSD: $osd, Apply: $apply, Commit: $commit\n"; + rrdtool_update($ceph_rrd, array("apply_ms" => $apply, "commit_ms" => $commit)); + } + } elseif ($section == "df") { + foreach (explode("\n", $data) as $line) { + if (empty($line)) + continue; + list($pool,$avail,$used,$objects) = explode(':', $line); + $ceph_rrd = $ceph_rrddir.'/app-ceph-'.$app['app_id'].'-df-'.$pool.'.rrd'; + if (!is_file($ceph_rrd)) { + rrdtool_create( + $ceph_rrd, + '--step 300 \ + DS:avail:GAUGE:600:0:U \ + DS:used:GAUGE:600:0:U \ + DS:objects:GAUGE:600:0:U '.$config['rrd_rra'] + ); + } + + print "Ceph Pool DF: $pool, Avail: $avail, Used: $used, Objects: $objects\n"; + rrdtool_update($ceph_rrd, array("avail" => $avail, "used" => $used, "objects" => $objects)); + } + } + } +} diff --git a/includes/polling/unix-agent.inc.php b/includes/polling/unix-agent.inc.php index 0bdfae836..18d30e58e 100644 --- a/includes/polling/unix-agent.inc.php +++ b/includes/polling/unix-agent.inc.php @@ -51,6 +51,7 @@ if ($device['os_group'] == 'unix') { $agentapps = array( "apache", + "ceph", "mysql", "nginx", "bind", @@ -104,7 +105,7 @@ if ($device['os_group'] == 'unix') { if (file_exists("includes/polling/applications/$key.inc.php")) { d_echo("Enabling $key for ".$device['hostname']." if not yet enabled\n"); - if (in_array($key, array('apache', 'mysql', 'nginx', 'proxmox'))) { + if (in_array($key, array('apache', 'mysql', 'nginx', 'proxmox', 'ceph'))) { if (dbFetchCell('SELECT COUNT(*) FROM `applications` WHERE `device_id` = ? AND `app_type` = ?', array($device['device_id'], $key)) == '0') { echo "Found new application '$key'\n"; dbInsert(array('device_id' => $device['device_id'], 'app_type' => $key), 'applications'); From 24550b0c023b7e9c8f61c8a3e08b8e12b1155e54 Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Tue, 10 Nov 2015 11:44:14 +0100 Subject: [PATCH 09/11] Fix if-then-else --- html/pages/device/apps/ceph.inc.php | 9 ++++++--- includes/polling/applications/ceph.inc.php | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/html/pages/device/apps/ceph.inc.php b/html/pages/device/apps/ceph.inc.php index bf7668afa..988d64803 100644 --- a/html/pages/device/apps/ceph.inc.php +++ b/html/pages/device/apps/ceph.inc.php @@ -36,7 +36,8 @@ foreach ($graphs as $key => $text) { echo ''; } } - } elseif ($key == "ceph_osdperf") { + } + elseif ($key == "ceph_osdperf") { foreach (glob($rrddir."/app-ceph-".$app['app_id']."-osd-*") as $rrd_filename) { if (preg_match("/.*-osd-(.+)\.rrd$/", $rrd_filename, $osds)) { $osd = $osds[1]; @@ -49,7 +50,8 @@ foreach ($graphs as $key => $text) { echo ''; } } - } elseif ($key == "ceph_df") { + } + elseif ($key == "ceph_df") { foreach (glob($rrddir."/app-ceph-".$app['app_id']."-df-*") as $rrd_filename) { if (preg_match("/.*-df-(.+)\.rrd$/", $rrd_filename, $pools)) { $pool = $pools[1]; @@ -61,7 +63,8 @@ foreach ($graphs as $key => $text) { echo ""; include 'includes/print-graphrow.inc.php'; echo ''; - } else { + } + else { echo '

'.$pool.' Usage

'; $graph_array['type'] = 'application_ceph_pool_df'; $graph_array['pool'] = $pool; diff --git a/includes/polling/applications/ceph.inc.php b/includes/polling/applications/ceph.inc.php index 711433843..08413c881 100644 --- a/includes/polling/applications/ceph.inc.php +++ b/includes/polling/applications/ceph.inc.php @@ -27,7 +27,8 @@ if (!empty($agent_data['app']['ceph'])) { print "Ceph Pool: $pool, IOPS: $ops, Wr bytes: $wrbytes, R bytes: $rbytes\n"; rrdtool_update($ceph_rrd, array("ops" => $ops, "wrbytes" => $wrbytes, "rbytes" => $rbytes)); } - } elseif ($section == "osdperformance") { + } + elseif ($section == "osdperformance") { foreach (explode("\n", $data) as $line) { if (empty($line)) continue; @@ -45,7 +46,8 @@ if (!empty($agent_data['app']['ceph'])) { print "Ceph OSD: $osd, Apply: $apply, Commit: $commit\n"; rrdtool_update($ceph_rrd, array("apply_ms" => $apply, "commit_ms" => $commit)); } - } elseif ($section == "df") { + } + elseif ($section == "df") { foreach (explode("\n", $data) as $line) { if (empty($line)) continue; From 669eb872a59426ceb660bfcfba838fee55603774 Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Tue, 10 Nov 2015 11:44:30 +0100 Subject: [PATCH 10/11] Implement a function to fix the rrd path --- .../graphs/application/ceph_common.inc.php | 17 +++++++++++++++++ .../application/ceph_osd_performance.inc.php | 6 +++--- .../graphs/application/ceph_pool_df.inc.php | 4 ++-- .../graphs/application/ceph_pool_io.inc.php | 6 +++--- .../graphs/application/ceph_pool_iops.inc.php | 5 ++--- .../application/ceph_pool_objects.inc.php | 5 ++--- 6 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 html/includes/graphs/application/ceph_common.inc.php diff --git a/html/includes/graphs/application/ceph_common.inc.php b/html/includes/graphs/application/ceph_common.inc.php new file mode 100644 index 000000000..8b996592f --- /dev/null +++ b/html/includes/graphs/application/ceph_common.inc.php @@ -0,0 +1,17 @@ + Date: Tue, 10 Nov 2015 12:33:52 +0100 Subject: [PATCH 11/11] Move the ceph_rrd function to includes/common.inc.php --- .../graphs/application/ceph_common.inc.php | 17 --------------- .../application/ceph_osd_performance.inc.php | 2 -- .../graphs/application/ceph_pool_df.inc.php | 2 -- .../graphs/application/ceph_pool_io.inc.php | 2 -- .../graphs/application/ceph_pool_iops.inc.php | 1 - .../application/ceph_pool_objects.inc.php | 1 - includes/common.php | 21 +++++++++++++++++++ 7 files changed, 21 insertions(+), 25 deletions(-) delete mode 100644 html/includes/graphs/application/ceph_common.inc.php diff --git a/html/includes/graphs/application/ceph_common.inc.php b/html/includes/graphs/application/ceph_common.inc.php deleted file mode 100644 index 8b996592f..000000000 --- a/html/includes/graphs/application/ceph_common.inc.php +++ /dev/null @@ -1,17 +0,0 @@ -