2009-07-28 09:55:54 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* This web page is for "Node status Monitoring" and "Application Status Monitioring",
|
|
|
|
* The user can enable/disable "Node/Application Status Monitoring" from this page.
|
|
|
|
*/
|
2009-09-01 20:25:18 +00:00
|
|
|
if(!isset($TOPDIR)) { $TOPDIR="..";}
|
2009-07-29 06:07:58 +00:00
|
|
|
|
|
|
|
require_once "$TOPDIR/lib/security.php";
|
|
|
|
require_once "$TOPDIR/lib/functions.php";
|
|
|
|
require_once "$TOPDIR/lib/display.php";
|
|
|
|
require_once "$TOPDIR/lib/monitor_display.php";
|
|
|
|
|
2009-07-29 11:30:44 +00:00
|
|
|
//get the name of the selected plug-in
|
|
|
|
$name = $_REQUEST['name'];
|
|
|
|
|
2009-09-01 20:25:18 +00:00
|
|
|
displayMapper(array('home'=>'main.php', 'monitor'=>''));
|
2009-07-29 11:30:44 +00:00
|
|
|
displayTips(array(
|
|
|
|
"Enable/disable Node/App Status Monitoring by clicking the button",
|
2009-08-18 03:11:36 +00:00
|
|
|
"In order to take affect, you have to START/RESTART the desired plugin"));
|
2009-07-29 11:30:44 +00:00
|
|
|
|
|
|
|
//get the current status for "node-status-monitor"
|
|
|
|
$xml = docmd("monls", ' ', array($name));
|
|
|
|
if(getXmlErrors($xml,$errors)) {
|
|
|
|
echo "<p class=Error>",implode(' ',$errors), "</p>";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
#then, parse the xml data
|
|
|
|
foreach($xml->children() as $response) foreach($response->children() as $data) {
|
|
|
|
list($n, $stat, $nodemonstatus) = preg_split("/\s+/",$data);
|
|
|
|
if(isset($nodemonstatus)) {
|
|
|
|
$ns = "Enabled";
|
|
|
|
}else {
|
|
|
|
$ns = "Disabled";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
display_stat_mon_table(array("$name"=>
|
|
|
|
array(
|
|
|
|
'nodestat'=>$ns,
|
|
|
|
'appstat'=>'Disabled', //currently application status monitoring is not supported by xCAT monitor Arch.
|
|
|
|
)));
|
2009-07-29 06:07:58 +00:00
|
|
|
|
|
|
|
displayStatus();
|
|
|
|
|
2009-08-18 03:11:36 +00:00
|
|
|
//insertButtons(array('label'=>'Next', id=>'next', 'onclick'=>'loadMainPage("monitor/monlist.php")'));
|
2009-07-28 09:55:54 +00:00
|
|
|
?>
|