mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
handling some date issue
This commit is contained in:
parent
b9cb2a8901
commit
720b04ee4e
@ -90,13 +90,14 @@ sub run {
|
|||||||
$self->{output}->output_add(severity => 'OK',
|
$self->{output}->output_add(severity => 'OK',
|
||||||
short_msg => sprintf("All partitions are up to date"));
|
short_msg => sprintf("All partitions are up to date"));
|
||||||
|
|
||||||
|
$self->{option_results}->{retentionforward}--;
|
||||||
|
|
||||||
foreach my $table (@partitionedTables) {
|
foreach my $table (@partitionedTables) {
|
||||||
|
|
||||||
$self->{sql}->query(query => "SELECT TABLE_NAME,PARTITION_NAME FROM information_schema.PARTITIONS WHERE TABLE_NAME='".$table."' ORDER BY PARTITION_NAME DESC LIMIT 1;");
|
$self->{sql}->query(query => "SELECT TABLE_NAME,PARTITION_NAME FROM information_schema.PARTITIONS WHERE TABLE_NAME='".$table."' ORDER BY PARTITION_NAME DESC LIMIT 1;");
|
||||||
|
|
||||||
my ($tableName, $yyyymmdd) = $self->{sql}->fetchrow_array();
|
my ($tableName, $yyyymmdd) = $self->{sql}->fetchrow_array();
|
||||||
$yyyymmdd =~ s/^.//;
|
$yyyymmdd =~ s/^.//;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Table %s last partition date is %s", $tableName, $yyyymmdd));
|
$self->{output}->output_add(long_msg => sprintf("Table %s last partition date is %s", $tableName, $yyyymmdd));
|
||||||
|
|
||||||
my ($partY, $partM, $partD) = $yyyymmdd =~ /^(\d{4})(\d{2})(\d{2})\z/;
|
my ($partY, $partM, $partD) = $yyyymmdd =~ /^(\d{4})(\d{2})(\d{2})\z/;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user