2009-10-13 Sancho Lerena <slerena@artica.es>

* pandora_server_installer: Fixed usage of old pathnames /usr/share/pandora
	Fixed name of pandora_db cron.daily entry.
	
	* bin/pandora_server: Multicast status report now report each 30 x 
	server_threshold. 
	
	* lib/Core.pm: Alert event now show more information (module name). Alert
	messages like XXX going down to / going up from are replaced by more 
	simple "going to CRITICAL/NORMAL/WARNING", I hope this will be more clear.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2016 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2009-10-13 19:06:17 +00:00
parent 4b27c2e0bf
commit 6880d40500
4 changed files with 36 additions and 15 deletions

View File

@ -1,3 +1,15 @@
2009-10-13 Sancho Lerena <slerena@artica.es>
* pandora_server_installer: Fixed usage of old pathnames /usr/share/pandora
Fixed name of pandora_db cron.daily entry.
* bin/pandora_server: Multicast status report now report each 30 x
server_threshold.
* lib/Core.pm: Alert event now show more information (module name). Alert
messages like XXX going down to / going up from are replaced by more
simple "going to CRITICAL/NORMAL/WARNING", I hope this will be more clear.
2009-10-09 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm, bin/pandora_server: Re-enabled multicast

View File

@ -164,6 +164,8 @@ foreach my $server (@Servers) {
# Main loop
my $time_ref = time ();
my $mcast_timer = 0;
while (1) {
eval {
@ -177,7 +179,13 @@ while (1) {
pandora_planned_downtime (\%Config, $DBH);
pandora_exec_forced_alerts (\%Config, $DBH);
pandora_module_keep_alive_nd (\%Config, $DBH);
enterprise_hook('mcast_status_report', [\%Config, $DBH]);
# Multicast status report each 30 x Server Threshold secs
if ($mcast_timer > 30){
enterprise_hook('mcast_status_report', [\%Config, $DBH]);
$mcast_timer = 0;
}
$mcast_timer++;
};
# Restart on error or auto restart

View File

@ -400,7 +400,7 @@ sub pandora_execute_alert ($$$$$$$) {
# Generate an event
my ($text, $event) = ($alert_mode == 0) ? ('recovered', 'alert_recovered') : ('fired', 'alert_fired');
pandora_event ($pa_config, "Alert $text (" . $alert->{'name'} . ")",
pandora_event ($pa_config, "Alert $text (" . $alert->{'name'} . ") assigned to (". $module->{'nombre'} .")",
$agent->{'id_grupo'}, $agent->{'id_agente'}, $alert->{'priority'}, (defined ($alert->{'id_template_module'})) ? $alert->{'id_template_module'} : 0,
$alert->{'id_agent_module'}, $event, $dbh);
}
@ -1102,12 +1102,12 @@ sub generate_status_event ($$$$$$$) {
# Normal
if ($status == 0) {
($event_type, $severity) = ('going_down_normal', 2);
$description .= "going down to NORMAL";
$description .= "going to NORMAL";
enterprise_hook('mcast_change_report', [$pa_config, $module->{'nombre'}, $module->{'custom_id'}, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 'OK', $dbh]);
# Critical
} elsif ($status == 1) {
($event_type, $severity) = ('going_up_critical', 4);
$description .= "going up to CRITICAL";
$description .= "going to CRITICAL";
enterprise_hook('mcast_change_report', [$pa_config, $module->{'nombre'}, $module->{'custom_id'}, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 'ERR', $dbh]);
# Warning
} elsif ($status == 2) {
@ -1115,12 +1115,12 @@ sub generate_status_event ($$$$$$$) {
# From normal
if ($last_status == 0) {
($event_type, $severity) = ('going_up_warning', 3);
$description .= "going up to WARNING";
$description .= "going to WARNING";
# From critical
} elsif ($last_status == 1) {
($event_type, $severity) = ('going_down_warning', 3);
$description .= "going down to WARNING";
$description .= "going to WARNING";
} else {
# Unknown last_status
return;

View File

@ -214,18 +214,19 @@ install () {
fi
fi
echo "Creating Pandora FMS distribution directory in /usr/share/pandora"
mkdir /usr/share/pandora 2> /dev/null
cp -R util /usr/share/pandora
echo "Creating Pandora FMS distribution directory in /usr/share/pandora_server"
mkdir /usr/share/pandora_server 2> /dev/null
cp -R util /usr/share/pandora_server
if [ -d /etc/cron.daily ]
then
echo "#!/bin/bash" > /etc/cron.daily/pandora_purge_db
echo "perl /usr/share/pandora/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> /etc/cron.daily/pandora_purge_db
chmod +x /etc/cron.daily/pandora_purge_db
echo "Create the Cron script to run daily Pandora DB tool"
echo "#!/bin/bash" > /etc/cron.daily/pandora_db
echo "perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> /etc/cron.daily/pandora_db
chmod +x /etc/cron.daily/pandora_db
else
echo "You're probably not using cron for automatic scheduling. You should schedule the following command to run frequently (daily) on your master server:"
echo " perl /usr/share/pandora/util/pandora_db.pl /etc/pandora/pandora_server.conf"
echo " perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
fi
rm output
fi
@ -254,8 +255,8 @@ uninstall () {
rm -Rf /etc/rc.d/rc3.d/S90pandora_server 2> /dev/null
rm -Rf /usr/local/bin/pandora_server 2> /dev/null
rm -Rf /usr/bin/pandora_server 2> /dev/null
rm -Rf /usr/share/pandora
rm -Rf /etc/cron.daily/pandora_purge_db
rm -Rf /usr/share/pandora_server
rm -Rf /etc/cron.daily/pandora_db
echo "Done"
}