diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index a6d4cd52c2..1f3ea089e3 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 5.1SP3-150720 +Version: 5.1SP3-150723 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 2b8c28bb55..d2bd2ea33f 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="5.1SP3-150720" +pandora_version="5.1SP3-150723" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index bc78aa561a..eb1c57a415 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '5.1SP3'; -use constant AGENT_BUILD => '150720'; +use constant AGENT_BUILD => '150723'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 46b0c3b10c..4f2d31d46c 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 5.1SP3 -%define release 150720 +%define release 150723 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 7f81d21e9a..c82341ef5d 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 5.1SP3 -%define release 150720 +%define release 150723 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f0b5584964..a2adb1e31a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150720} +{150723} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 08e6f2fd8d..a21c5ac24c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("5.1SP3(Build 150720)") +#define PANDORA_VERSION ("5.1SP3(Build 150723)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c0c8f73cd3..662640b6ff 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(5.1SP3(Build 150720))" + VALUE "ProductVersion", "(5.1SP3(Build 150723))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f37edc7982..b725c63342 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 5.1SP3-150720 +Version: 5.1SP3-150723 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index e77a7e8dfe..a7eef23b97 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="5.1SP3-150720" +pandora_version="5.1SP3-150723" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php index 9aff382ed4..8c3f0a60d9 100644 --- a/pandora_console/extras/pandora_diag.php +++ b/pandora_console/extras/pandora_diag.php @@ -123,7 +123,10 @@ switch ($config["dbtype"]) { case "mysql": render_info_data ("SELECT `value` FROM tconfig - WHERE `token` = 'db_scheme_version'", "DB Schema Version"); + WHERE `token` = 'db_scheme_first_version'", "DB Schema Version (first installed)"); + render_info_data ("SELECT `value` + FROM tconfig + WHERE `token` = 'db_scheme_version'", "DB Schema Version (actual)"); render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_build'", "DB Schema Build"); diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index da6e149ba5..02fb6cc7f5 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -31,7 +31,8 @@ $create = (string)get_parameter('create', 0); if ($id) { $permission = events_check_event_filter_group ($id); - if (!$permission) { // User doesn't have permissions to see this filter + if (!$permission) { + // User doesn't have permissions to see this filter require ("general/noaccess.php"); return; @@ -52,15 +53,15 @@ if ($id) { $event_view_hr = $filter['event_view_hr']; $id_user_ack = $filter['id_user_ack']; $group_rep = $filter['group_rep']; - - $tag_with_json = $filter['tag_with']; + + $tag_with_json = $filter['tag_with']; $tag_with_json_clean = io_safe_output($tag_with_json); $tag_with_base64 = base64_encode($tag_with_json_clean) ; $tag_without_json = $filter['tag_without']; $tag_without_json_clean = io_safe_output($tag_without_json); $tag_without_base64 = base64_encode($tag_without_json_clean) ; - + $filter_only_alert = $filter['filter_only_alert']; } else { @@ -99,10 +100,10 @@ if($update || $create) { $tag_with_base64 = get_parameter('tag_with', json_encode(array())); $tag_with_json = io_safe_input(base64_decode($tag_with_base64)); - + $tag_without_base64 = get_parameter('tag_without', json_encode(array())); $tag_without_json = io_safe_input(base64_decode($tag_without_base64)); - + $filter_only_alert = get_parameter('filter_only_alert',''); $values = array ( @@ -231,11 +232,11 @@ $table->data[11][1] = html_print_select ($repeated_sel, "group_rep", $group_rep, $tag_with = json_decode($tag_with_json_clean, true); -if(empty($tag_with)) { +if (empty($tag_with)) { $tag_with = array(); } $tag_without = json_decode($tag_without_json_clean, true); -if(empty($tag_without)) { +if (empty($tag_without)) { $tag_without = array(); } @@ -303,7 +304,8 @@ $table->data[18][1] = html_print_button(__('Remove'), 'remove_whithout', $remove $table->data[19][0] = '' . __('Alert events') . ''; $table->data[19][1] = html_print_select( - array('-1' => __('All'), + array( + '-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index b95ad63fe7..df7e000f39 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -492,7 +492,7 @@ $table->data[$row][1] = html_print_input_text ('custom_graph_widht', $row++; -$table->data[$row][0] = __('Display proc modules in binary format (OK/FAIL)'); +$table->data[$row][0] = __('Display data of proc modules in other format'); $table->data[$row][1] = __('Yes') . ' ' . html_print_radio_button ('render_proc', 1, '', $config["render_proc"], true) . @@ -502,6 +502,13 @@ $table->data[$row][1] .= __('No') . ' ' . $config["render_proc"], true); $row++; +$table->data[$row][0] = __('Display text proc modules have state is ok'); +$table->data[$row][1] = html_print_input_text ('render_proc_ok', $config["render_proc_ok"], '', 25, 25, true); +$row++; + +$table->data[$row][0] = __('Display text when proc modules have state critical'); +$table->data[$row][1] = html_print_input_text ('render_proc_fail', $config["render_proc_fail"], '', 25, 25, true); +$row++; echo '
'; html_print_input_hidden ('update_config', 1); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 5b81c9a231..75e1ad1afc 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150720'; +$build_version = 'PC150723'; $pandora_version = 'v5.1SP3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 1940aefc7e..b5103e3295 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -19,25 +19,25 @@ */ /* Enterprise hook constant */ -define ('ENTERPRISE_NOT_HOOK', -1); +define ('ENTERPRISE_NOT_HOOK', -1); /**/ -define('DATE_FORMAT', 'Y/m/d'); -define('DATE_FORMAT_JS', 'yy/mm/d'); -define('TIME_FORMAT', 'H:i:s'); -define('TIME_FORMAT_JS', 'HH:mm:ss'); +define('DATE_FORMAT', 'Y/m/d'); +define('DATE_FORMAT_JS', 'yy/mm/d'); +define('TIME_FORMAT', 'H:i:s'); +define('TIME_FORMAT_JS', 'HH:mm:ss'); /* Events state constants */ -define ('EVENT_NEW', 0); -define ('EVENT_VALIDATE', 1); -define ('EVENT_PROCESS', 2); +define ('EVENT_NEW', 0); +define ('EVENT_VALIDATE', 1); +define ('EVENT_PROCESS', 2); /* Agents disabled status */ -define ('AGENT_ENABLED',0); -define ('AGENT_DISABLED',1); +define ('AGENT_ENABLED', 0); +define ('AGENT_DISABLED', 1); @@ -61,46 +61,46 @@ define ('ERR_ACL', -110000); define ('ERR_AUTH', -120000); /* Event status code */ -define ('EVENT_STATUS_NEW',0); -define ('EVENT_STATUS_INPROCESS',2); -define ('EVENT_STATUS_VALIDATED',1); +define ('EVENT_STATUS_NEW', 0); +define ('EVENT_STATUS_INPROCESS', 2); +define ('EVENT_STATUS_VALIDATED', 1); /* Seconds in a time unit constants */ -define('SECONDS_1MINUTE', 60); -define('SECONDS_2MINUTES', 120); -define('SECONDS_5MINUTES', 300); -define('SECONDS_10MINUTES', 600); -define('SECONDS_15MINUTES', 900); -define('SECONDS_30MINUTES', 1800); -define('SECONDS_1HOUR', 3600); -define('SECONDS_2HOUR', 7200); -define('SECONDS_3HOUR', 10800); -define('SECONDS_5HOUR', 18000); -define('SECONDS_6HOURS', 21600); -define('SECONDS_12HOURS', 43200); -define('SECONDS_1DAY', 86400); -define('SECONDS_2DAY', 172800); -define('SECONDS_4DAY', 345600); -define('SECONDS_5DAY', 432000); -define('SECONDS_1WEEK', 604800); -define('SECONDS_10DAY', 864000); -define('SECONDS_2WEEK', 1209600); -define('SECONDS_15DAYS', 1296000); -define('SECONDS_1MONTH', 2592000); -define('SECONDS_2MONTHS', 5184000); -define('SECONDS_3MONTHS', 7776000); -define('SECONDS_6MONTHS', 15552000); -define('SECONDS_1YEAR', 31104000); -define('SECONDS_2YEARS', 62208000); -define('SECONDS_3YEARS', 93312000); +define('SECONDS_1MINUTE', 60); +define('SECONDS_2MINUTES', 120); +define('SECONDS_5MINUTES', 300); +define('SECONDS_10MINUTES', 600); +define('SECONDS_15MINUTES', 900); +define('SECONDS_30MINUTES', 1800); +define('SECONDS_1HOUR', 3600); +define('SECONDS_2HOUR', 7200); +define('SECONDS_3HOUR', 10800); +define('SECONDS_5HOUR', 18000); +define('SECONDS_6HOURS', 21600); +define('SECONDS_12HOURS', 43200); +define('SECONDS_1DAY', 86400); +define('SECONDS_2DAY', 172800); +define('SECONDS_4DAY', 345600); +define('SECONDS_5DAY', 432000); +define('SECONDS_1WEEK', 604800); +define('SECONDS_10DAY', 864000); +define('SECONDS_2WEEK', 1209600); +define('SECONDS_15DAYS', 1296000); +define('SECONDS_1MONTH', 2592000); +define('SECONDS_2MONTHS', 5184000); +define('SECONDS_3MONTHS', 7776000); +define('SECONDS_6MONTHS', 15552000); +define('SECONDS_1YEAR', 31104000); +define('SECONDS_2YEARS', 62208000); +define('SECONDS_3YEARS', 93312000); /* Separator constats */ -define('SEPARATOR_COLUMN', ';'); -define('SEPARATOR_ROW', chr(10)); //chr(10) = '\n' -define('SEPARATOR_COLUMN_CSV', "#"); -define('SEPARATOR_ROW_CSV', "@\n"); +define('SEPARATOR_COLUMN', ';'); +define('SEPARATOR_ROW', chr(10)); //chr(10) = '\n' +define('SEPARATOR_COLUMN_CSV', "#"); +define('SEPARATOR_ROW_CSV', "@\n"); @@ -108,12 +108,12 @@ define('SEPARATOR_ROW_CSV', "@\n"); switch ($config["dbtype"]) { case "mysql": case "postgresql": - define ('BACKUP_DIR', 'attachment/backups'); - define ('BACKUP_FULLPATH', $config['homedir'] . '/' . BACKUP_DIR); + define ('BACKUP_DIR', 'attachment/backups'); + define ('BACKUP_FULLPATH', $config['homedir'] . '/' . BACKUP_DIR); break; case "oracle": - define ('BACKUP_DIR', 'DATA_PUMP_DIR'); - define ('BACKUP_FULLPATH', 'DATA_PUMP_DIR'); + define ('BACKUP_DIR', 'DATA_PUMP_DIR'); + define ('BACKUP_FULLPATH', 'DATA_PUMP_DIR'); break; } @@ -132,24 +132,24 @@ define('COL_MAJOR', '#C97A4A'); define('COL_INFORMATIONAL', '#E4E4E4'); define('COL_MAINTENANCE', '#3BA0FF'); -define('COL_GRAPH1', '#C397F2'); -define('COL_GRAPH2', '#FFE66C'); -define('COL_GRAPH3', '#92CCA3'); -define('COL_GRAPH4', '#EA6D5B'); -define('COL_GRAPH5', '#6BD8DD'); -define('COL_GRAPH6', '#F49B31'); -define('COL_GRAPH7', '#999999'); -define('COL_GRAPH8', '#F2B8C1'); -define('COL_GRAPH9', '#C4E8C1'); -define('COL_GRAPH10', '#C1DBE5'); -define('COL_GRAPH11', '#C9C1e0'); -define('COL_GRAPH12', '#F45B95'); -define('COL_GRAPH13', '#E83128'); +define('COL_GRAPH1', '#C397F2'); +define('COL_GRAPH2', '#FFE66C'); +define('COL_GRAPH3', '#92CCA3'); +define('COL_GRAPH4', '#EA6D5B'); +define('COL_GRAPH5', '#6BD8DD'); +define('COL_GRAPH6', '#F49B31'); +define('COL_GRAPH7', '#999999'); +define('COL_GRAPH8', '#F2B8C1'); +define('COL_GRAPH9', '#C4E8C1'); +define('COL_GRAPH10', '#C1DBE5'); +define('COL_GRAPH11', '#C9C1e0'); +define('COL_GRAPH12', '#F45B95'); +define('COL_GRAPH13', '#E83128'); /* The styles */ /* Size of text in characters for truncate */ -define('GENERIC_SIZE_TEXT', 25); +define('GENERIC_SIZE_TEXT', 25); @@ -166,14 +166,14 @@ define('AGENT_MODULE_STATUS_UNKNOWN', 3); define('AGENT_MODULE_STATUS_NOT_INIT', 5); /* Agent status */ -define('AGENT_STATUS_ALL', -1); -define('AGENT_STATUS_CRITICAL', 1); -define('AGENT_STATUS_NORMAL', 0); -define('AGENT_STATUS_NOT_INIT', 5); -define('AGENT_STATUS_NOT_NORMAL', 6); -define('AGENT_STATUS_UNKNOWN', 3); -define('AGENT_STATUS_ALERT_FIRED', 4); -define('AGENT_STATUS_WARNING', 2); +define('AGENT_STATUS_ALL', -1); +define('AGENT_STATUS_CRITICAL', 1); +define('AGENT_STATUS_NORMAL', 0); +define('AGENT_STATUS_NOT_INIT', 5); +define('AGENT_STATUS_NOT_NORMAL', 6); +define('AGENT_STATUS_UNKNOWN', 3); +define('AGENT_STATUS_ALERT_FIRED', 4); +define('AGENT_STATUS_WARNING', 2); /* Visual maps contants */ @@ -191,68 +191,68 @@ define('PERCENTILE_BUBBLE', 9); define('SERVICE', 10); //Enterprise Item. define('GROUP_ITEM', 11); //Some styles -define('MIN_WIDTH',300); -define('MIN_HEIGHT',120); -define('MIN_WIDTH_CAPTION',420); +define('MIN_WIDTH', 300); +define('MIN_HEIGHT', 120); +define('MIN_WIDTH_CAPTION', 420); //The process for simple value -define('PROCESS_VALUE_NONE', 0); -define('PROCESS_VALUE_MIN', 1); -define('PROCESS_VALUE_MAX', 2); -define('PROCESS_VALUE_AVG', 3); +define('PROCESS_VALUE_NONE', 0); +define('PROCESS_VALUE_MIN', 1); +define('PROCESS_VALUE_MAX', 2); +define('PROCESS_VALUE_AVG', 3); //Status -define('VISUAL_MAP_STATUS_CRITICAL_BAD', 1); -define('VISUAL_MAP_STATUS_CRITICAL_ALERT', 4); -define('VISUAL_MAP_STATUS_NORMAL', 0); -define('VISUAL_MAP_STATUS_WARNING', 2); -define('VISUAL_MAP_STATUS_UNKNOWN', 3); -define('VISUAL_MAP_STATUS_WARNING_ALERT', 10); +define('VISUAL_MAP_STATUS_CRITICAL_BAD', 1); +define('VISUAL_MAP_STATUS_CRITICAL_ALERT', 4); +define('VISUAL_MAP_STATUS_NORMAL', 0); +define('VISUAL_MAP_STATUS_WARNING', 2); +define('VISUAL_MAP_STATUS_UNKNOWN', 3); +define('VISUAL_MAP_STATUS_WARNING_ALERT', 10); //Wizard -define('VISUAL_MAP_WIZARD_PARENTS_NONE', 0); -define('VISUAL_MAP_WIZARD_PARENTS_ITEM_MAP', 1); -define('VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP', 2); +define('VISUAL_MAP_WIZARD_PARENTS_NONE', 0); +define('VISUAL_MAP_WIZARD_PARENTS_ITEM_MAP', 1); +define('VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP', 2); /* Service constants */ //Status -define('SERVICE_STATUS_UNKNOWN', -1); -define('SERVICE_STATUS_NORMAL', 0); -define('SERVICE_STATUS_CRITICAL', 1); -define('SERVICE_STATUS_WARNING', 2); -define('SERVICE_STATUS_ALERT', 4); +define('SERVICE_STATUS_UNKNOWN', -1); +define('SERVICE_STATUS_NORMAL', 0); +define('SERVICE_STATUS_CRITICAL', 1); +define('SERVICE_STATUS_WARNING', 2); +define('SERVICE_STATUS_ALERT', 4); //Default weights -define('SERVICE_WEIGHT_CRITICAL', 1); -define('SERVICE_WEIGHT_WARNING', 0.5); -define('SERVICE_ELEMENT_WEIGHT_CRITICAL', 1); -define('SERVICE_ELEMENT_WEIGHT_WARNING', 0.5); -define('SERVICE_ELEMENT_WEIGHT_OK', 0); -define('SERVICE_ELEMENT_WEIGHT_UNKNOWN', 0); +define('SERVICE_WEIGHT_CRITICAL', 1); +define('SERVICE_WEIGHT_WARNING', 0.5); +define('SERVICE_ELEMENT_WEIGHT_CRITICAL', 1); +define('SERVICE_ELEMENT_WEIGHT_WARNING', 0.5); +define('SERVICE_ELEMENT_WEIGHT_OK', 0); +define('SERVICE_ELEMENT_WEIGHT_UNKNOWN', 0); //Modes -define('SERVICE_MODE_MANUAL', 0); -define('SERVICE_MODE_AUTO', 1); -define('SERVICE_MODE_SIMPLE', 2); +define('SERVICE_MODE_MANUAL', 0); +define('SERVICE_MODE_AUTO', 1); +define('SERVICE_MODE_SIMPLE', 2); /* Status images */ //For modules -define ('STATUS_MODULE_OK', 'module_ok.png'); -define ('STATUS_MODULE_CRITICAL', 'module_critical.png'); -define ('STATUS_MODULE_WARNING', 'module_warning.png'); -define ('STATUS_MODULE_NO_DATA', 'module_no_data.png'); -define ('STATUS_MODULE_UNKNOWN', 'module_unknown.png'); +define ('STATUS_MODULE_OK', 'module_ok.png'); +define ('STATUS_MODULE_CRITICAL', 'module_critical.png'); +define ('STATUS_MODULE_WARNING', 'module_warning.png'); +define ('STATUS_MODULE_NO_DATA', 'module_no_data.png'); +define ('STATUS_MODULE_UNKNOWN', 'module_unknown.png'); //For agents -define ('STATUS_AGENT_CRITICAL', 'agent_critical.png'); -define ('STATUS_AGENT_WARNING', 'agent_warning.png'); -define ('STATUS_AGENT_DOWN', 'agent_down.png'); -define ('STATUS_AGENT_UNKNOWN', 'agent_unknown.png'); -define ('STATUS_AGENT_OK', 'agent_ok.png'); -define ('STATUS_AGENT_NO_DATA', 'agent_no_data.png'); -define ('STATUS_AGENT_NO_MONITORS', 'agent_no_monitors.png'); -define ('STATUS_AGENT_NOT_INIT', 'agent_notinit.png'); +define ('STATUS_AGENT_CRITICAL', 'agent_critical.png'); +define ('STATUS_AGENT_WARNING', 'agent_warning.png'); +define ('STATUS_AGENT_DOWN', 'agent_down.png'); +define ('STATUS_AGENT_UNKNOWN', 'agent_unknown.png'); +define ('STATUS_AGENT_OK', 'agent_ok.png'); +define ('STATUS_AGENT_NO_DATA', 'agent_no_data.png'); +define ('STATUS_AGENT_NO_MONITORS', 'agent_no_monitors.png'); +define ('STATUS_AGENT_NOT_INIT', 'agent_notinit.png'); //For alerts -define ('STATUS_ALERT_FIRED', 'alert_fired.png'); -define ('STATUS_ALERT_NOT_FIRED', 'alert_not_fired.png'); -define ('STATUS_ALERT_DISABLED', 'alert_disabled.png'); +define ('STATUS_ALERT_FIRED', 'alert_fired.png'); +define ('STATUS_ALERT_NOT_FIRED', 'alert_not_fired.png'); +define ('STATUS_ALERT_DISABLED', 'alert_disabled.png'); //For servers define ('STATUS_SERVER_OK', 'server_ok.png'); define ('STATUS_SERVER_DOWN', 'server_down.png'); @@ -260,68 +260,70 @@ define ('STATUS_SERVER_DOWN', 'server_down.png'); /* Events criticity */ -define ('EVENT_CRIT_MAINTENANCE', 0); -define ('EVENT_CRIT_INFORMATIONAL', 1); -define ('EVENT_CRIT_NORMAL', 2); -define ('EVENT_CRIT_MINOR', 5); -define ('EVENT_CRIT_WARNING', 3); -define ('EVENT_CRIT_MAJOR', 6); -define ('EVENT_CRIT_CRITICAL', 4); -define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34); -define ('EVENT_CRIT_NOT_NORMAL', 20); +define ('EVENT_CRIT_MAINTENANCE', 0); +define ('EVENT_CRIT_INFORMATIONAL', 1); +define ('EVENT_CRIT_NORMAL', 2); +define ('EVENT_CRIT_MINOR', 5); +define ('EVENT_CRIT_WARNING', 3); +define ('EVENT_CRIT_MAJOR', 6); +define ('EVENT_CRIT_CRITICAL', 4); +define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34); +define ('EVENT_CRIT_NOT_NORMAL', 20); +define ('EVENT_CRIT_OR_NORMAL', 21); /* Id Module (more use in component)*/ -define ('MODULE_DATA', 1); -define ('MODULE_NETWORK', 2); -define ('MODULE_SNMP', 2); -define ('MODULE_PLUGIN', 4); -define ('MODULE_PREDICTION', 5); -define ('MODULE_WMI', 6); -define ('MODULE_WEB', 7); +define ('MODULE_DATA', 1); +define ('MODULE_NETWORK', 2); +define ('MODULE_SNMP', 2); +define ('MODULE_PLUGIN', 4); +define ('MODULE_PREDICTION', 5); +define ('MODULE_WMI', 6); +define ('MODULE_WEB', 7); /* Type of Modules of Prediction */ -define ('MODULE_PREDICTION_SERVICE', 2); -define ('MODULE_PREDICTION_SYNTHETIC', 3); -define ('MODULE_PREDICTION_NETFLOW', 4); +define ('MODULE_PREDICTION_SERVICE', 2); +define ('MODULE_PREDICTION_SYNTHETIC', 3); +define ('MODULE_PREDICTION_NETFLOW', 4); /* SNMP CONSTANTS */ -define('SNMP_DIR_MIBS', "attachment/mibs"); -define('SNMP_TRAP_TYPE_NONE', -1); -define('SNMP_TRAP_TYPE_COLD_START', 0); -define('SNMP_TRAP_TYPE_WARM_START', 1); -define('SNMP_TRAP_TYPE_LINK_DOWN', 2); -define('SNMP_TRAP_TYPE_LINK_UP', 3); -define('SNMP_TRAP_TYPE_AUTHENTICATION_FAILURE', 4); -define('SNMP_TRAP_TYPE_OTHER', 5); +define('SNMP_DIR_MIBS', "attachment/mibs"); + +define('SNMP_TRAP_TYPE_NONE', -1); +define('SNMP_TRAP_TYPE_COLD_START', 0); +define('SNMP_TRAP_TYPE_WARM_START', 1); +define('SNMP_TRAP_TYPE_LINK_DOWN', 2); +define('SNMP_TRAP_TYPE_LINK_UP', 3); +define('SNMP_TRAP_TYPE_AUTHENTICATION_FAILURE', 4); +define('SNMP_TRAP_TYPE_OTHER', 5); /* PASSWORD POLICIES */ -define('PASSSWORD_POLICIES_OK', 0); -define('PASSSWORD_POLICIES_FIRST_CHANGE', 1); -define('PASSSWORD_POLICIES_EXPIRED', 2); +define('PASSSWORD_POLICIES_OK', 0); +define('PASSSWORD_POLICIES_FIRST_CHANGE', 1); +define('PASSSWORD_POLICIES_EXPIRED', 2); /* SERVER TYPES */ -define('SERVER_TYPE_DATA', 0); -define('SERVER_TYPE_NETWORK', 1); -define('SERVER_TYPE_SNMP', 2); -define('SERVER_TYPE_RECON', 3); -define('SERVER_TYPE_PLUGIN', 4); -define('SERVER_TYPE_PREDICTION', 5); -define('SERVER_TYPE_WMI', 6); -define('SERVER_TYPE_EXPORT', 7); -define('SERVER_TYPE_INVENTORY', 8); -define('SERVER_TYPE_WEB', 9); -define('SERVER_TYPE_EVENT', 10); -define('SERVER_TYPE_ENTERPRISE_ICMP', 11); -define('SERVER_TYPE_ENTERPRISE_SNMP', 12); +define('SERVER_TYPE_DATA', 0); +define('SERVER_TYPE_NETWORK', 1); +define('SERVER_TYPE_SNMP', 2); +define('SERVER_TYPE_RECON', 3); +define('SERVER_TYPE_PLUGIN', 4); +define('SERVER_TYPE_PREDICTION', 5); +define('SERVER_TYPE_WMI', 6); +define('SERVER_TYPE_EXPORT', 7); +define('SERVER_TYPE_INVENTORY', 8); +define('SERVER_TYPE_WEB', 9); +define('SERVER_TYPE_EVENT', 10); +define('SERVER_TYPE_ENTERPRISE_ICMP', 11); +define('SERVER_TYPE_ENTERPRISE_SNMP', 12); /* REPORTS */ -define ('REPORT_TOP_N_MAX', 1); -define ('REPORT_TOP_N_MIN', 2); -define ('REPORT_TOP_N_AVG', 0); +define('REPORT_TOP_N_MAX', 1); +define('REPORT_TOP_N_MIN', 2); +define('REPORT_TOP_N_AVG', 0); -define ('REPORT_TOP_N_ONLY_GRAPHS', 2); -define ('REPORT_TOP_N_SHOW_TABLE_GRAPS', 1); -define ('REPORT_TOP_N_ONLY_TABLE', 0); +define('REPORT_TOP_N_ONLY_GRAPHS', 2); +define('REPORT_TOP_N_SHOW_TABLE_GRAPS', 1); +define('REPORT_TOP_N_ONLY_TABLE', 0); define ('REPORT_EXCEPTION_CONDITION_EVERYTHING', 0); define ('REPORT_EXCEPTION_CONDITION_GE', 1); @@ -339,50 +341,49 @@ define ('REPORT_ITEM_ORDER_BY_DESCENDING', 1); /* POLICIES */ -define("POLICY_UPDATED", 0); -define("POLICY_PENDING_DATABASE", 1); -define("POLICY_PENDING_ALL", 2); +define("POLICY_UPDATED", 0); +define("POLICY_PENDING_DATABASE", 1); +define("POLICY_PENDING_ALL", 2); -define("STATUS_IN_QUEUE_OUT", 0); -define("STATUS_IN_QUEUE_IN", 1); -define("STATUS_IN_QUEUE_APPLYING", 2); +define("STATUS_IN_QUEUE_OUT", 0); +define("STATUS_IN_QUEUE_IN", 1); +define("STATUS_IN_QUEUE_APPLYING", 2); -define("MODULE_UNLINKED", 0); -define("MODULE_LINKED", 1); -define("MODULE_PENDING_UNLINK", 10); -define("MODULE_PENDING_LINK", 11); +define("MODULE_UNLINKED", 0); +define("MODULE_LINKED", 1); +define("MODULE_PENDING_UNLINK", 10); +define("MODULE_PENDING_LINK", 11); /* EVENTS */ -define("EVENTS_GOING_UNKNOWN" , 'going_unknown'); -define("EVENTS_UNKNOWN", 'unknown'); -define("EVENTS_ALERT_FIRED", 'alert_fired'); -define("EVENTS_ALERT_RECOVERED", 'alert_recovered'); -define("EVENTS_ALERT_CEASED", 'alert_ceased'); -define("EVENTS_ALERT_MANUAL_VALIDATION", 'alert_manual_validation'); -define("EVENTS_RECON_HOST_DETECTED", 'recon_host_detected'); -define("EVENTS_SYSTEM", 'system'); -define("EVENTS_ERROR", 'error'); -define("EVENTS_NEW_AGENT", 'new_agent'); -define("EVENTS_GOING_UP_WARNING", 'going_up_warning'); -define("EVENTS_GOING_UP_CRITICAL", 'going_up_critical'); -define("EVENTS_GOING_DOWN_WARNING", 'going_down_warning'); -define("EVENTS_GOING_DOWN_NORMAL", 'going_down_normal'); -define("EVENTS_GOING_DOWN_CRITICAL", 'going_down_critical'); -define("EVENTS_GOING_UP_NORMAL", 'going_up_normal'); -define("EVENTS_CONFIGURATION_CHANGE", 'configuration_change'); +define("EVENTS_GOING_UNKNOWN" , 'going_unknown'); +define("EVENTS_UNKNOWN", 'unknown'); +define("EVENTS_ALERT_FIRED", 'alert_fired'); +define("EVENTS_ALERT_RECOVERED", 'alert_recovered'); +define("EVENTS_ALERT_CEASED", 'alert_ceased'); +define("EVENTS_ALERT_MANUAL_VALIDATION", 'alert_manual_validation'); +define("EVENTS_RECON_HOST_DETECTED", 'recon_host_detected'); +define("EVENTS_SYSTEM", 'system'); +define("EVENTS_ERROR", 'error'); +define("EVENTS_NEW_AGENT", 'new_agent'); +define("EVENTS_GOING_UP_WARNING", 'going_up_warning'); +define("EVENTS_GOING_UP_CRITICAL", 'going_up_critical'); +define("EVENTS_GOING_DOWN_WARNING", 'going_down_warning'); +define("EVENTS_GOING_DOWN_NORMAL", 'going_down_normal'); +define("EVENTS_GOING_DOWN_CRITICAL", 'going_down_critical'); +define("EVENTS_GOING_UP_NORMAL", 'going_up_normal'); +define("EVENTS_CONFIGURATION_CHANGE", 'configuration_change'); /* CUSTOM GRAPHS */ -define("CUSTOM_GRAPH_AREA", 0); -define("CUSTOM_GRAPH_STACKED_AREA", 1); -define("CUSTOM_GRAPH_LINE", 2); -define("CUSTOM_GRAPH_STACKED_LINE", 3); +define("CUSTOM_GRAPH_AREA", 0); +define("CUSTOM_GRAPH_STACKED_AREA", 1); +define("CUSTOM_GRAPH_LINE", 2); +define("CUSTOM_GRAPH_STACKED_LINE", 3); /* COLLECTIONS */ -define("COLLECTION_PENDING_APPLY", 0); -define("COLLECTION_CORRECT", 1); -define("COLLECTION_ERROR_LOST_DIRECTORY", 2); -define("COLLECTION_UNSAVED", 3); - +define("COLLECTION_PENDING_APPLY", 0); +define("COLLECTION_CORRECT", 1); +define("COLLECTION_ERROR_LOST_DIRECTORY", 2); +define("COLLECTION_UNSAVED", 3); /* PAGINATION */ define("PAGINATION_BLOCKS_LIMIT", 15); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 89f9d1d3a3..3f8d06db90 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1057,6 +1057,7 @@ function get_priorities ($priority_param = false) { $priorities[EVENT_CRIT_CRITICAL] = __('Critical'); $priorities[EVENT_CRIT_WARNING_OR_CRITICAL] = __('Warning').'/'.__('Critical'); $priorities[EVENT_CRIT_NOT_NORMAL] = __('Not normal'); + $priorities[EVENT_CRIT_OR_NORMAL] = __('Critical') . '/' . __('Normal'); foreach ($priorities as $key => $priority) { $priorities[$key] = ui_print_truncate_text($priority, GENERIC_SIZE_TEXT, false, true, false); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 37975e597d..d8d72ec193 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -454,8 +454,12 @@ function config_update_config () { $error_update[] = __('Show the group name instead the group icon.'); if (!config_update_value ('custom_graph_widht', get_parameter('custom_graph_widht'))) $error_update[] = __('Default line thickness for the Custom Graph.'); - if (!config_update_value ('render_proc', (int) get_parameter('render_proc', 0))) - $error_update[] = __('Display proc modules in binary format (OK/FAIL)'); + if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false))) + $error_update[] = __('Display data of proc modules in other format'); + if (!config_update_value ('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok') ))) + $error_update[] = __('Display text proc modules have state is ok'); + if (!config_update_value ('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail') ))) + $error_update[] = __('Display text when proc modules have state critical'); $interval_values = get_parameter ('interval_values'); @@ -1207,7 +1211,14 @@ function config_process_config () { if (!isset($config['render_proc'])) { config_update_value ('render_proc', 0); } - + + if (!isset($config["render_proc_ok"])) { + config_update_value ('render_proc_ok', __('Ok') ); + } + if (!isset($config["render_proc_fail"])) { + config_update_value ('render_proc_fail', __('Fail') ); + } + if (!isset($config['command_snapshot'])) { config_update_value ('command_snapshot', 1); } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index b96b26d7fd..cc51478470 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -23,6 +23,15 @@ include_once($config['homedir'] . "/include/functions_agents.php"); include_once($config['homedir'] . '/include/functions_users.php'); include_once($config['homedir'] . '/include/functions_tags.php'); +function modules_is_not_init($id_agent_module) { + $row = db_get_row('tagente_estado', 'id_agente_modulo', $id_agent_module); + + if ($row['estado'] == AGENT_MODULE_STATUS_NO_DATA) + return true; + else + return false; +} + function modules_is_disable_agent($id_agent_module) { $sql = " SELECT disabled @@ -1715,7 +1724,8 @@ function modules_get_agentmodule_data ($id_agent_module, $period, case 21: case 31: if ( $config["render_proc"] ) { - $sql = sprintf ("SELECT IF(datos >= 1, 'OK', 'FAIL') as data, utimestamp + $sql = sprintf ("SELECT IF(datos >= 1, '" . $config["render_proc_ok"] . + "', '" . $config["render_proc_fail"] . "') as data, utimestamp FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index f299d90768..b10a881e54 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -598,6 +598,8 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, global $config; + + if (empty($id_agent_module)) return false; @@ -616,8 +618,11 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, } + + // Calculate the SLA for large time without hours if ($timeFrom == $timeTo) { + // Get interval data $sql = sprintf ('SELECT * FROM tagente_datos @@ -669,7 +674,8 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, } // Calculate planned downtime dates - $downtime_dates = reporting_get_planned_downtimes_intervals($id_agent_module, $datelimit, $date); + $downtime_dates = reporting_get_planned_downtimes_intervals( + $id_agent_module, $datelimit, $date); // Get previous data $previous_data = modules_get_previous_data ($id_agent_module, $datelimit); @@ -707,12 +713,27 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, } $previous_utimestamp = $first_data['utimestamp']; - if ((($max_value > $min_value AND ($first_data['datos'] > $max_value OR $first_data['datos'] < $min_value))) OR - ($max_value <= $min_value AND $first_data['datos'] < $min_value)) { + if ( + ( + ( + $max_value > $min_value AND ( + $first_data['datos'] > $max_value OR + $first_data['datos'] < $min_value + ) + ) + ) OR + ( + $max_value <= $min_value AND + $first_data['datos'] < $min_value + ) + ) { $previous_status = 1; foreach ($downtime_dates as $date_dt) { - if (($date_dt['date_from'] <= $previous_utimestamp) AND ($date_dt['date_to'] >= $previous_utimestamp)) { + + if (($date_dt['date_from'] <= $previous_utimestamp) AND + ($date_dt['date_to'] >= $previous_utimestamp)) { + $previous_status = 0; } } @@ -768,13 +789,14 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, $timeTo); } else { + // Extract the data each day $sla = 0; $i = 0; - for ($interval = 0; $interval <= $period; $interval = $interval + SECONDS_1DAY) { - $datelimit = $date - $interval; + for ($interval = SECONDS_1DAY; $interval <= $period; $interval = $interval + SECONDS_1DAY) { + $sla_day = reporting_get_agentmodule_sla( $id_agent_module, @@ -786,8 +808,12 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, $timeFrom, $timeTo); - $sla += $sla_day; - $i++; + + // Avoid to add the period of module not init + if ($sla_day !== false) { + $sla += $sla_day; + $i++; + } } $sla = $sla / $i; @@ -4369,7 +4395,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } } - if (modules_is_disable_agent($sla['id_agent_module'])) { + if (modules_is_disable_agent($sla['id_agent_module']) || + modules_is_not_init($item['id_agent_module'])) { if (($config ['metaconsole'] == 1) && defined('METACONSOLE')) { //Restore db connection @@ -5671,7 +5698,6 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f metaconsole_restore_db(); } - continue; } @@ -5682,67 +5708,79 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f // HACK it is saved in show_graph field. // Show interfaces instead the modules if ($content['show_graph']) { - $text = $row['ip_address'] = agents_get_address( + $text = $row['availability_item'] = agents_get_address( modules_get_agentmodule_agent($item['id_agent_module'])); + + if (empty($text)) { + $text = $row['availability_item'] = __('No Address'); + } } else { - $text = $row['module'] = modules_get_agentmodule_name( + $text = $row['availability_item'] = modules_get_agentmodule_name( $item['id_agent_module']); } + $row['agent'] = modules_get_agentmodule_agent_name( $item['id_agent_module']); $text = $row['agent'] . " (" . $text . ")"; - - $monitor_value = reporting_get_agentmodule_sla( + $sla_value = reporting_get_agentmodule_sla( $item['id_agent_module'], $content['period'], - 1, - false, + 0.50, + 1.50, + $report["datetime"], + null, + $content['time_from'], + $content['time_to']); + + $count_checks = modules_get_count_datas( + $item['id_agent_module'], + $report["datetime"] - $content['period'], $report["datetime"]); - if ($monitor_value === false) { + + if ($sla_value === false) { $row['checks'] = __('Unknown'); $row['failed'] = __('Unknown'); $row['fail'] = __('Unknown'); $row['poling_time'] = __('Unknown'); $row['time_unavaliable'] = __('Unknown'); $row['ok'] = __('Unknown'); + + $percent_ok = 0; } else { - $count_checks = modules_get_count_datas( - $item['id_agent_module'], - $report["datetime"] - $content['period'], - $report["datetime"]); - $count_fails = modules_get_count_data_with_value( - $item['id_agent_module'], - $report["datetime"] - $content['period'], - $report["datetime"], - 0); + $percent_ok = format_numeric($sla_value, 2); + $percent_fail = (100 - $percent_ok); - $percent_ok = (($count_checks - $count_fails) * 100) / $count_checks; - $percent_fail = 100 - $percent_ok; + $row['checks'] = format_numeric($count_checks, 0); + $row['ok'] = $percent_ok . " %"; + $row['fail'] = $percent_fail . " %"; + $row['failed'] = + format_numeric($percent_fail * $count_checks / 100, 0); - $row['ok'] = format_numeric($percent_ok, 2) . " %"; - $row['fail'] = format_numeric($percent_fail, 2) . " %"; - $row['checks'] = format_numeric($count_checks, 2); - $row['failed'] = format_numeric($count_fails ,2); - $row['poling_time'] = human_time_description_raw( - ($count_checks - $count_fails) * modules_get_interval($item['id_agent_module']), + + $row['poling_time'] = + human_time_description_raw( + ($percent_ok * $count_checks / 100) * modules_get_interval($item['id_agent_module']), true); + $row['time_unavaliable'] = "-"; - if ($count_fails > 0) { - $row['time_unavaliable'] = human_time_description_raw( - $count_fails * modules_get_interval($item['id_agent_module']), + if ($percent_fail > 0) { + $row['time_unavaliable'] = + human_time_description_raw( + ($percent_fail * $count_checks / 100) * modules_get_interval($item['id_agent_module']), true); } + } $data[] = $row; - $avg = (($avg * $count) + $monitor_value) / ($count + 1); + $avg = (($avg * $count) + $percent_ok) / ($count + 1); if (is_null($min)) { $min = $percent_ok; $min_text = $text; @@ -5764,6 +5802,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } } + //Restore dbconnection if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { metaconsole_restore_db(); @@ -5992,7 +6031,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } } - if (modules_is_disable_agent($row['id_agent_module'])) { + if (modules_is_disable_agent($row['id_agent_module']) + || modules_is_not_init($item['id_agent_module'])) { //Restore dbconnection if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { @@ -6193,7 +6233,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } } - if (modules_is_disable_agent($g['id_agent_module'])) { + if (modules_is_disable_agent($g['id_agent_module']) + || modules_is_not_init($item['id_agent_module'])) { //Restore dbconnection if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { metaconsole_restore_db(); diff --git a/pandora_console/install.php b/pandora_console/install.php index 40d5c96070..9972d5121d 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
'index.php?page=visualmaps'))); $ui->showFooter(false); $ui->beginContent(); - + ob_start(); $rendered_map = '
'; $rendered_map .= html_print_image('images/spinner.gif', true); @@ -106,11 +106,12 @@ class Visualmap { $ui->contentAddHtml($rendered_map); $ui->contentAddHtml("