CheckMK MSSQL plugin error since 2.2.0p1

CMK version: 2.2.0p1 MSP
OS version: Ubuntu 22.04 LTSB

Since our update to version 2.2.0p1 today we’re getting a new error message from the MSSQL plugin.
We’re hosting multiple customers in multiple time regions in our SaaS environment.
Some of our customers are in the Asian time-zone, where the time is ahead of our monitoring server by 5 or 6 hours. The time-zone of the OS is set to utc +8, this also affects the SQL and application time. We need it to be set to this time for the customer. Sadly, this causes a new error message from the backup part of the MSSQL plugin.

Error message:
[database] Last backup: Jun 05 2023 20:02:22, Cannot reasonably calculate time since last backup (hosts time is running ahead), Time since last backup: -5 hours 3 minutesWARN

As far as I can tell this is not something I can change in the parameters of the service.
Does anyone know a solution for this situation? Changing the system time of the server is not an option.

Thanks in advance!

Unfortunately, this is a fundamental problem within Checkmk. Most checks use the local time of the Checkmk server, rather than the current time of the remote server, as the basis for Time calculations.

Since you cannot specify a neagtive threshold as a workaround to compensate the time zone difference this has to be fixed in the MSSQL check.

What did the service show before you migrated to 2.2.0p1?

Hi LaSoe, thank you for the reply.
I was wondering if it’s possible to add some kind of offset to this check specifically from the parameters, that would fix my issue.
And indeed, as expected this is not something I can easily resolve as I don’t want to make changes to the MSSQL plugin either.

Before updating we never saw any errors, it seems however that the output used to also be “in the future” when I look at the graph.

If I can somehow say that it’s ok for the backup to be out of sync for -24 to +24 hours i’m good with that as well. One missed day doesn’t matter that much for me, it’s mainly if the back-ups aren’t running at all for a longer time.

Presumably, the MSSQL check in 2.2 has been improved to the effect that you are now alerted when a backup date is in the future, because this should not happen if you leave out the time zone problem.

Unfortunately, this means that you cannot compensate the time zone difference in the thresholds like “warn at -8h crit at -4h” as a workaround because the MSSQL check will allways first complains about the date in the future.

That’s what I figured, sadly this improvement is not an improvement for us. I do not want to filter this service out and/or permanently set it to maintenance. Also I don’t think it’s a healthy solution for us to change the time of the CheckMK server to the “highest” timezone, UTC +14.

In short I guess there is no solution if I don’t want to change the time of the machine/SQL and/or change the MSSQL script? That really sucks, as it was working perfectly (for us) before. I don’t mind the -5 hours, because it will eventually over time correct it self. We only create a back-up every 24 hours.

In this case you should open a bug ticket, because this change in the MSSSQL Check has made the monitoring unusable for you.

1 Like

Hej,
do you have any news on that topic? Is there a case open?
Do you have a workaround?

Hi Sebastian, I was given an mkp file by support which has resolved my issue.
You should contact them for support.

Edit: removed mkp

@jlagendijk you are actually not supposed to share this. Primarily because the changes, such an MKP implements are often very specific to the very customer it is built for, and it could break things for other users.
So while it is nice of you to try and help here, sharing MKPs you got from the support might actually prove detrimental.

Hi Robin, thanks for the quick response. I kind of expected this :slight_smile:
I’ve removed the MKP file!

2 Likes

Hi Sebstian, I’ve actually just received a message on my original ticket. It is fixed in the following werk: mssql_backup: Correct timezone difference for last backup date

Hi,
thanks for the information. I will wait for the next patch 2.2.0p15 so that the fix is public avaible.

Hi,
@robin.gierse do you why they removed the werk 15976 from the p15 version?
The link from Jesse is not available anymore.

@N0t0s see the release post for 2.2.0p15, the release was withdrawn: [Release] Checkmk stable release 2.2.0p15

Hi,
okay. But the werk also disappeared from the list. Or is p15 withdrawn because of the fix?
We found need that fix also for a bigger company.

I think the Werk will reappear with the next release.

So we have had 2 subsequent releases, and the werk seems to have vanished.

This werk was reverted → Revert "15976 FIX mssql_backup: Correct timezone difference for last … · Checkmk/checkmk@eb942a1 · GitHub
The only reason given is “Bugs” but nothing else :wink:

Thanks Andreas, looks like have to wait on author for update.

Hi,

any update on the werk?