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

Replication_lag check returns inconsistent perfdata #235

Open
merlyel opened this issue Jan 11, 2018 · 0 comments
Open

Replication_lag check returns inconsistent perfdata #235

merlyel opened this issue Jan 11, 2018 · 0 comments

Comments

@merlyel
Copy link

merlyel commented Jan 11, 2018

If there's replica with slave delay, then warn/crit are checked against slavedelay+warn or slavedelay+crit.
return(check_levels(lag, warning + slaveDelays[host_node['name']], critical + slaveDelays[host_node['name']], message))
That makes sense as we don't need to change warn/crit level for every replica we add no matter what slaveDelay is configured

But perfdata shows warn/crit without slaveDelay, making perfdata absolutely useless for graphing.

For example, slaveDelay is 3600, warn 200 and crit 4000
OK - Lag is 3602.0 seconds |replication_lag=3602.0;200.0;400.0
Everything is ok, because 3600 is less that 3800/4000
But on the graph it would look like lag is way over warn/crit

--- check_mongodb.py   2018-01-11 14:43:55.660483343 -0500
+++ check_mongodb.py    2018-01-11 14:45:06.302581117 -0500
@@ -523,7 +525,7 @@
                 message += performance_data(perf_data, [(lag, "replication_lag_percent", warning, critical)])
             else:
                 message = "Lag is " + str(lag) + " seconds"
-                message += performance_data(perf_data, [(lag, "replication_lag", warning, critical)])
+                message += performance_data(perf_data, [(lag, "replication_lag", warning + slaveDelays[host_node['name']], critical + slaveDelays[host_node['name']])])
             return(check_levels(lag, warning + slaveDelays[host_node['name']], critical + slaveDelays[host_node['name']], message))
         else:
             #
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

1 participant