",implode(' ', $errors), "
"; exit; } foreach($xml->children() as $response) foreach($response->children() as $data) { $nodemonstat = $data; } switch($action) { case "stop": monstop($name, $nmstat); break; case "restart": monrestart($name, $nmstat); break; case "start": monstart($name, $nmstat); break; default: break; } function monstop($plugin, $nmstat) { $xml = docmd("monstop", "", array("$plugin","-r")); return 0; } function monrestart($plugin, $nmstat) { $xml = docmd("monstop", "", array("$plugin", "-r")); if(getXmlErrors($xml, $errors)) { echo "",implode(' ', $errors), "
"; exit; } $xml = docmd("moncfg", "", array("$plugin", "-r")); if(getXmlErrors($xml, $errors)) { echo "",implode(' ', $errors), "
"; exit; } $xml = docmd("monstart", "", array("$plugin", "-r")); return 0; } function monstart($plugin, $nmstat) { //TODO:before starting the $plugin, //we have to make sure that the plugin is added in the "monitoring" table $xml = docmd("monstart", "", array("$plugin", "-r")); return 0; } ?>