pmp-check-mysql-replication-delay reports ok if server is not configured as a slave

Bug #1357017 reported by Mikhail Solovyev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Monitoring Plugins
Fix Released
Low
Unassigned

Bug Description

[root@cron01 ~]# mysql ... -e "show slave status\G"
[root@cron01 ~]# /usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay ... -w 3600 -c 7200
OK 0 seconds of replication delay | replication_delay=0;3600;7200;0;

It seems to be logical to return UNKNOWN in such case, isn't it?

We discussed this with Jay Janssen in #44493
He said:

Firstly, it’s intended that you use pmp-check-mysql-replication-running to test if replication is up or down, and not just the replication-delay check. (I did not design these tools, but that’s the intention).

As far as your specific problem, I do think it is supposed to return UNKNOWN in that case, so it may be a bug. I found a similar report from a few years ago that should have been fixed: https://bugs.launchpad.net/percona-monitoring-plugins/+bug/1040528

Tags: nagios
description: updated
Revision history for this message
Roman Vynar (roman-vynar) wrote :

It returns OK because in some cases, you want it to report OK on all the servers despite they are configured with slave or not. So like a generic check. UNKNOWN usually means unable to determine the slave status. If the replica is not configured, there is no reason why delay check should fail. To be alerted whether the replication is running or not at all, that's another script for - pmp-check-mysql-replication-running.

Changed in percona-monitoring-plugins:
status: New → Opinion
Revision history for this message
Mikhail Solovyev (mikhail-solovyev) wrote :

Roman,

I agree that it may vary depending on environment, whether it's OK or UNKNOWN. I personally use pmp-check-mysql-replication-delay in important part of our application, to detect if it's safe to send load to slave (checking that slave does not have lag or replication is not broken/reset). In my case it's more logical to receive UNKNOWN if replication is not setup (someone accidentally has reset slave setup).

Do you think many people run replication check against servers which have no replication setup at all and expect check to return OK? :)

Revision history for this message
Roman Vynar (roman-vynar) wrote :

Mikhail, I can add a new option to alert UNKNOWN if replica is not configured. Will it work for you?

Revision history for this message
Mikhail Solovyev (mikhail-solovyev) wrote :

Roman,

Sorry for slow responce, yes, it will work fine for me.

Changed in percona-monitoring-plugins:
status: Opinion → Confirmed
importance: Undecided → Low
tags: added: nagios
Changed in percona-monitoring-plugins:
status: Confirmed → Fix Committed
Changed in percona-monitoring-plugins:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.