Home

nagios: “CRITICAL – Unable to find host ‘” + host + “‘ in replica set.”

2014/11/26

You may find yourself in the situation where when configuring nagios to monitor a MongoDB, it will complain that:

"CRITICAL - Unable to find host XXXXXXXX in replica set."

And you know for a fact that the replica set is fine. What has gone wrong then?

You have told nagios to monitor the IP address of the host in question, where in the replica set the host is found by its DNS name. Currently nagios-plugin-mongodb does not take this into account.

Advertisements

2 Responses to “nagios: “CRITICAL – Unable to find host ‘” + host + “‘ in replica set.””


  1. It’s not the actual nagios-plugin-mongodb python script that needs to take it into account, it is how they suggest you define the command in nagios.

    I used $HOSTNAME$ instead of $HSTADDRESS$ in nagios’ command definitions, as this is consistent with the definition of nodes in the replica set, and works like a charm..

    define command {
        command_name    check_mongodb
        command_line    $USER1$/check_mongodb.py -H $HOSTNAME$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
    }
    ...
    

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: