Add database CheckCommand definition for mongodb

fixes #9191

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
Ferdi Gueran 2015-04-27 17:15:52 +02:00 committed by Gunnar Beutner
parent bac76a4350
commit 9562018447
2 changed files with 107 additions and 0 deletions

View File

@ -1404,6 +1404,33 @@ postgres_production | **Optional.** Assume that the server is in production mod
postgres_action | **Required.** Determines the test executed. postgres_action | **Required.** Determines the test executed.
postgres_unixsocket | **Optional.** If "postgres_unixsocket" is set to true the unix socket is used instead of an address. Defaults to false. postgres_unixsocket | **Optional.** If "postgres_unixsocket" is set to true the unix socket is used instead of an address. Defaults to false.
### <a id="plugins-contrib-command-mongodb"></a> mongodb
The plugin `mongodb` utilises Python PyMongo.
For development check [https://github.com](https://github.com/mzupan/nagios-plugin-mongodb).
Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
Name | Description
---------------------------------|------------------------------------------------------------------------------------------------------------------------------
mongodb_host | **Required.** Specifies the hostname or address.
mongodb_port | **Required.** The port mongodb is runnung on.
mongodb_user | **Optional.** The username you want to login as
mongodb_passwd | **Optional.** The password you want to use for that user
mongodb_warning | **Optional.** The warning threshold we want to set
mongodb_critical | **Optional.** The critical threshold we want to set
mongodb_action | **Required.** The action you want to take
mongodb_maxlag | **Optional.** Get max replication lag (for replication_lag action only)
mongodb_mappedmemory | **Optional.** Get mapped memory instead of resident (if resident memory can not be read)
mongodb_perfdata | **Optional.** Enable output of Nagios performance data
mongodb_database | **Optional.** Specify the database to check
mongodb_alldatabases | **Optional.** Check all databases (action database_size)
mongodb_ssl | **Optional.** Connect using SSL
mongodb_replicaset | **Optional.** Connect to replicaset
mongodb_querytype | **Optional.** The query type to check [query|insert|update|delete|getmore|command] from queries_per_second
mongodb_collection | **Optional.** Specify the collection to check
mongodb_sampletime | **Optional.** Time used to sample number of pages faults
## <a id="plugins-contrib-ipmi"></a> IPMI Devices ## <a id="plugins-contrib-ipmi"></a> IPMI Devices
This category includes all plugins for IPMI devices. This category includes all plugins for IPMI devices.

View File

@ -303,3 +303,83 @@ object CheckCommand "postgres" {
vars.postgres_production = false vars.postgres_production = false
vars.postgres_unixsocket = false vars.postgres_unixsocket = false
} }
object CheckCommand "mongodb" {
import "plugin-check-command"
command = [ PluginDir + "/check_mongodb.py" ]
arguments = {
"-H" = {
value = "$mongodb_address$"
description = "The hostname you want to connect to"
}
"-P" = {
value = "$mongodb_port$"
description = "The port mongodb is runnung on"
}
"-u" = {
value = "$mongodb_user$"
description = "The username you want to login as"
}
"-p" = {
value = "$mongodb_passwd$"
description = "The password you want to use for that user"
}
"-A" = {
value = "$mongodb_action$"
description = "The action you want to take"
}
"-c" = {
value = "$mongodb_collection$"
description = "Specify the collection to check"
}
"-T" = {
value = "$mongodb_sampletime$"
description = "Time used to sample number of pages faults"
}
"-q" = {
value = "$mongodb_querytype$"
description = "The query type to check [query|insert|update|delete|getmore|command] from queries_per_second"
}
"--database" = {
value = "$mongodb_database$"
description = "Specify the database to check"
}
"-D" = {
set_if = "$mongodb_perfdata$"
description = "Enable output of Nagios performance data"
}
"--max-lag" = {
set_if = "$mongodb_maxlag$"
description = "Get max replication lag (for replication_lag action only)"
}
"--mapped-memory" = {
set_if = "$mongodb_mappedmemory$"
description = "Get mapped memory instead of resident (if resident memory can not be read)"
}
"--ssl" = {
set_if = "$mongodb_ssl$"
description = "Connect using SSL"
}
"--replicaset" = {
set_if = "$mongodb_replicaset$"
description = "Connect to replicaset"
}
"--all-databases" = {
set_if = "$mongodb_alldatabases$"
description = "Check all databases (action database_size)"
}
"-C" = {
value = "$mongodb_critical$"
description = "The critical threshold we want to set"
}
"-W" = {
value = "$mongodb_warning$"
description = "The warning threshold we want to set"
}
}
vars.mongodb_perfdata = true
vars.mongodb_action = "connections"
}