mzupan/nagios-plugin-mongodb — pull request #96 by brevilo (2013-07-22 13:53:10+00:00)
Title: Use the actual hostname to identify replica set members

If you run the script locally on the MongoDB node itself "host"
will default to 127.0.0.1. In a production environment 127.0.0.1
is not the host specified in the replica set configuration which means,
currently, check_rep_lag() returns an "Unable to find host" error in
such a case.

Specifying the hostname as a command line argument, also for local
runs, isn't an alternative as it affects the authentication scheme:
local connects via 127.0.0.1 don't (by default) require authentication
while connects specifying a hostname can - the very reason why someone
might prefer to run the check script locally, not remotely.