Merge branch 'ent-7914-escalado-de-estados-en-base-al-tiempo' into 'develop'

Ent 7914 escalado de estados en base al tiempo

See merge request artica/pandorafms!5206
This commit is contained in:
Daniel Rodriguez 2022-11-04 11:40:15 +00:00
commit df4235e002
13 changed files with 216 additions and 112 deletions

View File

@ -11,6 +11,13 @@ ALTER TABLE `tmodule_inventory` ADD COLUMN `script_path` VARCHAR(1000) DEFAULT '
ALTER TABLE `tevent_filter` ADD COLUMN `search_recursive_groups` INT NOT NULL DEFAULT 0;
ALTER TABLE `tagente_modulo` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `tnetwork_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `tlocal_component` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `tpolicy_modules` ADD COLUMN `warning_time` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `tagente_estado` ADD COLUMN `warning_count` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `tcredential_store` MODIFY COLUMN `product` ENUM('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP', 'WMI', 'SNMP') DEFAULT 'CUSTOM';
COMMIT;

View File

@ -1479,6 +1479,7 @@ if ($update_module || $create_module) {
$each_ff = (int) get_parameter('each_ff', $module['each_ff']);
$ff_timeout = (int) get_parameter('ff_timeout');
$unit = (string) get_parameter('unit');
$warning_time = (float) get_parameter('warning_time');
if ($unit === '0') {
$unit = '';
}
@ -1660,6 +1661,7 @@ if ($update_module) {
'id_category' => $id_category,
'disabled_types_event' => addslashes($disabled_types_event),
'module_macros' => $module_macros,
'warning_time' => $warning_time,
];
@ -1868,6 +1870,7 @@ if ($create_module) {
'id_category' => $id_category,
'disabled_types_event' => addslashes($disabled_types_event),
'module_macros' => $module_macros,
'warning_time' => $warning_time,
];
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {

View File

@ -322,6 +322,7 @@ if ($id_agent_module) {
$ff_type = $module['ff_type'];
$each_ff = $module['each_ff'];
$ff_timeout = $module['ff_timeout'];
$warning_time = $module['warning_time'];
// Select tag info.
$id_tag = tags_get_module_tags($id_agent_module);
@ -452,6 +453,7 @@ if ($id_agent_module) {
$max_critical = 0;
$str_critical = '';
$ff_event = 0;
$warning_time = 0;
// New support for snmp v3.
$snmp_version = 1;

View File

@ -467,14 +467,29 @@ if (modules_is_string_type($id_module_type) === false) {
$table_simple->data[2][1] .= '</div>';
}
$table_simple->data[3][0] .= '<span id="warning_time">'.__('Change to critical status after');
$table_simple->data[3][1] .= html_print_input_text(
'warning_time',
$warning_time,
'',
5,
255,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$table_simple->data[3][1] .= '&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>';
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[2][2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
}
$table_simple->data[3][0] = __('Critical threshold');
$table_simple->data[4][0] = __('Critical threshold');
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[3][1] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
$table_simple->data[3][1] .= html_print_input_text(
$table_simple->data[4][1] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
$table_simple->data[4][1] .= html_print_input_text(
'min_critical',
$min_critical,
'',
@ -486,8 +501,8 @@ if (!modules_is_string_type($id_module_type) || $edit) {
'',
$classdisabledBecauseInPolicy
);
$table_simple->data[3][1] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[3][1] .= html_print_input_text(
$table_simple->data[4][1] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[4][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
@ -502,8 +517,8 @@ if (!modules_is_string_type($id_module_type) || $edit) {
}
if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[3][1] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
$table_simple->data[3][1] .= html_print_input_text(
$table_simple->data[4][1] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
$table_simple->data[4][1] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
@ -517,33 +532,33 @@ if (modules_is_string_type($id_module_type) || $edit) {
).'</span>';
}
$table_simple->data[3][1] .= '<div id="critical_inverse"><em>'.__('Inverse interval').'</em>';
$table_simple->data[3][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy);
$table_simple->data[3][1] .= '</div>';
$table_simple->data[4][1] .= '<div id="critical_inverse"><em>'.__('Inverse interval').'</em>';
$table_simple->data[4][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy);
$table_simple->data[4][1] .= '</div>';
if (modules_is_string_type($id_module_type) === false) {
$table_simple->data[3][1] .= '<div id="percentage_critical" /><em>'.__('Percentage').'</em>';
$table_simple->data[3][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$table_simple->data[3][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true, $disabledBecauseInPolicy);
$table_simple->data[3][1] .= '</div>';
$table_simple->data[4][1] .= '<div id="percentage_critical" /><em>'.__('Percentage').'</em>';
$table_simple->data[4][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$table_simple->data[4][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true, $disabledBecauseInPolicy);
$table_simple->data[4][1] .= '</div>';
}
$table_simple->data[4][0] = __('Historical data');
$table_simple->data[5][0] = __('Historical data');
if ($disabledBecauseInPolicy) {
// If is disabled, we send a hidden in his place and print a false
// checkbox because HTML dont send disabled fields
// and could be disabled by error.
$table_simple->data[4][1] = html_print_checkbox(
$table_simple->data[5][1] = html_print_checkbox(
'history_data_fake',
1,
$history_data,
true,
$disabledBecauseInPolicy
);
$table_simple->data[4][1] .= '<input type="hidden" name="history_data" value="'.(int) $history_data.'">';
$table_simple->data[5][1] .= '<input type="hidden" name="history_data" value="'.(int) $history_data.'">';
} else {
$table_simple->data[4][1] = html_print_checkbox(
$table_simple->data[5][1] = html_print_checkbox(
'history_data',
1,
$history_data,

View File

@ -116,6 +116,7 @@ $max_critical = (float) get_parameter('max_critical');
$str_critical = (string) get_parameter('str_critical');
$ff_event = (int) get_parameter('ff_event');
$history_data = (bool) get_parameter('history_data');
$warning_time = (int) get_parameter('warning_time');
// Don't read as (float) because it lost it's decimals when put into MySQL
// where are very big and PHP uses scientific notation, p.e:
@ -407,6 +408,7 @@ if ($is_management_allowed === true && $create_component) {
'name_oid' => $name_oid,
'module_enabled' => $module_enabled,
'enabled' => $enabled,
'warning_time' => $warning_time,
]
);
} else {
@ -511,6 +513,7 @@ if ($is_management_allowed === true && $update_component) {
'name_oid' => $name_oid,
'module_enabled' => $module_enabled,
'enabled' => $enabled,
'warning_time' => $warning_time,
]
);
} else {

View File

@ -101,6 +101,7 @@ if ($create_network_from_module) {
$ff_event_critical = $data_module['min_ff_event_critical'];
$ff_type = $data_module['ff_type'];
$each_ff = $data_module['each_ff'];
$warning_time = $data_module['warning_time'];
}
$id_component_type = (int) get_parameter('id_component_type');
@ -175,6 +176,7 @@ if (isset($id)) {
$query_filter = $component['query_filters'];
$module_enabled = $component['module_enabled'];
$enabled = $component['enabled'];
$warning_time = $component['warning_time'];
if ($type >= MODULE_TYPE_REMOTE_SNMP && $type <= MODULE_TYPE_REMOTE_SNMP_PROC) {
// New support for snmp v3.
@ -246,6 +248,7 @@ if (isset($id)) {
$ff_event_critical = 0;
$ff_type = 0;
$each_ff = 0;
$warning_time = 0;
$snmp_version = 1;
$snmp3_auth_user = '';

View File

@ -198,13 +198,24 @@ $table->data[4][1] .= ui_print_help_tip('Defines threshold as a percentage of va
$table->data[4][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true);
$table->data[4][1] .= '</div>';
$table->data[5][0] .= '<span id="warning_time">'.__('Change to critical status after');
$table->data[5][1] .= html_print_input_text(
'warning_time',
$warning_time,
'',
5,
15,
true
);
$table->data[5][1] .= '&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>';
$table->data[4][2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
$table->colspan[4][2] = 2;
$table->rowspan[4][2] = 3;
$table->data[5][0] = __('Critical status');
$table->data[5][1] = '<span id="minmax_critical"><em>'.__('Min.').'&nbsp;</em>&nbsp;';
$table->data[5][1] .= html_print_input_text(
$table->data[6][0] = __('Critical status');
$table->data[6][1] = '<span id="minmax_critical"><em>'.__('Min.').'&nbsp;</em>&nbsp;';
$table->data[6][1] .= html_print_input_text(
'min_critical',
$min_critical,
'',
@ -212,8 +223,8 @@ $table->data[5][1] .= html_print_input_text(
15,
true
);
$table->data[5][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;';
$table->data[5][1] .= html_print_input_text(
$table->data[6][1] .= '<br /><em>'.__('Max.').'</em>&nbsp;';
$table->data[6][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
@ -221,8 +232,8 @@ $table->data[5][1] .= html_print_input_text(
15,
true
).'</span>';
$table->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').' </em>&nbsp;';
$table->data[5][1] .= html_print_input_text(
$table->data[6][1] .= '<span id="string_critical"><em>'.__('Str.').' </em>&nbsp;';
$table->data[6][1] .= html_print_input_text(
'str_critical',
$str_critical,
'',
@ -230,28 +241,28 @@ $table->data[5][1] .= html_print_input_text(
1024,
true
).'</span>';
$table->data[5][1] .= '<div id="critical_inverse"><em>'.__('Inverse interval').'</em>';
$table->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true);
$table->data[5][1] .= '</div>';
$table->data[6][1] .= '<div id="critical_inverse"><em>'.__('Inverse interval').'</em>';
$table->data[6][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true);
$table->data[6][1] .= '</div>';
$table->data[5][1] .= '<div id="percentage_critical"><em>'.__('Percentage').'</em>';
$table->data[5][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$table->data[5][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true);
$table->data[5][1] .= '</div>';
$table->data[6][1] .= '<div id="percentage_critical"><em>'.__('Percentage').'</em>';
$table->data[6][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true);
$table->data[6][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true);
$table->data[6][1] .= '</div>';
$table->data[6][0] = __('FF threshold');
$table->colspan[6][1] = 3;
$table->data[7][0] = __('FF threshold');
$table->colspan[7][1] = 3;
$table->data[6][1] = __('Keep counters');
$table->data[6][1] .= html_print_checkbox(
$table->data[7][1] = __('Keep counters');
$table->data[7][1] .= html_print_checkbox(
'ff_type',
1,
$ff_type,
true
).'<br />';
$table->data[6][1] .= html_print_radio_button(
$table->data[7][1] .= html_print_radio_button(
'each_ff',
0,
'',
@ -259,7 +270,7 @@ $table->data[6][1] .= html_print_radio_button(
true
).' '.__('All state changing').' : ';
$table->data[6][1] .= html_print_input_text(
$table->data[7][1] .= html_print_input_text(
'ff_event',
$ff_event,
'',
@ -267,15 +278,15 @@ $table->data[6][1] .= html_print_input_text(
15,
true
).'<br />';
$table->data[6][1] .= html_print_radio_button(
$table->data[7][1] .= html_print_radio_button(
'each_ff',
1,
'',
$each_ff,
true
).' '.__('Each state changing').' : ';
$table->data[6][1] .= __('To normal');
$table->data[6][1] .= html_print_input_text(
$table->data[7][1] .= __('To normal');
$table->data[7][1] .= html_print_input_text(
'ff_event_normal',
$ff_event_normal,
'',
@ -283,8 +294,8 @@ $table->data[6][1] .= html_print_input_text(
15,
true
).' ';
$table->data[6][1] .= __('To warning');
$table->data[6][1] .= html_print_input_text(
$table->data[7][1] .= __('To warning');
$table->data[7][1] .= html_print_input_text(
'ff_event_warning',
$ff_event_warning,
'',
@ -292,8 +303,8 @@ $table->data[6][1] .= html_print_input_text(
15,
true
).' ';
$table->data[6][1] .= __('To critical');
$table->data[6][1] .= html_print_input_text(
$table->data[7][1] .= __('To critical');
$table->data[7][1] .= html_print_input_text(
'ff_event_critical',
$ff_event_critical,
'',
@ -302,41 +313,41 @@ $table->data[6][1] .= html_print_input_text(
true
);
$table->data[7][0] = __('Historical data');
$table->data[7][1] = html_print_checkbox('history_data', 1, $history_data, true);
$table->data[8][0] = __('Historical data');
$table->data[8][1] = html_print_checkbox('history_data', 1, $history_data, true);
$table->data[8][0] = __('Min. Value');
$table->data[8][1] = html_print_input_text('min', $min, '', 5, 15, true).' '.ui_print_help_tip(__('Any value below this number is discarted'), true);
$table->data[8][2] = __('Max. Value');
$table->data[8][3] = html_print_input_text('max', $max, '', 5, 15, true).' '.ui_print_help_tip(__('Any value over this number is discarted'), true);
$table->data[9][0] = __('Unit');
$table->data[9][1] = html_print_input_text('unit', $unit, '', 12, 25, true);
$table->data[9][0] = __('Min. Value');
$table->data[9][1] = html_print_input_text('min', $min, '', 5, 15, true).' '.ui_print_help_tip(__('Any value below this number is discarted'), true);
$table->data[9][2] = __('Max. Value');
$table->data[9][3] = html_print_input_text('max', $max, '', 5, 15, true).' '.ui_print_help_tip(__('Any value over this number is discarted'), true);
$table->data[10][0] = __('Unit');
$table->data[10][1] = html_print_input_text('unit', $unit, '', 12, 25, true);
$table->data[9][2] = __('Discard unknown events');
$table->data[9][3] = html_print_checkbox(
$table->data[10][2] = __('Discard unknown events');
$table->data[10][3] = html_print_checkbox(
'throw_unknown_events',
1,
network_components_is_disable_type_event($id, EVENTS_GOING_UNKNOWN),
true
);
$table->data[10][0] = __('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true);
$table->data[10][1] = html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true);
$table->colspan[10][1] = 3;
$table->data[11][0] = __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true);
$table->data[11][1] = html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true);
$table->data[11][0] = __('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true);
$table->data[11][1] = html_print_textarea('critical_instructions', 2, 65, $critical_instructions, '', true);
$table->colspan[11][1] = 3;
$table->data[12][0] = __('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true);
$table->data[12][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table->data[12][0] = __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true);
$table->data[12][1] = html_print_textarea('warning_instructions', 2, 65, $warning_instructions, '', true);
$table->colspan[12][1] = 3;
$table->data[13][0] = __('Description');
$table->data[13][1] = html_print_textarea('description', 2, 65, $description, '', true);
$table->data[13][0] = __('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true);
$table->data[13][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table->colspan[13][1] = 3;
$next_row = 14;
$table->data[14][0] = __('Description');
$table->data[14][1] = html_print_textarea('description', 2, 65, $description, '', true);
$table->colspan[14][1] = 3;
$next_row = 15;
if (check_acl($config['id_user'], 0, 'PM')) {
$table->data[$next_row][0] = __('Category');

View File

@ -408,6 +408,12 @@ $table->rowspan['warning-svg-row'][2] = 3;
push_table_row($data, 'warning-svg-row');
$data = [];
$data[0] .= __('Change to critical status after');
$data[1] .= html_print_input_text('warning_time', $warning_time, '', 5, 15, true);
$data[1] .= '&nbsp;&nbsp;<b>'.__('intervals in warning status.').'</b>';
push_table_row($data, 'title-warning-time');
$data = [];
$data[0] = __('Critical');
// Critical interval values.

View File

@ -170,6 +170,11 @@ function configure_modules_form() {
data["dynamic_min"] == 0 ? 0 : data["dynamic_min"]
);
$("#text-warning_time").attr(
"value",
data["warning_time"] == 0 ? 0 : data["warning_time"]
);
if (data["dynamic_two_tailed"])
$("#checkbox-dynamic_two_tailed").check();
else $("#checkbox-dynamic_two_tailed").uncheck();
@ -461,6 +466,11 @@ function configure_modules_form() {
$("#post_process_default").hide();
}
$("#text-warning_time").attr(
"value",
data["warning_time"] == 0 ? 0 : data["warning_time"]
);
$("#text-post_process_text").attr(
"value",
data["post_process"] == 0 ? 0 : data["post_process"]

View File

@ -676,8 +676,9 @@ $trapcount = (int) db_get_value_sql($sql_count, false, true);
// Re-sort traps by timestamp if history db is enabled.
if ($config['history_db_enabled'] == 1) {
usort($traps, function($a, $b)
{
usort(
$traps,
function ($a, $b) {
return strtotime($a['timestamp']) < strtotime($b['timestamp']);
}
);

View File

@ -172,6 +172,7 @@ CREATE TABLE IF NOT EXISTS `tagente_estado` (
`last_dynamic_update` BIGINT NOT NULL DEFAULT 0,
`last_unknown_update` BIGINT NOT NULL DEFAULT 0,
`last_status_change` BIGINT NOT NULL DEFAULT 0,
`warning_count` INT UNSIGNED DEFAULT 0,
PRIMARY KEY (`id_agente_estado`),
KEY `status_index_1` (`id_agente_modulo`),
KEY `idx_agente` (`id_agente`),
@ -271,6 +272,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`debug_content` TEXT,
`percentage_critical` TINYINT UNSIGNED DEFAULT 0,
`percentage_warning` TINYINT UNSIGNED DEFAULT 0,
`warning_time` INT UNSIGNED DEFAULT 0,
PRIMARY KEY (`id_agente_modulo`),
KEY `main_idx` (`id_agente_modulo`,`id_agente`),
KEY `tam_agente` (`id_agente`),
@ -1002,6 +1004,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` (
`enabled` TINYINT UNSIGNED DEFAULT 1,
`percentage_critical` TINYINT UNSIGNED DEFAULT 0,
`percentage_warning` TINYINT UNSIGNED DEFAULT 0,
`warning_time` INT UNSIGNED DEFAULT 0,
PRIMARY KEY (`id_nc`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@ -2421,6 +2424,7 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` (
`prediction_threshold` INT DEFAULT 0,
`percentage_critical` TINYINT UNSIGNED DEFAULT 0,
`percentage_warning` TINYINT UNSIGNED DEFAULT 0,
`warning_time` INT UNSIGNED DEFAULT 0,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_network_component_group`) REFERENCES tnetwork_component_group(`id_sg`)
ON DELETE CASCADE ON UPDATE CASCADE
@ -2503,6 +2507,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` (
`cps` INT NOT NULL DEFAULT 0,
`percentage_warning` TINYINT UNSIGNED DEFAULT 0,
`percentage_critical` TINYINT UNSIGNED DEFAULT 0,
`warning_time` INT UNSIGNED DEFAULT 0,
PRIMARY KEY (`id`),
KEY `main_idx` (`id_policy`),
UNIQUE (`id_policy`, `name`)

View File

@ -1216,48 +1216,48 @@ INSERT INTO `tpolicies` VALUES (4,'Basic&#x20;AIX&#x20;Local&#x20;Monitoring','B
INSERT INTO `tpolicies` VALUES (5,'Basic&#x20;HP-UX&#x20;Local&#x20;Monitoring','Basic&#x20;local&#x20;checks&#x20;to&#x20;monitoring&#x20;HP/UX&#x20;systems.',2,0,0,0);
INSERT INTO `tpolicies` VALUES (6,'Basic&#x20;Remote&#x20;Checks','Basic&#x20;Remote&#x20;Checks&#x20;&#40;ping,&#x20;latency,&#x20;ports&#41;.',9,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;Get-NetAdapterStatistics&#x20;|Measure-Object&#x20;-Sum&#x20;ReceivedBytes&#x20;|Select&#x20;-ExpandProperty&#x20;Sum&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;Get-NetAdapterStatistics&#x20;|Measure-Object&#x20;-Sum&#x20;SentBytes&#x20;|Select&#x20;-ExpandProperty&#x20;Sum&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_cpuusage&#x20;all&#x0a;module_unit&#x20;%&#x0a;module_min_warning&#x20;79.00&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'CPU&#x20;usage&#x20;&#40;%&#41;','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;tasklist&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;gawk&#x20;&quot;{print&#x20;$1}&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;&#40;&#40;get-date&#41;&#x20;-&#x20;&#40;gcim&#x20;Win32_OperatingSystem&#41;.LastBootUpTime&#x20;|&#x20;Select&#x20;-ExpandProperty&#x20;Ticks&#41;&#x20;/&#x20;100000&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin&#x0a;module_name&#x20;WMI&#x20;Service&#x0a;module_type&#x20;generic_proc&#x0a;module_service&#x20;winmgmt&#x0a;module_end&#x0a;&#x0a;',2,'WMI&#x20;Service&#x20;enabled','WMI&#x20;Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (7,2,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;awk&#x20;&#039;!/lo:/&#x20;{s+=$2}END{print&#x20;s}&#039;&#x20;/proc/net/dev&#x0a;module_min_warning&#x20;0&#x0a;module_max_warning&#x20;0&#x0a;module_min_critical&#x20;0&#x0a;module_max_critical&#x20;0&#x0a;module_end&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (8,2,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;awk&#x20;&#039;!/lo:/&#x20;{s+=$10}END{print&#x20;s}&#039;&#x20;/proc/net/dev&#x0a;module_min_warning&#x20;0&#x0a;module_max_warning&#x20;0&#x0a;module_min_critical&#x20;0&#x0a;module_max_critical&#x20;0&#x0a;module_end&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (9,2,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$13&#x20;+&#x20;$14&#x20;}&#039;&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;&#x0a;',1,'Current&#x20;use&#x20;of&#x20;CPU&#x20;&#40;System&#x20;+&#x20;User&#41;.','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (10,2,'module_begin&#x0a;module_name&#x20;I/O&#x20;Lock&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$16}&#039;&#x0a;module_description&#x20;I/O&#x20;Wait&#x20;Disk&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','I/O&#x20;Lock','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (11,2,'module_begin&#x20;&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;cat&#x20;/proc/loadavg&#x20;|awk&#x20;&#039;{print&#x20;$2}&#039;&#x0a;module_end&#x0a;&#x0a;',1,'Average&#x20;process&#x20;in&#x20;CPU&#x20;&#40;Last&#x20;5&#x20;minutes&#41;.','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (12,2,'module_begin&#x0a;module_name&#x20;Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;echo&#x20;&gt;&#x20;/dev/tcp/127.0.0.1/22&#x20;&gt;/dev/null&#x20;2&gt;&amp;1&#x20;&amp;&amp;&#x20;echo&#x20;1&#x20;||&#x20;echo&#x20;0&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',2,'Checks&#x20;if&#x20;port&#x20;22&#x20;&#40;SSH&#41;&#x20;is&#x20;listening.','Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (13,2,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;ps&#x20;ax&#x20;|&#x20;tail&#x20;-n&#x20;+2&#x20;|&#x20;wc&#x20;-l&#x0a;module_description&#x20;Total&#x20;processes&#x0a;module_end',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (14,2,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;awk&#x20;&#039;{print&#x20;$1*100}&#039;&#x20;/proc/uptime&#x0a;module_end&#x0a;',1,'Host&#x20;Up&#x20;time&#x20;&#40;Timeticks&#41;','Uptime','_timeticks_',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (15,3,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;1&#x20;|&#x20;tail&#x20;-1|&#x20;awk&#x20;&#039;{print&#x20;&#40;100-$NF&#41;}&#039;&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;',1,'CPU&#x20;usage&#x20;%','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (16,3,'module_begin&#x0d;&#x0a;module_name&#x20;Disk&#x20;/&#x20;usage&#x20;&#40;%&#41;&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-k&#x20;/&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;tr&#x20;-d&#x20;&quot;%&quot;&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$5}&#039;&#x0d;&#x0a;module_end&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;',1,'Disk&#x20;use&#x20;percentage&#x20;for&#x20;root&#x20;partition&#x20;&#40;/&#41;','Disk&#x20;/&#x20;usage&#x20;&#40;%&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (17,3,'module_begin&#x0d;&#x0a;module_name&#x20;Disk&#x20;/var&#x20;usage&#x20;&#40;%&#41;&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-k&#x20;/var&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;tr&#x20;-d&#x20;&quot;%&quot;&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$5}&#039;&#x0d;&#x0a;module_end&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;',1,'Disk&#x20;use&#x20;percentage&#x20;for&#x20;var&#x20;partition&#x20;&#40;/var&#41;','Disk&#x20;/var&#x20;usage&#x20;&#40;%&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (18,3,'module_begin&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;uptime&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-2&#41;}&#039;&#x20;|&#x20;tr&#x20;-d&#x20;&#039;,&#039;&#x0a;module_end&#x0a;',1,'Load&#x20;average','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (19,3,'module_begin&#x0a;module_name&#x20;Memory&#x20;Free&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_freepercentmemory&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'Percentage&#x20;Mem&#x20;Free','Memory&#x20;Free&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,8.00,15.00,'',0.00,7.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (20,3,'module_begin&#x0a;module_name&#x20;Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;timeout&#x20;1&#x20;bash&#x20;-c&#x20;&quot;echo&#x20;&gt;&#x20;/dev/tcp/127.0.0.1/22&quot;&#x20;&gt;/dev/null&#x20;2&gt;&amp;1&#x20;&amp;&amp;&#x20;echo&#x20;1&#x20;||&#x20;echo&#x20;0&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;',2,'Checks&#x20;if&#x20;port&#x20;22&#x20;&#40;SSH&#41;&#x20;is&#x20;listening.','Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (21,3,'module_begin&#x0a;module_name&#x20;Swap&#x20;Used&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;swap&#x20;-l&#x20;|tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;100&#x20;-&#x20;&#40;$NF&#x20;/&#x20;$&#40;NF-1&#41;&#x20;*&#x20;100&#41;}&#039;&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'Swap&#x20;memory&#x20;available&#x20;in&#x20;%','Swap&#x20;Used&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (22,3,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;ps&#x20;-A&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$1}&#039;&#x0a;module_end',1,'Total&#x20;processes','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (23,3,'module_beg&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;perl&#x20;-e&#x20;&quot;print&#x20;100*&#40;time&#x20;-&#x20;$&#40;kstat&#x20;-p&#x20;unix:0:system_misc:boot_time&#x20;|awk&#x20;&#039;{print&#x20;$2}&#039;&#41;&#41;&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'Host&#x20;Up&#x20;time&#x20;&#40;Timeticks&#41;','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (24,4,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;sar&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;100&#x20;-&#x20;$5}&#039;&#x0a;module_description&#x20;CPU&#x20;usage&#x20;in&#x20;%&#x0a;module_unit&#x20;%&#x0a;module_end',1,'','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (25,4,'module_begin&#x0a;module_name&#x20;CPU&#x20;User&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;sar&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$2}&#039;&#x0a;module_description&#x20;CPU&#x20;usage&#x20;in&#x20;%&#x0a;module_unit&#x20;%&#x0a;module_end',1,'','CPU&#x20;User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (26,4,'module_begin&#x20;&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;uptime&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-2&#41;*1}&#039;&#x20;&#x0a;module_description&#x20;Average&#x20;process&#x20;in&#x20;CPU&#x20;&#40;Last&#x20;minute&#41;&#x20;&#x0a;module_end',1,'','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (27,4,'module_begin&#x0a;module_name&#x20;Memory&#x20;Free&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;svmon&#x20;-G|grep&#x20;memory&#x20;|&#x20;awk&#x20;&#039;{print&#x20;&#40;1-&#x20;$3/$2&#x20;&#41;*100}&#039;&#x0a;module_description&#x20;Percentage&#x20;Mem&#x20;Free&#x0a;module_end&#x0a;',1,'','Memory&#x20;Free&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (28,4,'module_begin&#x0a;module_name&#x20;Pagination&#x20;use&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;&#x20;lsps&#x20;-s&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$2+0}&#039;&#x0a;module_end',1,'','Pagination&#x20;use','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (29,4,'module_begin&#x0a;module_name&#x20;Service&#x20;sshd&#x20;status&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;lssrc&#x20;-a&#x20;|&#x20;grep&#x20;ssh&#x20;|&#x20;grep&#x20;active&#x0a;module_end',2,'','Service&#x20;sshd&#x20;status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (30,4,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data_string&#x0a;module_exec&#x20;uptime&#x20;|sed&#x20;&quot;s/us&#92;.*$//g&quot;&#x20;|&#x20;sed&#x20;&quot;s/,&#92;.*$//g&quot;&#x0a;module_description&#x20;Host&#x20;Up&#x20;time&#x0a;module_end&#x0a;',1,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (31,5,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_cpuusage&#x20;all&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;',1,'','CPU&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (32,5,'module_begin&#x0a;module_name&#x20;CPU&#x20;User&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;2&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$&#40;16&#41;&#x20;}&#039;&#x0a;module_description&#x20;%&#x20;of&#x20;User&#x20;CPU&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;&#x0a;',1,'','CPU&#x20;User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (33,5,'module_begin&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;uptime&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-2&#41;}&#039;&#x20;|&#x20;tr&#x20;-d&#x20;&#039;,&#039;&#x0a;module_description&#x20;System&#x20;load&#x20;average&#x0a;module_end&#x0a;',1,'','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (34,5,'module_begin&#x0a;module_name&#x20;Memory&#x20;Free&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;echo&#x20;&quot;&quot;&#x20;&gt;&#x20;/tmp/hpvm_toptest;&#x20;top&#x20;-d&#x20;1&#x20;-f&#x20;/tmp/hpvm_toptest&#x20;2&gt;/dev/null&#x20;1&gt;/dev/null;&#x20;cat&#x20;/tmp/hpvm_toptest&#x20;|&#x20;grep&#x20;-i&#x20;Memory&#x20;|&#x20;head&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$8/&#40;$2+$5&#41;&#x20;*&#x20;100}&#039;&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','Memory&#x20;Free&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (35,5,'module_begin&#x0a;module_name&#x20;&#x20;Service&#x20;sshd&#x20;status&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;ps&#x20;-ef&#x20;|&#x20;grep&#x20;&#x20;-v&#x20;grep&#x20;|&#x20;grep&#x20;&quot;/opt/ssh/sbin/sshd&quot;&#x20;|&#x20;wc&#x20;-l&#x0a;module_description&#x20;SSH&#x20;running&#x0a;module_end&#x0a;&#x0a;',2,'','Service&#x20;sshd&#x20;status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (36,5,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;echo&#x20;$&#40;&#40;&#40;`ps&#x20;-e&#x20;|&#x20;wc&#x20;-l`&#41;-1&#41;&#41;&#x20;|&#x20;tr&#x20;-d&#x20;&ldquo;&#92;n&rdquo;&#x0a;module_description&#x20;Total&#x20;processes&#x0a;module_end&#x0a;&#x0a;',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (37,5,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data_string&#x0a;module_exec&#x20;uptime&#x20;|sed&#x20;s/us&#92;.*$//g&#x20;|&#x20;sed&#x20;s/,&#92;.*$//g&#x0a;module_description&#x20;Host&#x20;Up&#x20;time&#x0a;module_end&#x0a;',3,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (38,5,'module_begin&#x0a;module_name&#x20;Zombie&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;ps&#x20;-&shy;elf&#x20;|&#x20;awk&#x20;&#039;$2~/&#039;Z&#039;/{print&#x20;$2}&#039;&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;tr&#x20;-d&#x20;&quot;&#92;n&quot;&#x0a;module_description&#x20;Zombie&#x20;processes&#x0a;module_end&#x0a;',1,'','Zombie&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (39,6,'',6,'','Host&#x20;Alive','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (40,6,'',7,'','Host&#x20;Latency','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,80.00,149.00,'',150.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (41,6,'',2,'Checks&#x20;if&#x20;port&#x20;161&#x20;is&#x20;open&#x20;and&#x20;reachable&#x20;for&#x20;Pandora&#x20;FMS&#x20;server.','SNMP&#x20;Available','',0,0,300,'',0,'','','','',1,1,4,0,0,'','','_field1_;Target&#x20;IP;;_address_--_field2_;Port;;161',3,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"_address_\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\"}}','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (42,6,'',9,'Checks&#x20;if&#x20;port&#x20;22&#x20;is&#x20;open&#x20;and&#x20;reachable&#x20;for&#x20;Pandora&#x20;FMS&#x20;server.','SSH&#x20;Reachable','',0,0,300,'',22,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;Get-NetAdapterStatistics&#x20;|Measure-Object&#x20;-Sum&#x20;ReceivedBytes&#x20;|Select&#x20;-ExpandProperty&#x20;Sum&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;Get-NetAdapterStatistics&#x20;|Measure-Object&#x20;-Sum&#x20;SentBytes&#x20;|Select&#x20;-ExpandProperty&#x20;Sum&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_cpuusage&#x20;all&#x0a;module_unit&#x20;%&#x0a;module_min_warning&#x20;79.00&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'CPU&#x20;usage&#x20;&#40;%&#41;','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;tasklist&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;gawk&#x20;&quot;{print&#x20;$1}&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;powershell&#x20;-c&#x20;&quot;&#40;&#40;get-date&#41;&#x20;-&#x20;&#40;gcim&#x20;Win32_OperatingSystem&#41;.LastBootUpTime&#x20;|&#x20;Select&#x20;-ExpandProperty&#x20;Ticks&#41;&#x20;/&#x20;100000&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin&#x0a;module_name&#x20;WMI&#x20;Service&#x0a;module_type&#x20;generic_proc&#x0a;module_service&#x20;winmgmt&#x0a;module_end&#x0a;&#x0a;',2,'WMI&#x20;Service&#x20;enabled','WMI&#x20;Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (7,2,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;awk&#x20;&#039;!/lo:/&#x20;{s+=$2}END{print&#x20;s}&#039;&#x20;/proc/net/dev&#x0a;module_min_warning&#x20;0&#x0a;module_max_warning&#x20;0&#x0a;module_min_critical&#x20;0&#x0a;module_max_critical&#x20;0&#x0a;module_end&#x0a;&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Received&#41;','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (8,2,'module_begin&#x0a;module_name&#x20;Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;&#x0a;module_type&#x20;generic_data_inc&#x0a;module_exec&#x20;awk&#x20;&#039;!/lo:/&#x20;{s+=$10}END{print&#x20;s}&#039;&#x20;/proc/net/dev&#x0a;module_min_warning&#x20;0&#x0a;module_max_warning&#x20;0&#x0a;module_min_critical&#x20;0&#x0a;module_max_critical&#x20;0&#x0a;module_end&#x0a;',4,'','Bytes&#x20;per&#x20;second&#x20;&#40;Sent&#41;','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (9,2,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$13&#x20;+&#x20;$14&#x20;}&#039;&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;&#x0a;',1,'Current&#x20;use&#x20;of&#x20;CPU&#x20;&#40;System&#x20;+&#x20;User&#41;.','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (10,2,'module_begin&#x0a;module_name&#x20;I/O&#x20;Lock&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$16}&#039;&#x0a;module_description&#x20;I/O&#x20;Wait&#x20;Disk&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','I/O&#x20;Lock','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (11,2,'module_begin&#x20;&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;cat&#x20;/proc/loadavg&#x20;|awk&#x20;&#039;{print&#x20;$2}&#039;&#x0a;module_end&#x0a;&#x0a;',1,'Average&#x20;process&#x20;in&#x20;CPU&#x20;&#40;Last&#x20;5&#x20;minutes&#41;.','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (12,2,'module_begin&#x0a;module_name&#x20;Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;echo&#x20;&gt;&#x20;/dev/tcp/127.0.0.1/22&#x20;&gt;/dev/null&#x20;2&gt;&amp;1&#x20;&amp;&amp;&#x20;echo&#x20;1&#x20;||&#x20;echo&#x20;0&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',2,'Checks&#x20;if&#x20;port&#x20;22&#x20;&#40;SSH&#41;&#x20;is&#x20;listening.','Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (13,2,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;ps&#x20;ax&#x20;|&#x20;tail&#x20;-n&#x20;+2&#x20;|&#x20;wc&#x20;-l&#x0a;module_description&#x20;Total&#x20;processes&#x0a;module_end',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (14,2,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;awk&#x20;&#039;{print&#x20;$1*100}&#039;&#x20;/proc/uptime&#x0a;module_end&#x0a;',1,'Host&#x20;Up&#x20;time&#x20;&#40;Timeticks&#41;','Uptime','_timeticks_',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (15,3,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;1&#x20;|&#x20;tail&#x20;-1|&#x20;awk&#x20;&#039;{print&#x20;&#40;100-$NF&#41;}&#039;&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;',1,'CPU&#x20;usage&#x20;%','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (16,3,'module_begin&#x0d;&#x0a;module_name&#x20;Disk&#x20;/&#x20;usage&#x20;&#40;%&#41;&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-k&#x20;/&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;tr&#x20;-d&#x20;&quot;%&quot;&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$5}&#039;&#x0d;&#x0a;module_end&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;',1,'Disk&#x20;use&#x20;percentage&#x20;for&#x20;root&#x20;partition&#x20;&#40;/&#41;','Disk&#x20;/&#x20;usage&#x20;&#40;%&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (17,3,'module_begin&#x0d;&#x0a;module_name&#x20;Disk&#x20;/var&#x20;usage&#x20;&#40;%&#41;&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-k&#x20;/var&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;tr&#x20;-d&#x20;&quot;%&quot;&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$5}&#039;&#x0d;&#x0a;module_end&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;&#x0d;&#x0a;',1,'Disk&#x20;use&#x20;percentage&#x20;for&#x20;var&#x20;partition&#x20;&#40;/var&#41;','Disk&#x20;/var&#x20;usage&#x20;&#40;%&#41;','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (18,3,'module_begin&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;uptime&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-2&#41;}&#039;&#x20;|&#x20;tr&#x20;-d&#x20;&#039;,&#039;&#x0a;module_end&#x0a;',1,'Load&#x20;average','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (19,3,'module_begin&#x0a;module_name&#x20;Memory&#x20;Free&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_freepercentmemory&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'Percentage&#x20;Mem&#x20;Free','Memory&#x20;Free&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,8.00,15.00,'',0.00,7.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (20,3,'module_begin&#x0a;module_name&#x20;Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;timeout&#x20;1&#x20;bash&#x20;-c&#x20;&quot;echo&#x20;&gt;&#x20;/dev/tcp/127.0.0.1/22&quot;&#x20;&gt;/dev/null&#x20;2&gt;&amp;1&#x20;&amp;&amp;&#x20;echo&#x20;1&#x20;||&#x20;echo&#x20;0&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;',2,'Checks&#x20;if&#x20;port&#x20;22&#x20;&#40;SSH&#41;&#x20;is&#x20;listening.','Port&#x20;22&#x20;Open&#x20;&#40;SSH&#41;','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (21,3,'module_begin&#x0a;module_name&#x20;Swap&#x20;Used&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;swap&#x20;-l&#x20;|tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;100&#x20;-&#x20;&#40;$NF&#x20;/&#x20;$&#40;NF-1&#41;&#x20;*&#x20;100&#41;}&#039;&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'Swap&#x20;memory&#x20;available&#x20;in&#x20;%','Swap&#x20;Used&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (22,3,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;ps&#x20;-A&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$1}&#039;&#x0a;module_end',1,'Total&#x20;processes','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (23,3,'module_beg&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;perl&#x20;-e&#x20;&quot;print&#x20;100*&#40;time&#x20;-&#x20;$&#40;kstat&#x20;-p&#x20;unix:0:system_misc:boot_time&#x20;|awk&#x20;&#039;{print&#x20;$2}&#039;&#41;&#41;&quot;&#x0a;module_end&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;&#x0a;',1,'Host&#x20;Up&#x20;time&#x20;&#40;Timeticks&#41;','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (24,4,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;sar&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;100&#x20;-&#x20;$5}&#039;&#x0a;module_description&#x20;CPU&#x20;usage&#x20;in&#x20;%&#x0a;module_unit&#x20;%&#x0a;module_end',1,'','CPU&#x20;%','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (25,4,'module_begin&#x0a;module_name&#x20;CPU&#x20;User&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;sar&#x20;1&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$2}&#039;&#x0a;module_description&#x20;CPU&#x20;usage&#x20;in&#x20;%&#x0a;module_unit&#x20;%&#x0a;module_end',1,'','CPU&#x20;User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (26,4,'module_begin&#x20;&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;uptime&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-2&#41;*1}&#039;&#x20;&#x0a;module_description&#x20;Average&#x20;process&#x20;in&#x20;CPU&#x20;&#40;Last&#x20;minute&#41;&#x20;&#x0a;module_end',1,'','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (27,4,'module_begin&#x0a;module_name&#x20;Memory&#x20;Free&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;svmon&#x20;-G|grep&#x20;memory&#x20;|&#x20;awk&#x20;&#039;{print&#x20;&#40;1-&#x20;$3/$2&#x20;&#41;*100}&#039;&#x0a;module_description&#x20;Percentage&#x20;Mem&#x20;Free&#x0a;module_end&#x0a;',1,'','Memory&#x20;Free&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (28,4,'module_begin&#x0a;module_name&#x20;Pagination&#x20;use&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;&#x20;lsps&#x20;-s&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$2+0}&#039;&#x0a;module_end',1,'','Pagination&#x20;use','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (29,4,'module_begin&#x0a;module_name&#x20;Service&#x20;sshd&#x20;status&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;lssrc&#x20;-a&#x20;|&#x20;grep&#x20;ssh&#x20;|&#x20;grep&#x20;active&#x0a;module_end',2,'','Service&#x20;sshd&#x20;status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (30,4,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data_string&#x0a;module_exec&#x20;uptime&#x20;|sed&#x20;&quot;s/us&#92;.*$//g&quot;&#x20;|&#x20;sed&#x20;&quot;s/,&#92;.*$//g&quot;&#x0a;module_description&#x20;Host&#x20;Up&#x20;time&#x0a;module_end&#x0a;',1,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (31,5,'module_begin&#x0a;module_name&#x20;CPU&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_cpuusage&#x20;all&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;',1,'','CPU&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (32,5,'module_begin&#x0a;module_name&#x20;CPU&#x20;User&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;vmstat&#x20;1&#x20;2&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$&#40;16&#41;&#x20;}&#039;&#x0a;module_description&#x20;%&#x20;of&#x20;User&#x20;CPU&#x0a;module_unit&#x20;%&#x0a;module_end&#x0a;&#x0a;',1,'','CPU&#x20;User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (33,5,'module_begin&#x0a;module_name&#x20;Load&#x20;Average&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;uptime&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-2&#41;}&#039;&#x20;|&#x20;tr&#x20;-d&#x20;&#039;,&#039;&#x0a;module_description&#x20;System&#x20;load&#x20;average&#x0a;module_end&#x0a;',1,'','Load&#x20;Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (34,5,'module_begin&#x0a;module_name&#x20;Memory&#x20;Free&#x20;%&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;echo&#x20;&quot;&quot;&#x20;&gt;&#x20;/tmp/hpvm_toptest;&#x20;top&#x20;-d&#x20;1&#x20;-f&#x20;/tmp/hpvm_toptest&#x20;2&gt;/dev/null&#x20;1&gt;/dev/null;&#x20;cat&#x20;/tmp/hpvm_toptest&#x20;|&#x20;grep&#x20;-i&#x20;Memory&#x20;|&#x20;head&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$8/&#40;$2+$5&#41;&#x20;*&#x20;100}&#039;&#x0a;module_end&#x0a;&#x0a;&#x0a;',1,'','Memory&#x20;Free&#x20;%','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (35,5,'module_begin&#x0a;module_name&#x20;&#x20;Service&#x20;sshd&#x20;status&#x0a;module_type&#x20;generic_proc&#x0a;module_exec&#x20;ps&#x20;-ef&#x20;|&#x20;grep&#x20;&#x20;-v&#x20;grep&#x20;|&#x20;grep&#x20;&quot;/opt/ssh/sbin/sshd&quot;&#x20;|&#x20;wc&#x20;-l&#x0a;module_description&#x20;SSH&#x20;running&#x0a;module_end&#x0a;&#x0a;',2,'','Service&#x20;sshd&#x20;status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (36,5,'module_begin&#x0a;module_name&#x20;Total&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;echo&#x20;$&#40;&#40;&#40;`ps&#x20;-e&#x20;|&#x20;wc&#x20;-l`&#41;-1&#41;&#41;&#x20;|&#x20;tr&#x20;-d&#x20;&ldquo;&#92;n&rdquo;&#x0a;module_description&#x20;Total&#x20;processes&#x0a;module_end&#x0a;&#x0a;',1,'','Total&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (37,5,'module_begin&#x0a;module_name&#x20;Uptime&#x0a;module_type&#x20;generic_data_string&#x0a;module_exec&#x20;uptime&#x20;|sed&#x20;s/us&#92;.*$//g&#x20;|&#x20;sed&#x20;s/,&#92;.*$//g&#x0a;module_description&#x20;Host&#x20;Up&#x20;time&#x0a;module_end&#x0a;',3,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (38,5,'module_begin&#x0a;module_name&#x20;Zombie&#x20;processes&#x0a;module_type&#x20;generic_data&#x0a;module_exec&#x20;ps&#x20;-&shy;elf&#x20;|&#x20;awk&#x20;&#039;$2~/&#039;Z&#039;/{print&#x20;$2}&#039;&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;tr&#x20;-d&#x20;&quot;&#92;n&quot;&#x0a;module_description&#x20;Zombie&#x20;processes&#x0a;module_end&#x0a;',1,'','Zombie&#x20;processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (39,6,'',6,'','Host&#x20;Alive','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (40,6,'',7,'','Host&#x20;Latency','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,80.00,149.00,'',150.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (41,6,'',2,'Checks&#x20;if&#x20;port&#x20;161&#x20;is&#x20;open&#x20;and&#x20;reachable&#x20;for&#x20;Pandora&#x20;FMS&#x20;server.','SNMP&#x20;Available','',0,0,300,'',0,'','','','',1,1,4,0,0,'','','_field1_;Target&#x20;IP;;_address_--_field2_;Port;;161',3,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"_address_\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\"}}','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_modules` VALUES (42,6,'',9,'Checks&#x20;if&#x20;port&#x20;22&#x20;is&#x20;open&#x20;and&#x20;reachable&#x20;for&#x20;Pandora&#x20;FMS&#x20;server.','SSH&#x20;Reachable','',0,0,300,'',22,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tpolicy_plugins` VALUES (1,1,'cscript.exe&#x20;//B&#x20;&quot;%ProgramFiles%&#92;Pandora_Agent&#92;util&#92;df_percent_used.vbs&quot;',0);
INSERT INTO `tpolicy_plugins` VALUES (2,1,'cscript.exe&#x20;//B&#x20;&quot;%ProgramFiles%&#92;Pandora_Agent&#92;util&#92;mem_percent_used.vbs&quot;',0);

View File

@ -2096,6 +2096,10 @@ sub pandora_process_module ($$$$$$$$$;$) {
my $new_status = get_module_status ($processed_data, $module, $module_type, $last_data_value);
my $last_status_change = $agent_status->{'last_status_change'};
# Escalate warning to critical if needed.
$new_status = escalate_warning($pa_config, $agent, $module, $agent_status, $new_status, $known_status);
# Set the last status change macro. Even if its value changes later, whe want the original value.
$extra_macros->{'_modulelaststatuschange_'} = $last_status_change;
@ -2271,11 +2275,11 @@ sub pandora_process_module ($$$$$$$$$;$) {
id_agente = ?, current_interval = ?, running_by = ?,
last_execution_try = ?, last_try = ?, last_error = ?,
ff_start_utimestamp = ?, ff_normal = ?, ff_warning = ?, ff_critical = ?,
last_status_change = ?
last_status_change = ?, warning_count = ?
WHERE id_agente_modulo = ?', $processed_data, $status, $status, $new_status, $new_status, $status_changes,
$current_utimestamp, $timestamp, $module->{'id_agente'}, $current_interval, $server_id,
$utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $last_error, $ff_start_utimestamp,
$ff_normal, $ff_warning, $ff_critical, $last_status_change, $module->{'id_agente_modulo'});
$ff_normal, $ff_warning, $ff_critical, $last_status_change, $agent_status->{'warning_count'}, $module->{'id_agente_modulo'});
}
# Save module data. Async and log4x modules are not compressed.
@ -7193,6 +7197,40 @@ sub notification_get_groups {
return @results;
}
##########################################################################
=head2 C<< escalate_warning (I<$pa_config>, I<$agent>, I<$module>, I<$agent_status>, I<$new_status>, I<$known_status>) >>
Return the new module status after taking warning escalation into
consideration. Updates counters in $agent_status.
=cut
##########################################################################
sub escalate_warning {
my ($pa_config, $agent, $module, $agent_status, $new_status, $known_status) = @_;
# Warning escalation disabled. Return the new status.
if ($module->{'warning_time'} == 0) {
return $new_status;
}
# Updating or reset warning counts.
if ($new_status != MODULE_WARNING) {
$agent_status->{'warning_count'} = 0;
return $new_status;
}
if ($known_status == MODULE_WARNING) {
$agent_status->{'warning_count'} += 1;
}
if ($agent_status->{'warning_count'} > $module->{'warning_time'}) {
logger($pa_config, "Escalating warning status to critical status for agent ID " . $agent->{'id_agente'} . " module '" . $module->{'nombre'} . "'.", 10);
$agent_status->{'warning_count'} = $module->{'warning_time'} + 1; # Prevent overflows.
return MODULE_CRITICAL;
}
return MODULE_WARNING;
}
########################################################################
=head2 C<< pandora_snmptrapd_still_working (I<$pa_config>, I<$dbh>) >>