';
// Alert type (e-mail, event etc.)
echo ''.__('Alert type').' | ';
$fields = array ();
$result = get_db_all_rows_in_table ("talert_templates", "name");
if ($result === false) {
$result = array ();
}
foreach ($result as $row) {
$fields[$row["id"]] = $row["name"];
}
print_select ($fields, "alert_type", $alert_type, '', '', '0', false, false, false);
echo ' |
';
// Alert trigger (OID, custom_value)
echo ''.__('Alert trigger').' | ';
$fields = array ();
$fields[0] = "OID";
$fields[1] = "Custom Value/OID";
$fields[2] = "SNMP Agent";
print_select ($fields, "alert_trigger", $alert_trigger);
echo ' |
';
// Description
echo ''.__('Description').' | ';
print_input_text ("description", $description, '', 60);
echo ' |
';
// OID
echo ''.__('OID').' | ';
print_input_text ("oid", $oid, '', 30);
echo ' |
';
// OID Custom
echo ''.__('Custom Value')."/".__("OID").' | ';
print_input_text ("custom_value", $custom_value, '', 30);
echo ' |
';
// SNMP Agent
echo ''.__('SNMP Agent').' (IP) | ';
print_input_text ("source_ip", $source_ip, '', 30);
echo ' |
';
// Alert fields
echo ''.__('Field #1 (Alias, name)').' | ';
print_input_text ("al_field1", $al_field1, '', 30);
echo ' |
';
echo ''.__('Field #2 (Single Line)').' | ';
print_input_text ("al_field2", $al_field2, '', 30);
echo ' |
';
echo ''.__('Field #3 (Full Text)').' | ';
print_textarea ("al_field3", $al_field3, 4, $al_field3, 'style="width:400px"');
echo ' |
';
// Max / Min alerts
echo ''.__('Min. number of alerts').' | ';
print_input_text ("min_alerts", $min_alerts, '', 3);
echo ' |
'.__('Max. number of alerts').' | ';
print_input_text ("max_alerts", $max_alerts, '', 3);
echo ' |
';
// Time Threshold
echo ''.__('Time threshold').' | ';
$fields = array ();
$fields[$time_threshold] = human_time_description ($time_threshold);
$fields[300] = human_time_description (300);
$fields[600] = human_time_description (600);
$fields[900] = human_time_description (900);
$fields[1800] = human_time_description (1800);
$fields[3600] = human_time_description (3600);
$fields[7200] = human_time_description (7200);
$fields[18000] = human_time_description (18000);
$fields[43200] = human_time_description (43200);
$fields[86400] = human_time_description (86400);
$fields[604800] = human_time_description (604800);
$fields[-1] = __('Other value');
print_select ($fields, "time_threshold", $time_threshold, '', '', '0', false, false, false, '" style="margin-right:60px');
echo ' ';
print_input_text ("time_other", 0, '', 6);
echo ' '.__('seconds').' |
';
// Priority
echo ''.__('Priority').' | ';
echo print_select (get_priorities (), "priority", $priority, '', '', '0', false, false, false);
echo ' |
';
//Button
echo ' | ';
if ($id_as > 0) {
print_submit_button (__('Update'), "submit", false, 'class="sub upd"', false);
} else {
print_submit_button (__('Create'), "submit", false, 'class="sub next"', false);
}
// End table
echo " |
";
} else {
echo "