";
}
function showPluginView($name)
{
//TODO
}
function updatePluginStat($name)
{
$xml = docmd("monls", "", array("$name"));
foreach($xml->children() as $response) foreach($response->children() as $data) {
$result = preg_split("/\s+/", $data);
if($result[0] == $name && $result[1] == "not-monitored") {
echo "Disabled";
}else {
echo "Enabled";
}
}
}
function showPluginDesc($name)
{
//TODO: many "return" keys are missed in the response.
//We have to figure them out
$xml = docmd("monls"," ", array("$name", "-d"));
if (getXmlErrors($xml, $errors)) {
echo "
monls failed: ", implode(' ',$errors), "
\n";
exit;
}
$information = "";
foreach ($xml->children() as $response) foreach ($response->children() as $data) {
$information .="
$data
";
}
echo $information;
}
/*
* changePluginStat($name)
* which is used to enable/disable the selected plugin,
* and which return whether they're sucessful or not
*/
function showPluginStat($name, $opt)
{
//display the nrtree here
//let the user choose node/noderange to enable/disable monitor plugin
echo "
";
echo "
";
echo <<
monPluginSetStat();
$('input').customInput();
TOS1;
if($opt == 'enable') {
//monadd: xcatmon has special options
//moncfg
//"moncfg rmcmon -r" is necessary for rmcmon
//monstart
echo "
The $name Plugin is in Disabled status
";
echo "
You can Press the Following button to change its status
";
echo "
Select the noderange from the right tree
";
echo "
OR: you can type the noderange in the following area
You can Press the Following button to change its status
";
echo "
Select the noderange from the right tree
";
echo "
OR: you can type the noderange in the following area
";
echo "
";
insertNRTextEntry();
echo "
When you are trying to enable the plugin
would you like to support node status monitoring?
";
insertRadioBtn();
insertButtonSet("Enable","Disable", 1);
}
echo "";
}
function insertRadioBtn()
{
//to provide the choose to support "-n"(node status monitoring)
echo <<
TOS21;
}
function insertNRTextEntry()
{
echo "";
}
function insertButtonSet($state1, $state2, $default)
{
echo "";
echo "