Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[storage::emc::datadomain::snmp::plugin] - mode(cleaning) : Bad status when cleaning ending #5441

Closed
monsieurpouet opened this issue Feb 7, 2025 · 6 comments

Comments

@monsieurpouet
Copy link

Hi all !

Quick description

When i use the storage::emc::datadomain::snmp::plugin plugin with cleaning mode, I get a CRITICAL status when the last phase of cleaning arrive.

The last phase of cleaning on Datadomain is a summary phase (12/12). At this moment, the filesystems.cleaning.execution.last.days is 0. It's normal because the cleaning isn't totally finished, so the count start after the ending of cleaning.

But, for some weird reason, I've 1h of CRITICAL, because the filesystems.cleaning.execution.last.days is set to a negative days oO -> show result below.

How to reproduce

Environment: Debian 11.11.
Version of the plugin: 20250114-1+deb11u1
Command line: /usr/lib/centreon/plugins//centreon_emc_datadomain.pl --plugin=storage::emc::datadomain::snmp::plugin --mode=cleaning --hostname=ip.ip.ip.ip --snmp-version='3' --snmp-community='silenthill' --snmp-username='doe' --authprotocol='MD5' --authpassphrase='ilovesarahconnor' --privprotocol='AES' --privpassphrase='johnmcclane' --warning-last-cleaning-execution='7' --critical-last-cleaning-execution='15'

Expected result

OK: cleaning last execution: 1m 17s | 'filesystems.cleaning.execution.last.days'=0d;0:7;0:15;0;

Actual result (it's a history of dataperf which had get with the command line)

OK: cleaning last execution: running (phase 12 of 12 : summary) | 'filesystems.cleaning.execution.last.days'=0d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning: phase 12 of 12 (summary)
ven. 07 févr. 2025 04:10:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-2922d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:15:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-2623d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:20:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-2321d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:25:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-2022d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:30:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-1723d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:35:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-1422d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:40:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-1122d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:45:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-821d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:50:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-523d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 04:55:01 CET
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-222d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 05:00:01 CET
OK: cleaning last execution: 1m 17s | 'filesystems.cleaning.execution.last.days'=0d;0:7;0:15;0;
.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/07 03:58:44.
ven. 07 févr. 2025 05:05:01 CET

Closing words

Good weekend !

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

I've work on your issue and it seems that the equipment timezone was considered as Europe/London all the time. This explains why, in your case, if the equipment is in a Europe/Paris timezone, there is a time difference of about 1 hour. To solve this problem, I added a --timezone option to define the equipment's timezone.


Example :

Monday 17th February 2025 10:24 (system timezone='Europe/Paris')
Equipment OID returns:

.1.3.6.1.4.1.19746.1.3.5.1.1.2.0 = Cleaning finished at 2025/02/17 09:55:44.

Plugin output :
First case considering timezone='Europe/London' (same behavior than without the option)

perl centreon_plugins.pl --plugin=storage::emc::datadomain::snmp::plugin --mode=cleaning --hostname=XXXX --snmp-version=2c --snmp-community=XXXX --snmp-port=XXXX --warning-last-cleaning-execution='7' --critical-last-cleaning-execution='15' --timezone='Europe/London' 
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-2120d;0:7;0:15;0;

Second case considering timezone='Europe/Paris'

perl centreon_plugins.pl --plugin=storage::emc::datadomain::snmp::plugin --mode=cleaning --hostname=XXXX --snmp-version=2c --snmp-community=XXXX --snmp-port=XXXX --warning-last-cleaning-execution='7' --critical-last-cleaning-execution='15' --timezone='Europe/Paris'
OK: cleaning last execution: 30m 4s | 'filesystems.cleaning.execution.last.days'=0d;0:7;0:15;0;

Third case considering timezone='America/Los_Angeles'

perl centreon_plugins.pl --plugin=storage::emc::datadomain::snmp::plugin --mode=cleaning --hostname=XXXX --snmp-version=2c --snmp-community=XXXX --snmp-port=XXXX --warning-last-cleaning-execution='7' --critical-last-cleaning-execution='15' --timezone='America/Los_Angeles'
CRITICAL: cleaning last execution: never | 'filesystems.cleaning.execution.last.days'=-30554d;0:7;0:15;0;

You can try this PR to check if this solve your issue: #5453

@monsieurpouet
Copy link
Author

monsieurpouet commented Feb 17, 2025

Hum, I'll check that !

So, by vanilla, the plugin consider tha equipement in Europe/London timezone ? Becasue my Datadomain have a good timezone.

sysadmin@XXX# config show timezone
The Timezone name is: Europe/Paris

But how did you think at that ? 🤔

@lucie-dubrunfaut
Copy link
Contributor

Because it was a problem in one hour and often when working with timezones in France a time issue around one hour could be a timezone issue.

It's not your equipment that returns a wrong timezone, it's the way the plugin interpret this timezone as a Europe/London time and not a Europe/Paris time.

I'm not sure if my explanation is clear sorry ^^'

@monsieurpouet
Copy link
Author

Mmmmokay, so the plugin work with UTC+0 by default ? Or the perl system ?

I think it is a good fix.

@lucie-dubrunfaut
Copy link
Contributor

From what I understand, the time of the system running the plugin correctly takes into account the notion of UTC but the value retrieved from the OID is taken as UTC+0 when this is not necessarily the case. Adding the timezone option allows you to define the equipment's timezone and therefore correct this value.

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

This Issue should be resolved by the march release and this PR #5453
You can use the option --timezone to set equipment timezone and avoid the misinterpretation of the delta between the time of the system running the plugin and the time recorded by the equipment during cleaning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants