'; echo '

Tips:(Click me to display tips)

'; echo '
'; foreach ($tips as $tip) { echo "

$tip

"; echo "\n"; } echo "
"; echo ''; echo ''; return 0; } function insertDiv($id) { echo "
"; } function displayMonTable() { //create one table to display the monitoring plugins' list echo '
'; echo << Plug-in Name Status Node Status Monitoring Configure Action TOS1; echo << hoverOnMonlist(); TOS9; echo ''; displayMonitorLists(); echo "
"; return 0; } function displayStatus() { //tell the user that the current interface is not done yet... echo "

This interface is still under development -use accordingly.

"; } function displayOSITree() { //display the node range tree, but only with the nodes with OSI type //this follows the function showNrTreeInput(); echo "
"; echo << $(function() { nrtree = new tree_component(); // -Tree begin nrtree.init($("#nrtree-input"),{ rules: { multiple: "Ctrl" }, ui: { animation: 250 }, callback : { onchange : printtree }, data : { type : "json", async : "true", url: "noderangesource.php" } }); //Tree finish }); TOS3; echo "
"; } function displayAssociation() { //TODO: the return message of "webrun lscondresp" is changed //and, also, DataTables is used to draw the tabls echo '
'; echo << $("#association").dataTable({ "bLengthChange": false, "bFilter": true, "bSort": true }); TOS5; $xml = docmd("webrun", "", array("lscondresp")); if(getXmlErrors($xml,$errors)) { echo "

",implode(' ', $errors), "

"; exit; } //get all the condition&response associations for RMC foreach ($xml->children() as $response) foreach($response->children() as $data) { //get the data from xcatd $record = split('"',$data); echo ""; echo <<$record[1] TOS6; //TODO: insert the button here echo ""; echo ""; // $association = explode("=", $data); // // $ooe = 0; // $line = 0; // foreach($association as $elem) { // $ooe = $ooe%2; // //the format should be // //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" // $record = explode("\"", $elem); // $cond = $record[1]; // $resp = $record[3]; // $node = $record[5]; // $state = $record[7]; // echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // $ooe++; // $line++; // } } echo "
Condition Response Node State Action
$record[3] $record[5] $record[7]Button
$cond$resp$node$state"; // if($state == "Active") { // insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); // }else if($state == "Not active"){ // insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); // } // echo "
"; return 0; } function displayCond() { //display all the avaiable conditions to a element echo << Available Conditions
COND; $xml = docmd("webrun", '', array("lscondition")); foreach($xml->children() as $response) foreach($response->children() as $data) { /* * the data format like this * "HFI_not_configured" "ca4lpar02" "Not monitored" * "Drawer_not_configured" "ca4lpar02" "Not monitored" * "AnyNodeFileSystemSpaceUsed_H" "ca4lpar02" "Not monitored" */ $tmp = split('"', $data); //$tmp[1] = condition name //$tmp[3] = nodename //$tmp[5] = status echo << TOS99; } // $ooe = 0; // $line = 0; // foreach($conditions as $elem) { // $ooe = $ooe%2; // echo ""; // echo ""; // echo ""; // echo ""; // $ooe++; // $line++; // } echo "
Conditions
$tmp[1]
$elem
"; return 0; } function displayResp() { echo << Available Response RESP; $xml=docmd("webrun", '', array("lsresponse")); $ooe=0; $line=0; foreach($xml->children() as $response) foreach($response->children() as $data) { $record = split('"', $data); echo ""; echo << TOS7; echo ""; } // foreach($responses as $elem) { // $ooe = $ooe%2; // echo ""; // echo ""; // echo ""; // echo ""; // $ooe++; // $line++; // } echo '
Response
$record[1]
$elem
'; return 0; } function displayCondResp() { echo '
'; displayAssociation(); displayCond(); displayResp(); insertButtons(array('label'=>'Add', id=>'addAssociation', 'onclick'=>'mkCondResp()')); insertButtons(array('label'=>'Cancel', id=>'cancel_op', 'onclick'=>'clearEventDisplay()')); echo '
'; } function displayRMCRsrc() { echo <<Available RMC Resources TOS0; $xml = docmd("webrun", "", array("lsrsrc")); if(getXmlErrors($xml,$errors)) { echo "

",implode(' ', $errors), "

"; exit; } foreach($xml->children() as $response) foreach($response->children() as $data) { //get all the class name $classes = explode("=", $data); } $ooe = 0; $line = 0; foreach($classes as $class) { $ooe = $ooe%2; echo ""; echo ""; echo ""; echo ""; $ooe++; $line++; } echo "
Class Name
$class
"; return 0; } function displayRMCAttr() { echo "

Select the RMC Resource, you will see all its available attributes here.

"; } function RMCEventLogToTable() { $xml = docmd("webrun", "", array("lsevent")); //var_dump($xml); foreach($xml->children() as $response) foreach($response->children() as $records) { //$data should be one array to store all the RMC event log. echo ""; foreach($records->children() as $data) { echo "$data"; } echo ""; } } //displayRMCEventLog() to display the RMC event logs in one table with "tablesorter" class function displayRMCEvnetLog() { echo '
'; echo << Time Category Message TOS9; RMCEventLogToTable(); echo ""; //TODO: the following javascript doesn't work well. echo << $("#lsevent_tab").tablesorter({ sortList: [[0,1],[1,1]] }); TOS8; echo "
"; } function displayRMCMonshowAttr($attr, $nr) { //TODO: should add one argument to support the noderange argument echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($nr == "cluster") { //get all the data by the command "monshow" $xml = docmd("monshow", "", array("rmcmon", "-t", "60", "-a", "$attr")); //the error handling is skipped }elseif($nr == "summary") { $xml = docmd("monshow", "", array("rmcmon", "-s", "-t", "60", "-a", "$attr")); }else { $xml = docmd("monshow", "", array("rmcmon", "$nr", "-t", "60", "-a", "$attr")); } //the formats of the data are different based on $nr $index = 0; foreach($xml->children() as $response) foreach($response->children() as $data) { //handle the data here //skip the first 2 lines if($index++ < 2) { continue; } //then, parse "date" & "value" $arr = preg_split("/\s+/", $data); array_pop($arr); //print_r($arr); $val = array_pop($arr); $time = implode(" ", $arr); echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
Time$attr
$time$val
"; echo "
"; } function displayRMCMonshowGraph($value, $nr) { //display the RMC Performance Data $place = $nr.$value; echo << rmc_monshow_draw_by_flot("$place","$value");
TOS11; } /* * function displayOptionsForPlugin($plugin) * ***************************************** * when the user selects one plugin, the avaiable configuration options will display in
* TODO: for the non-rmcmon plugins, only the option "node/application status monitoring setting" is shown; * * the avaiable view options will also display in
, * TODO: right now, it's only implemented for rmcmon plugin. */ function displayOptionsForPlugin($name) { echo "
"; echo "

Available Configurations for $name

"; echo ''; echo ""; //set up the options for the plugin with the name "$name" if($name == "rmcmon") { //node status monitor, RMC events, RMC resources echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } else { //there's only "node status monitoring" is enabled echo ""; echo ""; echo ""; echo ""; } echo "
Node/Application Status Monitoring Setting"; insertButtons(array('label'=>'Configure', 'id'=>'rmc_nodestatmon', 'onclick'=>'loadMainPage("monitor/stat_mon.php?name=rmcmon")')); echo "
RMC Events Monitoring Setting"; insertButtons(array('label'=>'Configure', 'id'=>'rmc_event', 'onclick'=>'loadMainPage("monitor/rmc_event_define.php")')); echo "
RMC Resource Monitoring Setting"; insertButtons(array('label'=>'Configure', 'id'=>'rmc_resource', 'onclick'=>'loadMainPage("monitor/rmc_resource_define.php")')); echo "
Node/Application Status Monitoring Setting"; insertButtons(array('label'=>'Configure', 'id'=>$name."_nodestatmon", 'onclick'=>"loadMainPage(\"monitor/stat_mon.php?name=$name\")")); echo "
"; echo "
"; echo "
"; echo "

View Options for $name

"; //there should be many choices for the user to view the clusters' status echo << TOS1; if($name == "rmcmon") { #display two rows, one for RMC event, another for RMC Resource Performance monitoring. echo ""; echo "RMC Event Logs"; echo ""; insertButtons(array('label'=>'View in Text', 'id'=>'rmc_event_text', 'onclick'=>'loadMainPage("monitor/rmc_lsevent.php")')); echo ""; echo ""; echo ""; echo "RMC Resource Logs"; echo ""; insertButtons(array('label'=>'View By text/graphics', 'id'=>'rmc_resrc_text', 'onclick'=>'loadMainPage("monitor/rmc_monshow.php")')); echo ""; echo ""; } else { echo "

There's no view functions for $name.

"; } echo "
"; } /*displayMList() will display the list of monitor plugins * For the new style monitor list */ function displayMList() { $xml = docmd("monls", "", array('-a')); if(getXmlErrors($xml, $errors)) { echo "

", implode(' ', $errors), "

"; exit; } foreach($xml->children() as $response) foreach ($response->children() as $data) { list($name, $stat, $nodemon) = preg_split("/\s+/", $data); //create .pluginstat class for each plugin echo "
"; //TODO: I have to make it beautiful createPluginStatElem($name, $stat, $nodemon); echo "
"; echo ""; } return 0; } function createPluginStatElem($name, $stat, $nodemon) { if($nodemon) { echo "
"; echo "
$name
Enabled
"; }else { echo "
"; echo "
$name
Disabled
"; } echo "
"; } ?>