';
// Alert type (e-mail, event etc.)
echo ''.__('Alert action').' | ';
$fields = array ();
$result = db_get_all_rows_in_table ('talert_actions', "name");
if ($result === false) {
$result = array ();
}
foreach ($result as $row) {
$fields[$row["id"]] = $row["name"];
}
html_print_select_from_sql ('SELECT id, name FROM talert_actions ORDER BY name',
"alert_type", $alert_type, '', '', 0, false, false, false);
echo ' |
';
// Description
echo ''.__('Description').' | ';
html_print_input_text ("description", $description, '', 60);
echo ' |
';
// OID
echo ''.__('OID').' | ';
html_print_input_text ("oid", $oid, '', 30);
echo ' |
';
// OID Custom
echo ''.__('Custom Value')."/".__("OID").' | ';
html_print_input_text ("custom_value", $custom_value, '', 30);
echo ' |
';
// SNMP Agent
echo ''.__('SNMP Agent').' (IP) | ';
html_print_input_text ("source_ip", $source_ip, '', 30);
echo ' |
';
// Alert fields
echo ''.__('Field #1 (Alias, name)').' | ';
html_print_input_text ("al_field1", $al_field1, '', 30);
echo ' |
';
echo ''.__('Field #2 (Single Line)').' | ';
html_print_input_text ("al_field2", $al_field2, '', 30);
echo ' |
';
echo ''.__('Field #3 (Full Text)').' | ';
html_print_textarea ("al_field3", $al_field3, 4, $al_field3, 'style="width:400px"');
echo ' |
';
// Max / Min alerts
echo ''.__('Min. number of alerts').' | ';
html_print_input_text ("min_alerts", $min_alerts, '', 3);
echo ' |
'.__('Max. number of alerts').' | ';
html_print_input_text ("max_alerts", $max_alerts, '', 3);
echo ' |
';
// Time Threshold
echo ''.__('Time threshold').' | ';
$fields = array ();
$fields[$time_threshold] = human_time_description_raw ($time_threshold);
$fields[300] = human_time_description_raw (300);
$fields[600] = human_time_description_raw (600);
$fields[900] = human_time_description_raw (900);
$fields[1800] = human_time_description_raw (1800);
$fields[3600] = human_time_description_raw (3600);
$fields[7200] = human_time_description_raw (7200);
$fields[18000] = human_time_description_raw (18000);
$fields[43200] = human_time_description_raw (43200);
$fields[86400] = human_time_description_raw (86400);
$fields[604800] = human_time_description_raw (604800);
$fields[-1] = __('Other value');
html_print_select ($fields, "time_threshold", $time_threshold, '', '', '0', false, false, false, '" style="margin-right:60px');
echo ' ';
html_print_input_text ("time_other", 0, '', 6);
echo ' '.__('seconds').' |
';
// Priority
echo ''.__('Priority').' | ';
echo html_print_select (get_priorities (), "priority", $priority, '', '', '0', false, false, false);
echo ' |
';
//Button
echo ' | ';
if ($id_as > 0) {
html_print_submit_button (__('Update'), "submit", false, 'class="sub upd"', false);
} else {
html_print_submit_button (__('Create'), "submit", false, 'class="sub wand"', false);
}
// End table
echo " |
";
} else {
require_once ('include/functions_alerts.php');
//Overview
$result = db_get_all_rows_in_table ("talert_snmp");
if ($result === false) {
$result = array ();
echo "