';
// Description
echo ''.__('Description').' | ';
html_print_input_text ("description", $description, '', 60);
echo ' |
';
//echo '' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . ' |
';
// OID
echo ''.__('OID').' | ';
html_print_input_text ("oid", $oid, '', 50, 255);
echo ' |
';
// Custom
echo ''.__('Custom Value/OID');
echo ui_print_help_icon ("snmp_alert_custom", true);
echo ' | ';
html_print_textarea ("custom_value", $custom_value, 2, $custom_value, 'style="width:400px;"');
echo ' |
';
// SNMP Agent
echo ''.__('SNMP Agent').' (IP) | ';
html_print_input_text ("source_ip", $source_ip, '', 20);
echo ' |
';
// Trap type
echo ''.__('Trap type').' | ';
$trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm start (1)'), 2 => __('Link down (2)'), 3 => __('Link up (3)'), 4 => __('Authentication failure (4)'), 5 => __('Other'));
echo html_print_select ($trap_types, 'trap_type', $trap_type, '', '', '', false, false, false);
echo ' |
';
// Single value
echo ''.__('Single value').' | ';
html_print_input_text ("single_value", $single_value, '', 20);
echo ' |
';
// Custom OID/Data #1
echo ''.__('Custom OID/Data #1');
echo ui_print_help_icon ("field_match_snmp", true);
echo ' | ';
html_print_input_text ("custom_oid_data_1", $custom_oid_data_1, '', 60);
echo ' |
';
// Custom OID/Data #2
echo ''.__('Custom OID/Data #2');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo ' | ';
html_print_input_text ("custom_oid_data_2", $custom_oid_data_2, '', 60);
echo ' |
';
// Custom OID/Data #3
echo ''.__('Custom OID/Data #3');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo ' | ';
html_print_input_text ("custom_oid_data_3", $custom_oid_data_3, '', 60);
echo ' |
';
// Custom OID/Data #4
echo ''.__('Custom OID/Data #4');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo ' | ';
html_print_input_text ("custom_oid_data_4", $custom_oid_data_4, '', 60);
echo ' |
';
// Custom OID/Data #5
echo ''.__('Custom OID/Data #5');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo ' | ';
html_print_input_text ("custom_oid_data_5", $custom_oid_data_5, '', 60);
echo ' |
';
// Custom OID/Data #6
echo ''.__('Custom OID/Data #6');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo ' | ';
html_print_input_text ("custom_oid_data_6", $custom_oid_data_6, '', 60);
echo ' |
';
//Button
//echo ' | ';
// End table
//echo " |
";
// Alert configuration
//echo '';
// echo '' . __('Alert configuration') . ui_print_help_icon("snmp_alert_configuration", true) . ' |
';
// Alert fields
echo ''.__('Field #1 (Alias, name)');
echo ui_print_help_icon ("snmp_alert_field1", true);
echo ' | ';
html_print_input_text ("al_field1", $al_field1, '', 60);
echo ' |
';
echo ''.__('Field #2 (Single Line)').' | ';
html_print_input_text ("al_field2", $al_field2, '', 60);
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 ' |
';
// 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"];
}
switch ($config['dbtype']){
case "mysql":
case "postgresql":
html_print_select_from_sql ('SELECT id, name FROM talert_actions ORDER BY name',
"alert_type", $alert_type, '', '', 0, false, false, false);
break;
case "oracle":
html_print_select_from_sql ('SELECT id, dbms_lob.substr(name,4000,1) as name FROM talert_actions ORDER BY dbms_lob.substr(name,4000,1)',
"alert_type", $alert_type, '', '', 0, false, false, false);
break;
}
echo ' |
';
echo '
';
echo "