From a8cf1550ce5e6b84ac2ddca0ef79b947f9c28525 Mon Sep 17 00:00:00 2001 From: Kevin Rojas Date: Wed, 17 Jun 2020 17:26:20 +0200 Subject: [PATCH 1/2] Fix Uptime module --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index aa7e12a0ed..ec016ca094 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1214,7 +1214,7 @@ INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin module_name By INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum SentBytes |Select -ExpandProperty Sum" module_end ',4,'','Bytes per second (Sent)','',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); INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin module_name CPU % module_type generic_data module_cpuusage all module_unit % module_min_warning 79.00 module_end ',1,'CPU usage (%)','CPU %','%',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); INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin module_name Total processes module_type generic_data module_exec tasklist | wc -l | gawk "{print $1}" module_end ',1,'','Total 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); -INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin module_name Uptime module_type generic_data module_exec powershell -c "(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime |Select -ExpandProperty Ticks" module_end ',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); +INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin module_name Uptime module_type generic_data module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000" module_end ',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); INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin module_name WMI Service module_type generic_proc module_service winmgmt module_end ',2,'WMI Service enabled','WMI 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); INSERT INTO `tpolicy_modules` VALUES (7,2,'module_begin module_name Bytes per second (Received) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$2}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Received)','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); INSERT INTO `tpolicy_modules` VALUES (8,2,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$10}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Sent)','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); From ca019d19094c5f19806eeadb9081ae377e648be4 Mon Sep 17 00:00:00 2001 From: Kevin Rojas Date: Wed, 17 Jun 2020 17:34:38 +0200 Subject: [PATCH 2/2] Update pandoradb_data.sql --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index ec016ca094..054c3b51ff 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1214,7 +1214,7 @@ INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin module_name By INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum SentBytes |Select -ExpandProperty Sum" module_end ',4,'','Bytes per second (Sent)','',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); INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin module_name CPU % module_type generic_data module_cpuusage all module_unit % module_min_warning 79.00 module_end ',1,'CPU usage (%)','CPU %','%',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); INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin module_name Total processes module_type generic_data module_exec tasklist | wc -l | gawk "{print $1}" module_end ',1,'','Total 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); -INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin module_name Uptime module_type generic_data module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000" module_end ',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); +INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin module_name Uptime module_type generic_data module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000" module_end ',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); INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin module_name WMI Service module_type generic_proc module_service winmgmt module_end ',2,'WMI Service enabled','WMI 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); INSERT INTO `tpolicy_modules` VALUES (7,2,'module_begin module_name Bytes per second (Received) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$2}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Received)','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); INSERT INTO `tpolicy_modules` VALUES (8,2,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$10}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Sent)','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);