2008-10-20 Esteban Sanchez <estebans@artica.es>

* lib/PandoraFMS/DB.pm: Fixed a strange bug that was causing to
	generate events of servers going down, the solution was to update
	own keepalive before checking others server status. Tab style
	correction, replacing blankspaces with tab.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1173 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2008-10-20 10:43:21 +00:00
parent 38df3554bc
commit b46fab2e7f
2 changed files with 507 additions and 498 deletions

View File

@ -1,3 +1,10 @@
2008-10-20 Esteban Sanchez <estebans@artica.es>
* lib/PandoraFMS/DB.pm: Fixed a strange bug that was causing to
generate events of servers going down, the solution was to update
own keepalive before checking others server status. Tab style
correction, replacing blankspaces with tab.
2008-10-20 Manuel Arostegui <marostegui@artica.es> 2008-10-20 Manuel Arostegui <marostegui@artica.es>
* pandora_server_installer: Added dependency * pandora_server_installer: Added dependency

View File

@ -1292,6 +1292,9 @@ sub pandora_serverkeepaliver (%$$) {
my @data; my @data;
my $err; my $err;
# First of all, update our keepalive
pandora_updateserver ($pa_config, $pa_config->{'servername'}, 1, $opmode, $dbh);
my $temp = $pa_config->{"keepalive"} - $pa_config->{"server_threshold"}; my $temp = $pa_config->{"keepalive"} - $pa_config->{"server_threshold"};
if ($temp <= 0){ if ($temp <= 0){
@ -1299,8 +1302,7 @@ sub pandora_serverkeepaliver (%$$) {
$temp = $pa_config->{"keepalive_orig"} * 2; # Down if keepalive x 2 seconds unknown $temp = $pa_config->{"keepalive_orig"} * 2; # Down if keepalive x 2 seconds unknown
my $fecha_limite = DateCalc($timestamp,"- $temp seconds",\$err); my $fecha_limite = DateCalc($timestamp,"- $temp seconds",\$err);
$fecha_limite = &UnixDate($fecha_limite,"%Y-%m-%d %H:%M:%S"); $fecha_limite = &UnixDate($fecha_limite,"%Y-%m-%d %H:%M:%S");
# Look updated servers and take down non updated servers my $query_idag = "SELECT * FROM tserver WHERE keepalive < '$fecha_limite'";
my $query_idag = "select * from tserver where keepalive < '$fecha_limite'";
my $s_idag = $dbh->prepare($query_idag); my $s_idag = $dbh->prepare($query_idag);
$s_idag ->execute; $s_idag ->execute;
if ($s_idag->rows != 0) { if ($s_idag->rows != 0) {
@ -1321,7 +1323,6 @@ sub pandora_serverkeepaliver (%$$) {
} }
$s_idag->finish(); $s_idag->finish();
# Update my server # Update my server
pandora_updateserver ($pa_config, $pa_config->{'servername'}, 1, $opmode, $dbh);
$pa_config->{"keepalive"} = $pa_config->{"keepalive_orig"}; $pa_config->{"keepalive"} = $pa_config->{"keepalive_orig"};
} }
$pa_config->{"keepalive"} = $pa_config->{"keepalive"} - $pa_config->{"server_threshold"}; $pa_config->{"keepalive"} = $pa_config->{"keepalive"} - $pa_config->{"server_threshold"};
@ -2269,3 +2270,4 @@ sub export_module_data {
1; 1;
__END__ __END__
# Look updated servers and take down non updated servers