nagios-plugin-mongodb icon indicating copy to clipboard operation
nagios-plugin-mongodb copied to clipboard

Check collection state service example has wrong check_command

Open mf-collinhayden opened this issue 10 years ago • 0 comments

In github and in the README.md I found that the following is specified:

Check Collection State

This will check each host that is listed in the Mongo Servers group. It can be useful to check availability of a critical collection (locks, timeout, config server unavailable...). It will issue a critical error if find_one query failed


define service {
    use                 generic-service
    hostgroup_name          Mongo Servers
    service_description     Mongo Collection State
    check_command           check_mongodb!collection_state!27017!your-database!your-collection
}

I was getting an error until I figured out that the check_command should be like this:

define service { use generic-service hostgroup_name Mongo Servers service_description Mongo Collection State check_command check_mongodb_collection!collection_state!27017!0!0!your-database!your-collection

since the check_command is able to pass a collection and a database and the one specified in the readme and on github doesn't have enough arguments in the default check_mongodb command. It should use this one:

define command { command_name check_mongodb_collection command_line $USER1$/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$ -d $ARG5$ -c $ARG6$ -D }

mf-collinhayden avatar Jun 17 '14 23:06 mf-collinhayden