Include Capturing, Analysing, Recording instead of Function
parent
e4b4fae584
commit
1c538a4bf0
|
@ -3,6 +3,8 @@ if (!isset($_REQUEST['entity'])) {
|
||||||
Error("No entity pass to status request.");
|
Error("No entity pass to status request.");
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST['entity'] == 'navBar') {
|
if ($_REQUEST['entity'] == 'navBar') {
|
||||||
|
@ -33,7 +35,7 @@ $statusData = array(
|
||||||
'limit' => 1,
|
'limit' => 1,
|
||||||
'elements' => array(
|
'elements' => array(
|
||||||
'MonitorCount' => array( 'sql' => 'count(*)' ),
|
'MonitorCount' => array( 'sql' => 'count(*)' ),
|
||||||
'ActiveMonitorCount' => array( 'sql' => 'count(if(`Function` != \'None\',1,NULL))' ),
|
'ActiveMonitorCount' => array( 'sql' => 'count(if(`Capturing` != \'None\',1,NULL))' ),
|
||||||
'State' => array( 'func' => 'daemonCheck()?\''.translate('Running').'\':\''.translate('Stopped').'\'' ),
|
'State' => array( 'func' => 'daemonCheck()?\''.translate('Running').'\':\''.translate('Stopped').'\'' ),
|
||||||
'Load' => array( 'func' => 'getLoad()' ),
|
'Load' => array( 'func' => 'getLoad()' ),
|
||||||
'Disk' => array( 'func' => 'getDiskPercent()' ),
|
'Disk' => array( 'func' => 'getDiskPercent()' ),
|
||||||
|
@ -48,7 +50,9 @@ $statusData = array(
|
||||||
'Id' => array( 'sql' => 'Monitors.Id' ),
|
'Id' => array( 'sql' => 'Monitors.Id' ),
|
||||||
'Name' => array( 'sql' => 'Monitors.Name' ),
|
'Name' => array( 'sql' => 'Monitors.Name' ),
|
||||||
'Type' => true,
|
'Type' => true,
|
||||||
'Function' => true,
|
'Capturing' => true,
|
||||||
|
'Analysing' => true,
|
||||||
|
'Capturing' => true,
|
||||||
'Enabled' => true,
|
'Enabled' => true,
|
||||||
'LinkedMonitors' => true,
|
'LinkedMonitors' => true,
|
||||||
'Triggers' => true,
|
'Triggers' => true,
|
||||||
|
@ -228,8 +232,10 @@ function collectData() {
|
||||||
|
|
||||||
$entitySpec = &$statusData[strtolower(validJsStr($_REQUEST['entity']))];
|
$entitySpec = &$statusData[strtolower(validJsStr($_REQUEST['entity']))];
|
||||||
#print_r( $entitySpec );
|
#print_r( $entitySpec );
|
||||||
if ( !canView($entitySpec['permission']) )
|
if (!canView($entitySpec['permission'])) {
|
||||||
ajaxError('Unrecognised action or insufficient permissions');
|
ajaxError('Unrecognised action or insufficient permissions');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !empty($entitySpec['func']) ) {
|
if ( !empty($entitySpec['func']) ) {
|
||||||
$data = eval('return('.$entitySpec['func'].');');
|
$data = eval('return('.$entitySpec['func'].');');
|
||||||
|
|
Loading…
Reference in New Issue