mzupan/nagios-plugin-mongodb — Issue #17: No Connecting to Arbiter Servers
Author: gottwald
Created: 2011-11-09 13:21:37+00:00
State: open

I think i found a little bug in this script.

When i try to monitor an Arbiter Server with the replset_state action it fails with a Critical Error - State 2.

The Problem seems that pymongo isn't allowing to connect to an arbiter. (Which is not so bad for non-monitoring purposes)
It fails with an exception (i cleared the hostname):
pymongo.errors.AutoReconnect: <***host***>:27017 is an arbiter

You only geht this debug output when you eliminate the try statement at the connection and loggin in section.

So you can't monitor an Arbiter with this thing because you will fall into the exception path of the try statement an the script returns status 2 to Nagios which ends up in a Critical Error.

Possible Solution:
Catch that error in the exception Path and do your Arbiter check through the driver error message.
But I'm not sure if there will be other errors catched too, that we possibly don't want to be catched....

Best Regards

Ingo Gottwald