Merge branch 'master' into calix

This commit is contained in:
Tony Murray
2016-02-08 14:20:14 -06:00
24 changed files with 242 additions and 48 deletions
+1 -1
View File
@@ -55,5 +55,5 @@ $response = array(
'html' => $output,
'title' => $title,
);
header('Content-type: application/json');
echo _json_encode($response);
+1
View File
@@ -29,6 +29,7 @@ if (!$_SESSION['authenticated']) {
if (preg_match('/^[a-zA-Z0-9\-]+$/', $_POST['type']) == 1) {
if (file_exists('includes/forms/'.$_POST['type'].'.inc.php')) {
header('Content-type: application/json');
include_once 'includes/forms/'.$_POST['type'].'.inc.php';
}
}
+1 -1
View File
@@ -62,7 +62,7 @@ function levsort($base, $obj) {
}
header('Content-type: application/json');
$obj = array(array('name' => 'Error: No suggestions found.'));
$term = array();
$current = false;
+1 -1
View File
@@ -19,7 +19,7 @@ $bgp = array();
if (isset($_REQUEST['search'])) {
$search = mres($_REQUEST['search']);
header('Content-type: application/json');
if (strlen($search) > 0) {
$found = 0;
+1
View File
@@ -36,6 +36,7 @@ $response = array();
if (isset($id)) {
if (file_exists("includes/table/$id.inc.php")) {
header('Content-type: application/json');
include_once "includes/table/$id.inc.php";
}
}
+2 -2
View File
@@ -30,10 +30,10 @@ echo '<tr>
<td>'.$device['sysName'].' </td>
</tr>';
if ($ip = inet6_ntop($device['ip'])) {
if (!empty($device['ip'])) {
echo '<tr>
<td>Resolved IP</td>
<td>'.$ip.'</td>
<td>'.$device['ip'].'</td>
</tr>';
}
+1 -1
View File
@@ -20,7 +20,7 @@ $alert_id = $_POST['alert_id'];
if (is_numeric($alert_id) && $alert_id > 0) {
$rule = dbFetchRow('SELECT * FROM `alert_rules` WHERE `id` = ? LIMIT 1', array($alert_id));
$rule_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@]+[&&\|\|]+)/', $rule['rule'], -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY));
$rule_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@\|]+[&&|\|\|]{2})/', $rule['rule'], -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY));
$count = (count($rule_split) - 1);
$rule_split[$count] = $rule_split[$count].' &&';
$output = array(
+4 -2
View File
@@ -17,9 +17,9 @@ foreach ($graphs as $key => $text) {
if ($key == "ceph_poolstats") {
foreach (glob($rrddir."/app-ceph-".$app['app_id']."-pool-*") as $rrd_filename) {
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $app['app_id'];
if (preg_match("/.*-pool-(.+)\.rrd$/", $rrd_filename, $pools)) {
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $app['app_id'];
$pool = $pools[1];
echo '<h3>'.$pool.' Reads/Writes</h3>';
$graph_array['type'] = 'application_ceph_pool_io';
@@ -29,6 +29,8 @@ foreach ($graphs as $key => $text) {
include 'includes/print-graphrow.inc.php';
echo '</td></tr>';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $app['app_id'];
echo '<h3>'.$pool.' IOPS</h3>';
$graph_array['type'] = 'application_ceph_pool_iops';
$graph_array['pool'] = $pool;
+2
View File
@@ -1,5 +1,7 @@
<?php
$no_refresh = true;
// FIXME - do this in a function and/or do it in graph-realtime.php
if (!isset($vars['interval'])) {
if ($device['os'] == 'linux') {