mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 23:54:18 +02:00
fix eventlog new
This commit is contained in:
parent
87009afdbf
commit
fb9ee72e58
@ -165,7 +165,7 @@ sub manage_selection {
|
|||||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||||
|
|
||||||
my $date = $result->{eventLogDate} . ' ' . $result->{eventLogTime};
|
my $date = $result->{eventLogDate} . ' ' . $result->{eventLogTime};
|
||||||
$result->{eventLogDate} =~ /(\d+)\/(\d+)\/(\d+)\s+(\d+):(\d+):(\d+)/;
|
$date =~ /^(\d+)\/(\d+)\/(\d+)\s+(\d+)\/(\d+)\/(\d+)/;
|
||||||
|
|
||||||
my $dt = DateTime->new(year => $3, month => $1, day => $2, hour => $4, minute => $5, second => $6,
|
my $dt = DateTime->new(year => $3, month => $1, day => $2, hour => $4, minute => $5, second => $6,
|
||||||
time_zone => $self->{option_results}->{timezone});
|
time_zone => $self->{option_results}->{timezone});
|
||||||
@ -174,7 +174,7 @@ sub manage_selection {
|
|||||||
|
|
||||||
my $diff_time = $current_time - $dt->epoch;
|
my $diff_time = $current_time - $dt->epoch;
|
||||||
|
|
||||||
$self->{alarms}->{global}->{alarm}->{$i} = { %$result, since => $diff_time, generation_time => centreon::plugins::misc::change_seconds(value => $dt->epoch) };
|
$self->{alarms}->{global}->{alarm}->{$i} = { %$result, since => $diff_time, generation_time => centreon::plugins::misc::change_seconds(value => $diff_time) };
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user