From e58da7bafdc2aca15cfbf0b5a77494f784020e55 Mon Sep 17 00:00:00 2001 From: Lucie Dubrunfaut Date: Thu, 12 Dec 2024 11:23:16 +0100 Subject: [PATCH] fix(datadomain-cleaning):fixed issue when cleaning is running --- src/storage/emc/datadomain/snmp/mode/cleaning.pm | 6 +++++- .../snmp/slim-datadomain-cleaning-running.snmpwalk | 1 + tests/storage/emc/datadomain/snmp/slim-datadomain.snmpwalk | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tests/storage/emc/datadomain/snmp/slim-datadomain-cleaning-running.snmpwalk diff --git a/src/storage/emc/datadomain/snmp/mode/cleaning.pm b/src/storage/emc/datadomain/snmp/mode/cleaning.pm index 191f656826..87e6c606cd 100644 --- a/src/storage/emc/datadomain/snmp/mode/cleaning.pm +++ b/src/storage/emc/datadomain/snmp/mode/cleaning.pm @@ -116,10 +116,14 @@ sub manage_selection { if ($self->{global}->{lastExecSeconds} == -1 || $self->{global}->{lastExecSeconds} > $lastExecSeconds) { $self->{global}->{lastExecSeconds} = $lastExecSeconds; } + }elsif($snmp_result->{$oid} =~ /Cleaning: phase (\d+) of (\d+) \(copy\)/){ + $self->{global}->{lastExecHuman} = "running (phase $1 of $2 (copy))"; + $self->{global}->{lastExecSeconds} = 0; } } - if ($self->{global}->{lastExecSeconds} != -1) { + # If there is a lastExecSeconds set (if above in the looop) and this is not a cleaning running (elsif above) + if ($self->{global}->{lastExecSeconds} != -1 && ($self->{global}->{lastExecSeconds} == 0 && $self->{global}->{lastExecHuman} eq "never")) { $self->{global}->{lastExecHuman} = centreon::plugins::misc::change_seconds( value => $self->{global}->{lastExecSeconds} ); diff --git a/tests/storage/emc/datadomain/snmp/slim-datadomain-cleaning-running.snmpwalk b/tests/storage/emc/datadomain/snmp/slim-datadomain-cleaning-running.snmpwalk new file mode 100644 index 0000000000..3f0e126c9f --- /dev/null +++ b/tests/storage/emc/datadomain/snmp/slim-datadomain-cleaning-running.snmpwalk @@ -0,0 +1 @@ +.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = STRING: Cleaning: phase 5 of 6 (copy) \ No newline at end of file diff --git a/tests/storage/emc/datadomain/snmp/slim-datadomain.snmpwalk b/tests/storage/emc/datadomain/snmp/slim-datadomain.snmpwalk index 2f5417c84e..43df86852f 100644 --- a/tests/storage/emc/datadomain/snmp/slim-datadomain.snmpwalk +++ b/tests/storage/emc/datadomain/snmp/slim-datadomain.snmpwalk @@ -14972,7 +14972,7 @@ .1.3.6.1.4.1.19746.1.3.2.1.1.9.3 = STRING: Anonymized 098 .1.3.6.1.4.1.19746.1.3.2.1.1.9.4 = STRING: Anonymized 136 .1.3.6.1.4.1.19746.1.3.2.1.1.9.5 = STRING: Anonymized 207 -.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = STRING: Anonymized 176 +.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = STRING: "Cleaning finished at 2024/08/27 13:58:59." .1.3.6.1.4.1.19746.1.4.1.1.1.2.1 = STRING: Anonymized 018 .1.3.6.1.4.1.19746.1.4.1.1.1.2.2 = STRING: Anonymized 005 .1.3.6.1.4.1.19746.1.4.1.1.1.2.3 = STRING: Anonymized 122