Merge branch '2106-intracom-rebranding-2' into 'develop'

2106 intracom rebranding 2

See merge request artica/pandorafms!1504
This commit is contained in:
vgilc 2018-05-29 17:39:47 +02:00
commit cab294e1e9
5 changed files with 35 additions and 20 deletions

View File

@ -3966,8 +3966,8 @@ function ui_get_custom_header_logo ($white_bg = false) {
} }
$stored_logo = is_metaconsole() $stored_logo = is_metaconsole()
? $config['meta_custom_logo'] ? ($white_bg ? $config['meta_custom_logo_white_bg'] : $config['meta_custom_logo'])
: $white_bg ? $config['custom_logo_white_bg'] : $config['custom_logo']; : ($white_bg ? $config['custom_logo_white_bg'] : $config['custom_logo']);
if (empty($stored_logo)) return 'images/pandora_tinylogo.png'; if (empty($stored_logo)) return 'images/pandora_tinylogo.png';
return 'enterprise/images/custom_logo/' . $stored_logo; return 'enterprise/images/custom_logo/' . $stored_logo;
} }

View File

@ -84,7 +84,7 @@ class Ui {
public function createPage($title = null, $page_name = null) { public function createPage($title = null, $page_name = null) {
if (!isset($title)) { if (!isset($title)) {
$this->title = __('Pandora FMS mobile'); $this->title = __('%s mobile', get_product_name());
} }
else { else {
$this->title = $title; $this->title = $title;

View File

@ -605,13 +605,13 @@ sub pandora_process_alert ($$$$$$$$;$) {
pandora_event ($pa_config, "Alert ceased (" . pandora_event ($pa_config, "Alert ceased (" .
safe_output($alert->{'name'}) . ")", 0, 0, $alert->{'priority'}, $id, safe_output($alert->{'name'}) . ")", 0, 0, $alert->{'priority'}, $id,
(defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0), (defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0),
"alert_ceased", 0, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions); "alert_ceased", 0, $dbh, 'monitoring_server', '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions);
} else { } else {
pandora_event ($pa_config, "Alert ceased (" . pandora_event ($pa_config, "Alert ceased (" .
safe_output($alert->{'name'}) . ")", $agent->{'id_grupo'}, safe_output($alert->{'name'}) . ")", $agent->{'id_grupo'},
$agent->{'id_agente'}, $alert->{'priority'}, $id, $agent->{'id_agente'}, $alert->{'priority'}, $id,
(defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0), (defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0),
"alert_ceased", 0, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions); "alert_ceased", 0, $dbh, 'monitoring_server', '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions);
} }
return; return;
} }
@ -844,7 +844,7 @@ sub pandora_execute_alert ($$$$$$$$$;$) {
pandora_event ($pa_config, "Alert $text (" . safe_output($alert->{'name'}) . ") " . (defined ($module) ? 'assigned to ('. safe_output($module->{'nombre'}) . ")" : ""), pandora_event ($pa_config, "Alert $text (" . safe_output($alert->{'name'}) . ") " . (defined ($module) ? 'assigned to ('. safe_output($module->{'nombre'}) . ")" : ""),
(defined ($agent) ? $agent->{'id_grupo'} : 0), (defined ($agent) ? $agent->{'id_agente'} : 0), $severity, (defined ($alert->{'id_template_module'}) ? $alert->{'id_template_module'} : 0), (defined ($agent) ? $agent->{'id_grupo'} : 0), (defined ($agent) ? $agent->{'id_agente'} : 0), $severity, (defined ($alert->{'id_template_module'}) ? $alert->{'id_template_module'} : 0),
(defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0), $event, 0, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions); (defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0), $event, 0, $dbh, 'monitoring_server', '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions);
} }
} }
@ -3146,7 +3146,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) {
# Set default values for optional parameters # Set default values for optional parameters
$source = $pa_config->{'rb_product_name'} unless defined ($source); $source = 'monitoring_server' unless defined ($source);
$comment = '' unless defined ($comment); $comment = '' unless defined ($comment);
$id_extra = '' unless defined ($id_extra); $id_extra = '' unless defined ($id_extra);
$user_name = '' unless defined ($user_name); $user_name = '' unless defined ($user_name);
@ -4160,11 +4160,11 @@ sub generate_status_event ($$$$$$$$) {
# Generate the event # Generate the event
if ($status != 0){ if ($status != 0){
pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'}, pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'},
$severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}); $severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'});
} else { } else {
# Self validate this event if has "normal" status # Self validate this event if has "normal" status
pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'}, pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'},
$severity, 0, $module->{'id_agente_modulo'}, $event_type, 1, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}); $severity, 0, $module->{'id_agente_modulo'}, $event_type, 1, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'});
} }
} }
@ -4919,7 +4919,7 @@ sub pandora_module_unknown ($$) {
# Are unknown events enabled? # Are unknown events enabled?
if ($pa_config->{'unknown_events'} == 1) { if ($pa_config->{'unknown_events'} == 1) {
pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'}, pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'},
$severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}); $severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'});
} }
} }
# Regular module # Regular module
@ -4985,7 +4985,7 @@ sub pandora_module_unknown ($$) {
$description = subst_alert_macros ($description, \%macros, $pa_config, $dbh, $agent, $module); $description = subst_alert_macros ($description, \%macros, $pa_config, $dbh, $agent, $module);
pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'}, pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'},
$severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, $pa_config->{'rb_product_name'}, '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}); $severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'});
} }
} }
} }

View File

@ -30,6 +30,7 @@ use Time::HiRes qw(usleep);
use lib '/usr/lib/perl5'; use lib '/usr/lib/perl5';
use PandoraFMS::Tools; use PandoraFMS::Tools;
use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version

View File

@ -34,6 +34,20 @@ fi
export PANDORA_HOME="/etc/pandora/pandora_server.conf" export PANDORA_HOME="/etc/pandora/pandora_server.conf"
export PANDORA_DAEMON=/usr/bin/pandora_server export PANDORA_DAEMON=/usr/bin/pandora_server
# Environment variables
if [ -f /etc/pandora/pandora_server.env ]; then
source /etc/pandora/pandora_server.env
fi
if [[ -z ${PANDORA_RB_PRODUCT_NAME} ]]; then
PANDORA_RB_PRODUCT_NAME="Pandora FMS"
fi
if [[ -z ${PANDORA_RB_COPYRIGHT_NOTICE} ]]; then
PANDORA_RB_COPYRIGHT_NOTICE="Artica ST"
fi
export PANDORA_RB_PRODUCT_NAME=$PANDORA_RB_PRODUCT_NAME
export PANDORA_RB_COPYRIGHT_NOTICE=$PANDORA_RB_COPYRIGHT_NOTICE
# Uses a wait limit before sending a KILL signal, before trying to stop # Uses a wait limit before sending a KILL signal, before trying to stop
# Pandora FMS server nicely. Some big systems need some time before close # Pandora FMS server nicely. Some big systems need some time before close
# all pending tasks / threads. # all pending tasks / threads.
@ -73,7 +87,7 @@ function pidof_pandora () {
if [ ! -f $PANDORA_DAEMON ] if [ ! -f $PANDORA_DAEMON ]
then then
echo "Pandora FMS Server not found, please check setup and read manual" echo "$PANDORA_RB_PRODUCT_NAME Server not found, please check setup and read manual"
rc_failed 5 # program is not installed rc_failed 5 # program is not installed
rc_exit rc_exit
fi fi
@ -83,7 +97,7 @@ case "$1" in
PANDORA_PID=`pidof_pandora` PANDORA_PID=`pidof_pandora`
if [ ! -z "$PANDORA_PID" ] if [ ! -z "$PANDORA_PID" ]
then then
echo "Pandora FMS Server is currently running on this machine with PID ($PANDORA_PID)." echo "$PANDORA_RB_PRODUCT_NAME Server is currently running on this machine with PID ($PANDORA_PID)."
rc_exit # running start on a service already running rc_exit # running start on a service already running
fi fi
@ -94,11 +108,11 @@ case "$1" in
if [ ! -z "$PANDORA_PID" ] if [ ! -z "$PANDORA_PID" ]
then then
echo "Pandora Server is now running with PID $PANDORA_PID" echo "$PANDORA_RB_PRODUCT_NAME Server is now running with PID $PANDORA_PID"
rc_status -v rc_status -v
else else
echo "Cannot start Pandora FMS Server. Aborted." echo "Cannot start $PANDORA_RB_PRODUCT_NAME Server. Aborted."
echo "Check Pandora FMS log files at '/var/log/pandora/pandora_server.error & pandora_server.log'" echo "Check $PANDORA_RB_PRODUCT_NAME log files at '/var/log/pandora/pandora_server.error & pandora_server.log'"
rc_failed 7 # program is not running rc_failed 7 # program is not running
fi fi
;; ;;
@ -107,10 +121,10 @@ case "$1" in
PANDORA_PID=`pidof_pandora` PANDORA_PID=`pidof_pandora`
if [ -z "$PANDORA_PID" ] if [ -z "$PANDORA_PID" ]
then then
echo "Pandora FMS Server is not running, cannot stop it." echo "$PANDORA_RB_PRODUCT_NAME Server is not running, cannot stop it."
rc_exit # running stop on a service already stopped or not running rc_exit # running stop on a service already stopped or not running
else else
echo "Stopping Pandora FMS Server" echo "Stopping $PANDORA_RB_PRODUCT_NAME Server"
kill $PANDORA_PID > /dev/null 2>&1 kill $PANDORA_PID > /dev/null 2>&1
COUNTER=0 COUNTER=0
@ -138,10 +152,10 @@ case "$1" in
PANDORA_PID=`pidof_pandora` PANDORA_PID=`pidof_pandora`
if [ -z "$PANDORA_PID" ] if [ -z "$PANDORA_PID" ]
then then
echo "Pandora FMS Server is not running." echo "$PANDORA_RB_PRODUCT_NAME Server is not running."
rc_failed 7 # program is not running rc_failed 7 # program is not running
else else
echo "Pandora FMS Server is running with PID $PANDORA_PID." echo "$PANDORA_RB_PRODUCT_NAME Server is running with PID $PANDORA_PID."
rc_status rc_status
fi fi
;; ;;