';
// 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[SECONDS_5MINUTES] = human_time_description_raw (SECONDS_5MINUTES);
$fields[SECONDS_10MINUTES] = human_time_description_raw (SECONDS_10MINUTES);
$fields[SECONDS_15MINUTES] = human_time_description_raw (SECONDS_15MINUTES);
$fields[SECONDS_30MINUTES] = human_time_description_raw (SECONDS_30MINUTES);
$fields[SECONDS_1HOUR] = human_time_description_raw (SECONDS_1HOUR);
$fields[SECONDS_2HOUR] = human_time_description_raw (SECONDS_2HOUR);
$fields[SECONDS_5HOUR] = human_time_description_raw (SECONDS_5HOUR);
$fields[SECONDS_12HOURS] = human_time_description_raw (SECONDS_12HOURS);
$fields[SECONDS_1DAY] = human_time_description_raw (SECONDS_1DAY);
$fields[SECONDS_1WEEK] = human_time_description_raw (SECONDS_1WEEK);
$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 "