Fix if-then-else

This commit is contained in:
Mark Schouten
2015-11-10 11:44:14 +01:00
parent a4eb4391c5
commit 24550b0c02
2 changed files with 10 additions and 5 deletions
+6 -3
View File
@@ -36,7 +36,8 @@ foreach ($graphs as $key => $text) {
echo '</td></tr>';
}
}
} 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 '</td></tr>';
}
}
} 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 "<tr bgcolor='$row_colour'><td colspan=5>";
include 'includes/print-graphrow.inc.php';
echo '</td></tr>';
} else {
}
else {
echo '<h3>'.$pool.' Usage</h3>';
$graph_array['type'] = 'application_ceph_pool_df';
$graph_array['pool'] = $pool;
+4 -2
View File
@@ -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;