Merge pull request #1752 from tanguyvda/master

fix compilation when fatpacked and date regex issue
This commit is contained in:
qgarnier 2019-11-27 17:37:12 +01:00 committed by GitHub
commit 0b99a9a6ad
2 changed files with 53 additions and 53 deletions

View File

@ -48,10 +48,10 @@ sub custom_status_calc {
my ($start, $end); my ($start, $end);
my %months = ("Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12); my %months = ("Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12);
if (defined($self->{result_values}->{start_time}) && $self->{result_values}->{start_time} =~ /^(\w+)\s(\w+)\s(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { # Mon Jan 01 13:01:23 2018 if (defined($self->{result_values}->{start_time}) && $self->{result_values}->{start_time} =~ /^(\w+)\s(\w+)\s+(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { # Mon Jan 1 13:01:23 2018 or Mon Jan 15 13:01:23
$start = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6); $start = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6);
} }
if (defined($self->{result_values}->{completion_time}) && $self->{result_values}->{completion_time} =~ /^(\w+)\s(\w+)\s(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { if (defined($self->{result_values}->{completion_time}) && $self->{result_values}->{completion_time} =~ /^(\w+)\s(\w+)\s+(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) {
$end = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6); $end = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6);
} }

View File

@ -48,10 +48,10 @@
my ($start, $end); my ($start, $end);
my %months = ("Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12); my %months = ("Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12);
if (defined($self->{result_values}->{start_time}) && $self->{result_values}->{start_time} =~ /^(\w+)\s(\w+)\s(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { # Mon Jan 01 13:01:23 2018 if (defined($self->{result_values}->{start_time}) && $self->{result_values}->{start_time} =~ /^(\w+)\s(\w+)\s+(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { # Mon Jan 1 13:01:23 2018 or Mon Jan 15 13:01:23
$start = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6); $start = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6);
} }
if (defined($self->{result_values}->{completion_time}) && $self->{result_values}->{completion_time} =~ /^(\w+)\s(\w+)\s(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { if (defined($self->{result_values}->{completion_time}) && $self->{result_values}->{completion_time} =~ /^(\w+)\s(\w+)\s+(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) {
$end = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6); $end = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6);
} }
@ -203,77 +203,77 @@
} }
} }
1; 1;
__END__ __END__
=head1 MODE =head1 MODE
Check deduped VTL on source. Check deduped VTL on source.
=over 8 =over 8
=item B<--hostname> =item B<--hostname>
Hostname to query. Hostname to query.
=item B<--filter-counters> =item B<--filter-counters>
Only display some counters (regexp can be used). Only display some counters (regexp can be used).
Example: --filter-counters='status' Example: --filter-counters='status'
=item B<--warning-status> =item B<--warning-status>
Set warning threshold for status (Default: '%{state} !~ /Enabled/i'). Set warning threshold for status (Default: '%{state} !~ /Enabled/i').
Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}. Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}.
=item B<--critical-status> =item B<--critical-status>
Set critical threshold for status (Default: ''). Set critical threshold for status (Default: '').
Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}. Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}.
=item B<--warning-*> =item B<--warning-*>
Threshold warning. Threshold warning.
Can be: 'original-data-size', 'sent-data-size'. Can be: 'original-data-size', 'sent-data-size'.
=item B<--critical-*> =item B<--critical-*>
Threshold critical. Threshold critical.
Can be: 'original-data-size', 'sent-data-size'. Can be: 'original-data-size', 'sent-data-size'.
=item B<--ssh-option> =item B<--ssh-option>
Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52').
=item B<--ssh-path> =item B<--ssh-path>
Specify ssh command path (default: none) Specify ssh command path (default: none)
=item B<--ssh-command> =item B<--ssh-command>
Specify ssh command (default: 'ssh'). Useful to use 'plink'. Specify ssh command (default: 'ssh'). Useful to use 'plink'.
=item B<--timeout> =item B<--timeout>
Timeout in seconds for the command (Default: 30). Timeout in seconds for the command (Default: 30).
=item B<--sudo> =item B<--sudo>
Use 'sudo' to execute the command. Use 'sudo' to execute the command.
=item B<--command> =item B<--command>
Command to get information (Default: 'syscli'). Command to get information (Default: 'syscli').
=item B<--command-path> =item B<--command-path>
Command path. Command path.
=item B<--command-options> =item B<--command-options>
Command options (Default: '--list dedupvtl'). Command options (Default: '--list dedupvtl').
=back =back
=cut =cut