Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #10979] Mistake in mongodb command definition (mongodb_replicaset) #3848

Closed
icinga-migration opened this issue Jan 18, 2016 · 7 comments
Milestone

Comments

@icinga-migration
Copy link
Member

@icinga-migration icinga-migration commented Jan 18, 2016

This issue has been migrated from Redmine: https://dev.icinga.com/issues/10979

Created by Napsty on 2016-01-18 13:32:35 +00:00

Assignee: (none)
Status: Resolved (closed on 2016-01-18 14:44:24 +00:00)
Target Version: 2.4.2
Last Update: 2016-02-23 09:58:41 +00:00 (in Redmine)

Icinga Version: 2.4.1
Backport?: Already backported
Include in Changelog: 1

When hecking the primary server of a replica set (replica_primary) in MongoDB this requires the usage of -r/--replicaset parameter.
In the current config the command definition lacks the value of the option:

"--replicaset" = { set\_if = "$mongodb\_replicaset$" description = "Connect to replicaset" }

The value is mandatory to use, see command line:

$ /usr/lib/nagios/plugins/check\_mongodb.py -H mongodbserver -P 27001 -A replica\_primary replicaset must be passed in when using replica\_primary check

$ /usr/lib/nagios/plugins/check_mongodb.py -H mongodbserver -P 27001 -A replica_primary -r my-set
OK - Primary server has not changed

I adapted it in the following way so the value is used:

"--replicaset" = { value = "$mongodb\_replicaset$" set\_if = "$mongodb\_replcheck$" description = "Connect to replicaset" }

In the Service object I set replchck to true and define the replicaset:

check\_command = "mongodb" vars.mongodb\_port = "30000" vars.mongodb\_action = "replica\_primary" vars.mongodb\_replicaset = "rs-cache" vars.mongodb\_replcheck= true

Works now.

Changesets

2016-01-18 14:43:51 +00:00 by Napsty da85c7a

Fix mongodb CheckCommand

Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>

fixes #10979

2016-02-23 08:28:15 +00:00 by Napsty a19527f

Fix mongodb CheckCommand

Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>

fixes #10979

Subtasks:

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 18, 2016

Updated by Napsty on 2016-01-18 13:48:16 +00:00

Sorry for the ugly format above, I had some problems with the WYSIWYG form.

When checking the primary server of a replica set (replica_primary) in MongoDB this requires the usage of -r/--replicaset parameter.
In the current config the command definition lacks the value of the option:

                "--replicaset" = {
                        set_if = "$mongodb_replicaset$"
                        description = "Connect to replicaset"
                }

The value is mandatory to use, see command line:

$ /usr/lib/nagios/plugins/check_mongodb.py -H mongodbserver -P 27001 -A replica_primary 
replicaset must be passed in when using replica_primary check

$ /usr/lib/nagios/plugins/check_mongodb.py -H mongodbserver -P 27001 -A replica_primary -r my-set 
OK - Primary server has not changed 

I adapted it in the following way so the value is used:

                "--replicaset" = {
                        value = "$mongodb_replicaset$"
                        set_if = "$mongodb_replcheck$"
                        description = "Connect to replicaset"
                }

In the Service object I set replchck to true and define the replicaset:

  check_command = "mongodb"
  vars.mongodb_port = "30000"
  vars.mongodb_action = "replica_primary"
  vars.mongodb_replicaset = "rs-cache"
  vars.mongodb_replcheck= true

Works now.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 18, 2016

Updated by jflach on 2016-01-18 13:52:25 +00:00

I don't know much about mongodb but since you already have a solution you can make our life a lot easier with a git formatted patch :)

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 18, 2016

Updated by Napsty on 2016-01-18 14:08:00 +00:00

Was already on it ;-)
#63

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 18, 2016

Updated by Napsty on 2016-01-18 14:44:24 +00:00

  • Status changed from New to Resolved
  • Done % changed from 0 to 100

Applied in changeset da85c7a.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 18, 2016

Updated by jflach on 2016-01-18 14:46:04 +00:00

  • Target Version set to 2.5.0
  • Done % changed from 100 to 0
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 25, 2016

Updated by mfriedrich on 2016-01-25 10:39:49 +00:00

  • Target Version changed from 2.5.0 to 2.4.2
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Feb 23, 2016

Updated by gbeutner on 2016-02-23 09:58:41 +00:00

  • Backport? changed from Not yet backported to Already backported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.