getValues(); } } // Action Handlers if(isset($_GET['request'])) { if($_GET['request'] == "delete" && $_GET['section'] == 'general') { $serviceTemplate->delete(); $success = "Service template deleted."; header("Location: templates.php"); die(); } else if($_GET['request'] == "delete" && $_GET['section'] == 'inheritance') { $c = new Criteria(); $c->add(NagiosServiceTemplateInheritancePeer::SOURCE_TEMPLATE, $serviceTemplate->getId()); $c->addAscendingOrderByColumn(NagiosServiceTemplateInheritancePeer::ORDER); $inheritanceList = NagiosServiceTemplateInheritancePeer::doSelect($c); $found = false; for($counter = 0; $counter < count($inheritanceList); $counter++) { if($inheritanceList[$counter]->getNagiosServiceTemplateRelatedByTargetTemplate()->getId() == $_GET['template_id']) { // Omg, we found it! // Delete the inheritance $inheritanceList[$counter]->delete(); // Okay, regrab the list $newList = NagiosServiceTemplateInheritancePeer::doSelect($c); for($counter = 0; $counter < count($newList); $counter++) { // Reordering $newList[$counter]->setOrder($counter); $newList[$counter]->save(); } $success = "Removed template from inheritance list."; } } if(empty($error)) { $error = "Could not find that template specified."; } } else if($_GET['request'] == "movedown" && $_GET['section'] == "inheritance") { $c = new Criteria(); $c->add(NagiosServiceTemplateInheritancePeer::SOURCE_TEMPLATE, $serviceTemplate->getId()); $c->addAscendingOrderByColumn(NagiosServiceTemplateInheritancePeer::ORDER); $inheritanceList = NagiosServiceTemplateInheritancePeer::doSelect($c); $found = false; for($counter = 0; $counter < count($inheritanceList); $counter++) { if($inheritanceList[$counter]->getNagiosServiceTemplateRelatedByTargetTemplate()->getId() == $_GET['template_id']) { // Omg, we found it! if($counter == (count($inheritanceList) -1)) { // We're at the end of the array, we couldn't possibly move down more! $error = "Cannot move that template down any further."; break; } else { $tempTemplate = $inheritanceList[$counter + 1]; $inheritanceList[$counter]->setOrder($inheritanceList[$counter]->getOrder() + 1); $tempTemplate->setOrder($tempTemplate->getOrder() - 1); $inheritanceList[$counter]->save(); $tempTemplate->save(); $success = "Template moved down in inheritance chain."; $found = true; break; } } } if(empty($error)) { $error = "Could not find that template specified."; } } else if($_GET['request'] == "moveup" && $_GET['section'] == "inheritance") { $c = new Criteria(); $c->add(NagiosServiceTemplateInheritancePeer::SOURCE_TEMPLATE, $serviceTemplate->getId()); $c->addAscendingOrderByColumn(NagiosServiceTemplateInheritancePeer::ORDER); $inheritanceList = NagiosServiceTemplateInheritancePeer::doSelect($c); $found = false; for($counter = 0; $counter < count($inheritanceList); $counter++) { if($inheritanceList[$counter]->getNagiosServiceTemplateRelatedByTargetTemplate()->getId() == $_GET['template_id']) { // Omg, we found it! if($counter == 0) { // We're at the end of the array, we couldn't possibly move down more! $error = "Cannot move that template up any further."; break; } else { $tempTemplate = $inheritanceList[$counter - 1]; $inheritanceList[$counter]->setOrder($inheritanceList[$counter]->getOrder() - 1); $tempTemplate->setOrder($tempTemplate->getOrder() + 1); $inheritanceList[$counter]->save(); $tempTemplate->save(); $success = "Template moved up in inheritance chain."; $found = true; break; } } } if(empty($error)) { $error = "Could not find that template specified."; } } if($_GET['request'] == "delete" && $_GET['section'] == 'contacts') { if(!empty($_GET['contactgroup_id'])) { $c = new Criteria(); $c->add(NagiosServiceContactGroupMemberPeer::TEMPLATE, $_GET['id']); $c->add(NagiosServiceContactGroupMemberPeer::CONTACT_GROUP, $_GET['contactgroup_id']); $membership = NagiosServiceContactGroupMemberPeer::doSelectOne($c); if($membership) { $membership->delete(); $success = "Contact Group Deleted"; } } else if(!empty($_GET['contact_id'])) { $c = new Criteria(); $c->add(NagiosServiceContactMemberPeer::TEMPLATE, $_GET['id']); $c->add(NagiosServiceContactMemberPeer::CONTACT, $_GET['contact_id']); $membership = NagiosServiceContactMemberPeer::doSelectOne($c); if($membership) { $membership->delete(); $success = "Contact deleted."; } } } if($_GET['request'] == "delete" && $_GET['section'] == 'servicegroups') { // !!!!!!!!!!!!!! This is where we do dependency error checking $c = new Criteria(); $c->add(NagiosServiceGroupMemberPeer::TEMPLATE, $_GET['id']); $c->add(NagiosServiceGroupMemberPeer::SERVICE_GROUP, $_GET['servicegroup_id']); $membership = NagiosServiceGroupMemberPeer::doSelectOne($c); if($membership) { $membership->delete(); $success = "Service Group Deleted"; } } if($_GET['request'] == "delete" && $_GET['section'] == 'dependencies') { $dependency = NagiosDependencyPeer::retrieveByPK($_GET['dependency_id']); if($dependency) { $dependency->delete(); $success = "Dependency deleted."; } } if($_GET['request'] == "delete" && $_GET['section'] == 'escalations') { // !!!!!!!!!!!!!! This is where we do dependency error checking $lilac->delete_escalation($_GET['escalation_id']); $success = "Dependency Deleted"; unset($_SESSION['tempData']['$modifiedData']); unset($_GET['request']); } if($_GET['request'] == "delete" && $_GET['section'] == 'checkcommand') { $param = NagiosServiceCheckCommandParameterPeer::retrieveByPK($_GET['checkcommandparameter_id']); if($param) { $param->delete(); $success = "Check Command Parameter Deleted."; } } } if(isset($_POST['request'])) { $modifiedData = array(); if(isset($_POST['service_manage']) && count($_POST['service_manage'])) { foreach( $_POST['service_manage'] as $key=>$value) { if( is_array( $value)) { $modifiedData[$key] = $value; } else { $modifiedData[$key] = (string)$value; } } } if($_POST['request'] == 'service_template_modify_general') { if($modifiedData['template_name'] != $serviceTemplate->getName() && $lilac->service_template_exists($modifiedData['template_name'])) { $error = "A service template with that name already exists!"; } else { // Field Error Checking if(count($modifiedData)) { foreach($modifiedData as $tempVariable) $tempVariable = trim($tempVariable); } if($modifiedData['template_name'] == '' || $modifiedData['template_description'] == '') { $addError = 1; $error = "Incorrect values for fields. Please verify."; } // All is well for error checking, modify the template. else { $serviceTemplate->setName($modifiedData['template_name']); $serviceTemplate->setDescription($modifiedData['template_description']); $serviceTemplate->save(); unset($_GET['edit']); $success = "Service template modified."; } } } else if($_POST['request'] == "add_template_command") { if(!isset($_POST['servicemanage'])) { $error = "Must provide template to add to inheritance chain."; } else { $template = NagiosServiceTemplatePeer::retrieveByPK($_POST['servicemanage']['template_add']['template_id']); if(!$template) { $error = "That service template is not found."; } else { // We need to get the count of templates already inherited $templateList = $serviceTemplate->getNagiosServiceTemplateInheritances(); foreach($templateList as $tempTemplate) { if($tempTemplate->getId() == $_POST['servicemanage']['template_add']['template_id']) { $error = "That template already exists in the inheritance chain."; } } if(empty($error)) { $newInheritance = new NagiosServiceTemplateInheritance(); $newInheritance->setNagiosServiceTemplateRelatedBySourceTemplate($serviceTemplate); $newInheritance->setNagiosServiceTemplateRelatedByTargetTemplate($template); $newInheritance->setOrder(count($templateList)); try { $newInheritance->save(); $success = "Template added to inheritance chain."; } catch(Exception $e) { $error = $e->getMessage(); } } } } } else if($_POST['request'] == 'service_template_modify_checks') { if((isset($modifiedData['max_check_attempts']) && !is_numeric($modifiedData['max_check_attempts'])) || (isset($modifiedData['max_check_attempts']) && !($modifiedData['max_check_attempts'] >= 1)) || (isset($modifiedData['normal_check_interval']) && !is_numeric($modifiedData['normal_check_interval'])) || (isset($modifiedData['normal_check_interval']) && !($modifiedData['normal_check_interval'] >= 1)) || (isset($modifiedData['retry_interval']) && !is_numeric($modifiedData['retry_interval'])) || (isset($modifiedData['retry_interval']) && !($modifiedData['retry_interval'] >= 1)) || (isset($modifiedData['retry_interval']) && !is_numeric($modifiedData['retry_interval'])) || (isset($modifiedData['first_notification_delay']) && !is_numberic($modifiedData['first_notification_delay'])) || (isset($modifiedData['freshness_threshold']) && !($modifiedData['freshness_threshold'] >= 0))) { $addError = 1; $error = "Incorrect values for fields. Please verify."; } else { // Let's modify our host template if(isset($modifiedData['initial_state'])) { $serviceTemplate->setInitialState($modifiedData['initial_state']); } else { $serviceTemplate->setInitialState(null); } if(isset($modifiedData['is_volatile'])) { $serviceTemplate->setIsVolatile($modifiedData['is_volatile']); } else { $serviceTemplate->setIsVolatile(null); } if(isset($modifiedData['is_volatile'])) { $serviceTemplate->setIsVolatile($modifiedData['is_volatile']); } else { $serviceTemplate->setIsVolatile(null); } if(isset($modifiedData['check_command']) && $modifiedData['check_command'] != 0) { $serviceTemplate->setCheckCommand(NagiosCommandPeer::retrieveByPK($modifiedData['check_command'])->getId()); } else { $serviceTemplate->setCheckCommand(null); } if(isset($modifiedData['max_check_attempts'])) { $serviceTemplate->setMaximumCheckAttempts($modifiedData['max_check_attempts']); } else { $serviceTemplate->setMaximumCheckAttempts(null); } if(isset($modifiedData['normal_check_interval'])) { $serviceTemplate->setNormalCheckInterval($modifiedData['normal_check_interval']); } else { $serviceTemplate->setNormalCheckInterval(null); } if(isset($modifiedData['retry_interval'])) { $serviceTemplate->setRetryInterval($modifiedData['retry_interval']); } else { $serviceTemplate->setRetryInterval(null); } if(isset($modifiedData['first_notification_delay'])) { $serviceTemplate->setFirstNotificationDelay($modifiedData['first_notification_delay']); } else { $serviceTemplate->setFirstNotificationDelay(null); } if(isset($modifiedData['active_checks_enabled'])) { $serviceTemplate->setActiveChecksEnabled($modifiedData['active_checks_enabled']); } else { $serviceTemplate->setActiveChecksEnabled(null); } if(isset($modifiedData['passive_checks_enabled'])) { $serviceTemplate->setPassiveChecksEnabled($modifiedData['passive_checks_enabled']); } else { $serviceTemplate->setPassiveChecksEnabled(null); } if(isset($modifiedData['normal_check_interval'])) { $serviceTemplate->setNormalCheckInterval($modifiedData['normal_check_interval']); } else { $serviceTemplate->setNormalCheckInterval(null); } if(isset($modifiedData['check_period']) && $modifiedData['check_period'] != 0) { $serviceTemplate->setCheckPeriod(NagiosTimeperiodPeer::retrieveByPK($modifiedData['check_period'])->getId()); } else { $serviceTemplate->setCheckPeriod(null); } if(isset($modifiedData['parallelize_check'])) { $serviceTemplate->setParallelizeCheck($modifiedData['parallelize_check']); } else { $serviceTemplate->setParallelizeCheck(null); } if(isset($modifiedData['obsess_over_service'])) { $serviceTemplate->setObsessOverService($modifiedData['obsess_over_service']); } else { $serviceTemplate->setObsessOverService(null); } if(isset($modifiedData['check_freshness'])) { $serviceTemplate->setCheckFreshness($modifiedData['check_freshness']); } else { $serviceTemplate->setCheckFreshness(null); } if(isset($modifiedData['freshness_threshold'])) { $serviceTemplate->setFreshnessThreshold($modifiedData['freshness_threshold']); } else { $serviceTemplate->setFreshnessThreshold(null); } if(isset($modifiedData['event_handler_enabled'])) { $serviceTemplate->setEventHandlerEnabled($modifiedData['event_handler_enabled']); } else { $serviceTemplate->setEventHandlerEnabled(null); } if(isset($modifiedData['event_handler']) && $modifiedData['event_handler'] != 0) { $serviceTemplate->setEventHandler(NagiosCommandPeer::retrieveByPK($modifiedData['event_handler'])->getId()); } else { $serviceTemplate->setEventHandler(null); } if(isset($modifiedData['failure_prediction_enabled'])) { $serviceTemplate->setFailurePredictionEnabled($modifiedData['failure_prediction_enabled']); } else { $serviceTemplate->setFailurePredictionEnabled(null); } $serviceTemplate->save(); unset($_GET['edit']); $success = "Service template modified"; } } else if($_POST['request'] == 'service_template_modify_flapping') { // Field Error Checking if(count($modifiedData)) { foreach($modifiedData as $tempVariable) $tempVariable = trim($tempVariable); } if((isset($modifiedData['low_flap_threshold']) && $modifiedData['low_flap_threshold'] < 0) || (isset($modifiedData['high_flap_threshold']) && $modifiedData['high_flap_threshold'] < 0)) { $addError = 1; $error = "Incorrect values for fields. Please verify."; } // All is well for error checking, modify the command. else { // Modify flapping information if(isset($modifiedData['flap_detection_enabled'])) { $serviceTemplate->setFlapDetectionEnabled($modifiedData['flap_detection_enabled']); } else { $serviceTemplate->setFlapDetectionEnabled(null); } if(!isset($_POST['service_manage_checkboxes']) || !isset($_POST['service_manage_checkboxes']['flap_detection_options'])) { $serviceTemplate->setFlapDetectionOnOk(null); $serviceTemplate->setFlapDetectionOnUnknown(null); $serviceTemplate->setFlapDetectionOnWarning(null); $serviceTemplate->setFlapDetectionOnCritical(null); } else { if(isset($_POST['service_manage']['flap_detection_on_ok'])) { $serviceTemplate->setFlapDetectionOnOk(true); } else { $serviceTemplate->setFlapDetectionOnOk(false); } if(isset($_POST['service_manage']['flap_detection_on_unknown'])) { $serviceTemplate->setFlapDetectionOnUnknown(true); } else { $serviceTemplate->setFlapDetectionOnUnknown(false); } if(isset($_POST['service_manage']['flap_detection_on_warning'])) { $serviceTemplate->setFlapDetectionOnWarning(true); } else { $serviceTemplate->setFlapDetectionOnWarning(false); } if(isset($_POST['service_manage']['flap_detection_on_critical'])) { $serviceTemplate->setFlapDetectionOnCritical(true); } else { $serviceTemplate->setFlapDetectionOnCritical(false); } } if(isset($modifiedData['low_flap_threshold'])) { $serviceTemplate->setLowFlapThreshold($modifiedData['low_flap_threshold']); } else { $serviceTemplate->setLowFlapThreshold(null); } if(isset($modifiedData['high_flap_threshold'])) { $serviceTemplate->setHighFlapThreshold($modifiedData['high_flap_threshold']); } else { $serviceTemplate->setHighFlapThreshold(null); } $serviceTemplate->save(); unset($modifiedData); $success = "Service template modified."; unset($_GET['edit']); } } else if($_POST['request'] == 'service_template_modify_logging') { // Field Error Checking // None required for this process // All is well for error checking, modify the host template. if(isset($modifiedData['process_perf_data'])) { $serviceTemplate->setProcessPerfData($modifiedData['process_perf_data']); } else { $serviceTemplate->setProcessPerfData(null); } if(isset($modifiedData['retain_status_information'])) { $serviceTemplate->setRetainStatusInformation($modifiedData['retain_status_information']); } else { $serviceTemplate->setRetainStatusInformation(null); } if(isset($modifiedData['retain_nonstatus_information'])) { $serviceTemplate->setRetainNonstatusInformation($modifiedData['retain_nonstatus_information']); } else { $serviceTemplate->setRetainNonstatusInformation(null); } $serviceTemplate->save(); unset($modifiedData); $success = "Service template modified."; unset($_GET['edit']); } else if($_POST['request'] == 'service_template_modify_notifications') { // Field Error Checking if(count($modifiedData)) { foreach($modifiedData as $tempVariable) $tempVariable = trim($tempVariable); } if(isset($_POST['service_manage_enablers']['notification_interval']) && ($modifiedData['notification_interval'] == '' || $modifiedData['notification_interval'] < 0 || !is_numeric($modifiedData['notification_interval']))) { $error = "Incorrect values for fields. Please verify."; } // All is well for error checking, modify the command. else { if(!isset($_POST['service_manage_checkboxes']) || !isset($_POST['service_manage_checkboxes']['notification_options'])) { $serviceTemplate->setNotificationOnCritical(null); $serviceTemplate->setNotificationOnFlapping(null); $serviceTemplate->setNotificationOnRecovery(null); $serviceTemplate->setNotificationOnUnknown(null); $serviceTemplate->setNotificationOnWarning(null); $serviceTemplate->setNotificationOnScheduledDowntime(null); } else { if(isset($_POST['service_manage']['notification_on_critical'])) { $serviceTemplate->setNotificationOnCritical(true); } else { $serviceTemplate->setNotificationOnCritical(false); } if(isset($_POST['service_manage']['notification_on_flapping'])) { $serviceTemplate->setNotificationOnFlapping(true); } else { $serviceTemplate->setNotificationOnFlapping(false); } if(isset($_POST['service_manage']['notification_on_recovery'])) { $serviceTemplate->setNotificationOnRecovery(true); } else { $serviceTemplate->setNotificationOnRecovery(false); } if(isset($_POST['service_manage']['notification_on_unknown'])) { $serviceTemplate->setNotificationOnUnknown(true); } else { $serviceTemplate->setNotificationOnUnknown(false); } if(isset($_POST['service_manage']['notification_on_warning'])) { $serviceTemplate->setNotificationOnWarning(true); } else { $serviceTemplate->setNotificationOnWarning(false); } if(isset($_POST['service_manage']['notification_on_scheduled_downtime'])) { $serviceTemplate->setNotificationOnScheduledDowntime(true); } else { $serviceTemplate->setNotificationOnScheduledDowntime(false); } } if(!isset($_POST['service_manage_checkboxes']) || !isset($_POST['service_manage_checkboxes']['stalking_options'])) { $serviceTemplate->setStalkingOnOk(null); $serviceTemplate->setStalkingOnWarning(null); $serviceTemplate->setStalkingOnUnknown(null); $serviceTemplate->setStalkingOnCritical(null); } else { if(isset($_POST['service_manage']['stalking_on_ok'])) { $serviceTemplate->setStalkingOnOk(true); } else { $serviceTemplate->setStalkingOnOk(false); } if(isset($_POST['service_manage']['stalking_on_warning'])) { $serviceTemplate->setStalkingOnWarning(true); } else { $serviceTemplate->setStalkingOnWarning(false); } if(isset($_POST['service_manage']['stalking_on_unknown'])) { $serviceTemplate->setStalkingOnUnknown(true); } else { $serviceTemplate->setStalkingOnUnknown(false); } if(isset($_POST['service_manage']['stalking_on_critical'])) { $serviceTemplate->setStalkingOnCritical(true); } else { $serviceTemplate->setStalkingOnCritical(false); } } if(isset($modifiedData['notifications_enabled'])) { $serviceTemplate->setNotificationsEnabled($modifiedData['notifications_enabled']); } else { $serviceTemplate->setNotificationsEnabled(null); } if(isset($modifiedData['notification_interval'])) { $serviceTemplate->setNotificationInterval($modifiedData['notification_interval']); } else { $serviceTemplate->setNotificationInterval(null); } if(isset($modifiedData['notification_period'])) { $serviceTemplate->setNotificationPeriod(NagiosTimeperiodPeer::retrieveByPK($modifiedData['notification_period'])->getId()); } else { $serviceTemplate->setNotificationPeriod(null); } $serviceTemplate->save(); // Remove session data unset($modifiedData); $success = "Service template modified."; unset($_GET['edit']); } } if($_POST['request'] == 'update_service_extended') { // We properly got an serviceTemplate. if(isset($modifiedData['notes'])) { $serviceTemplate->setNotes($modifiedData['notes']); } else { $serviceTemplate->setNotes(null); } if(isset($modifiedData['notes_url'])) { $serviceTemplate->setNotesUrl($modifiedData['notes_url']); } else { $serviceTemplate->setNotesUrl(null); } if(isset($modifiedData['action_url'])) { $serviceTemplate->setActionUrl($modifiedData['action_url']); } else { $serviceTemplate->setActionUrl(null); } if(isset($modifiedData['icon_image'])) { $serviceTemplate->setIconImage($modifiedData['icon_image']); } else { $serviceTemplate->setIconImage(null); } if(isset($modifiedData['icon_image_alt'])) { $serviceTemplate->setIconImageAlt($modifiedData['icon_image_alt']); } else { $serviceTemplate->setIconImageAlt(null); } $serviceTemplate->save(); $success = "Updated Service Extended Information"; } else if($_POST['request'] == 'add_contact_command') { $c = new Criteria(); $c->add(NagiosServiceContactMemberPeer::TEMPLATE, $_GET['id']); $c->add(NagiosServiceContactMemberPeer::CONTACT, $_POST['service_manage']['contact_add']['contact_id']); $membership = NagiosServiceContactMemberPeer::doSelectOne($c); if($membership) { $error = "That contact already exists in that list!"; } else { $tempContact = NagiosContactPeer::retrieveByPk($_POST['service_manage']['contact_add']['contact_id']); if($tempContact) { $membership = new NagiosServiceContactMember(); $membership->setService($_GET['id']); $membership->setNagiosContact($tempContact); $membership->save(); $success = "New Service Template Contact Link added."; } else { $error = "That contact is not found."; } } } else if($_POST['request'] == 'add_contactgroup_command') { $c = new Criteria(); $c->add(NagiosServiceContactGroupMemberPeer::TEMPLATE, $_GET['id']); $c->add(NagiosServiceContactGroupMemberPeer::CONTACT_GROUP, $_POST['contactgroup_id']); $membership = NagiosServiceContactGroupMemberPeer::doSelectOne($c); if($membership) { $error = "That contact group already exists in that list!"; } else { $tempGroup = NagiosContactGroupPeer::retrieveByPk($_POST['contactgroup_id']); if($tempGroup) { $membership = new NagiosServiceContactGroupMember(); $membership->setTemplate($_GET['id']); $membership->setNagiosContactGroup($tempGroup); $membership->save(); $success = "New Service Contact Group Link added."; } } } else if($_POST['request'] == 'add_servicegroup_command') { $c = new Criteria(); $c->add(NagiosServiceGroupMemberPeer::TEMPLATE, $serviceTemplate->getId()); $c->add(NagiosServiceGroupMemberPeer::SERVICE_GROUP, $_POST['servicegroup_id']); $tempMembership = NagiosServiceGroupMemberPeer::doSelectOne($c); if($tempMembership) { $error = "That service group already exists in that list!"; } else { $membership = new NagiosServiceGroupMember(); $membership->setTemplate($serviceTemplate->getId()); $membership->setServiceGroup($_POST['servicegroup_id']); $membership->save(); $success = "New Service Group Link added."; } } else if($_POST['request'] == 'command_parameter_add') { if(trim($_POST['service_manage']['parameter']) == "") { $error = "Parameter cannot be blank."; } else { // All is well for error checking, modify the command. $param = new NagiosServiceCheckCommandParameter(); $param->setTemplate($serviceTemplate->getId()); $param->setParameter($_POST['service_manage']['parameter']); $param->save(); $success = "Command Parameter added."; } } } if(isset($_GET['id'])) { // Load template. $serviceTemplate = NagiosServiceTemplatePeer::retrieveByPK($_GET['id']); if(!$serviceTemplate) { header("Location: templates.php"); die(); } else { // GET VALUES $templateValues = $serviceTemplate->getValues(); } } // To create a "default" command $command_list[] = array("command_id" => 0, "command_name" => "None"); $lilac->return_command_list($tempList); foreach($tempList as $command) { $command_list[] = array("command_id" => $command->getId(), "command_name" => $command->getName()); } $period_list = array(); $lilac->return_period_list($tempList); foreach($tempList as $period) { $period_list[] = array("timeperiod_id" => $period->getId(), "timeperiod_name" => $period->getName()); } $volatile_list[] = array("value" => 0, "label" => "Not Volatile"); $volatile_list[] = array("value" => 1, "label" => "Volatile"); $initialState_list = array(); $initialState_list[] = array('value' => 'o', 'label' => 'Ok'); $initialState_list[] = array('value' => 'w', 'label' => 'Warning'); $initialState_list[] = array('value' => 'c', 'label' => 'Critical'); $initialState_list[] = array('value' => 'u', 'label' => 'Unknown'); // Build subnav $subnav = array( 'general' => 'General', 'inheritance' => 'Inheritance', 'checks' => 'Checks', 'flapping' => 'Flapping', 'logging' => 'Logging', 'notifications' => 'Notifications', 'servicegroups' => 'Group Membership', 'contacts' => 'Contacts', 'extended' => 'Extended Information', 'dependencies' => 'Dependencies', 'escalations' => 'Escalations' ); if(isset($tempServiceTemplateInfo['check_command']) || isset($templateValues['check_command'])) { $subnav['checkcommand'] = "Check Command Parameters"; } print_header("Service Template Editor"); print_window_header("Template Info for " . $serviceTemplate->getName(), "100%"); print_subnav($subnav, $_GET['section'], "section", $_SERVER['PHP_SELF'] . "?id=" . $_GET['id']); $service_template_icon_image = $path_config['image_root'] . "services.gif"; if($_GET['section'] == 'general') { ?>
|
return_command_list($check_command_list); ?> |
"flap_detection_on_ok", 'label' => "Ok"); $flap_detection_options_checkbox_group[] = array('field' => "flap_detection_on_warning", 'label' => "Warning"); $flap_detection_options_checkbox_group[] = array('field' => "flap_detection_on_unknown", 'label' => "Unknown"); $flap_detection_options_checkbox_group[] = array('field' => "flap_detection_on_critical", 'label' => "Critical"); ?> |
"notification_on_warning", 'label' => "Warning"); $notification_options_checkbox_group[] = array('field' => "notification_on_unknown", 'label' => "Unknown"); $notification_options_checkbox_group[] = array('field' => "notification_on_critical", 'label' => "Critical"); $notification_options_checkbox_group[] = array('field' => "notification_on_recovery", 'label' => "Recovery"); $notification_options_checkbox_group[] = array('field' => "notification_on_flapping", 'label' => "Flapping"); $notification_options_checkbox_group[] = array('field' => "notification_on_scheduled_downtime", 'label' => "Scheduled Downtime"); $stalking_options_checkbox_group[] = array('field' => "stalking_on_ok", 'label' => "Ok"); $stalking_options_checkbox_group[] = array('field' => "stalking_on_warning", 'label' => "Warning"); $stalking_options_checkbox_group[] = array('field' => "stalking_on_unknown", 'label' => "Unknown"); $stalking_options_checkbox_group[] = array('field' => "stalking_on_critical", 'label' => "Critical"); ?> |
|
Included in definition: \n"; print_display_field("Notes", $templateValues, "notes", $_GET['id']); print_display_field("Notes URL", $templateValues, "notes_url", $_GET['id']); print_display_field("Action URL", $templateValues, "action_url", $_GET['id']); print_display_field("Icon Image", $templateValues, "icon_image", $_GET['id']); print_display_field("Icon Image Alt Text", $templateValues, "icon_image_alt", $_GET['id']); ?> [ Edit ] |
|
|
|
[ Create A New Service Dependency For This Service Template ] |
[ Create A New Escalation For This Template ] |