Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mongodb.py", line 1372, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/nagios/libexec/check_mongodb.py", line 196, in main
err, con = mongo_connect(host, port, ssl, user, passwd, replicaset)
File "/usr/local/nagios/libexec/check_mongodb.py", line 294, in mongo_connect
return exit_with_general_critical(e), None
File "/usr/local/nagios/libexec/check_mongodb.py", line 310, in exit_with_general_critical
if e.strip() == "not master":
AttributeError: 'OperationFailure' object has no attribute 'strip'
Trying to monitor a mongo replica set, 2 data nodes 1 arb.
Mongo is running on the server and working fine for our applications, access between them is open. ClusterAdmin is set on the user.
Connection strings that pass -
check_mondb.py -h
check_mongodb.py -H IP -u "" -p ""
I am not sure why these are all failing. Any ideas?
check_mongodb.py
Re: check_mongodb.py
I read through an old post here @ https://support.nagios.com/forum/viewto ... =6&t=32945
Does the Nagios user have access to the Mongo DB? By default, it will only allow localhost.
Does the Nagios user have access to the Mongo DB? By default, it will only allow localhost.
Former Nagios Employee
Re: check_mongodb.py
My apologies I never recieved an email notification!
Yes the server/user does have access to mongo. Do we know if this supports mongo 3.0+ ? We aren't using SSL on these machines either that I am aware of just keyFiles, I noticed in the error its trying to put it into the connection string.
Yes the server/user does have access to mongo. Do we know if this supports mongo 3.0+ ? We aren't using SSL on these machines either that I am aware of just keyFiles, I noticed in the error its trying to put it into the connection string.
Re: check_mongodb.py
What is the exact syntax you are attempting to use with it?
Former Nagios Employee
Re: check_mongodb.py
I am using the mongo server wizard in XI but here is the result of one of the failed services. All of them are failing with the same error.
check_mongodb_server!collections!27017!300!500!USER!PASS
I attempted to debug some on the command line but never got passed the same error while specifying any information.
check_mongodb.py -H IP -u "" -p "" This command was intentionally sent with an empty user and password. IP is of course removed.
check_mongodb_server!collections!27017!300!500!USER!PASS
I attempted to debug some on the command line but never got passed the same error while specifying any information.
check_mongodb.py -H IP -u "" -p "" This command was intentionally sent with an empty user and password. IP is of course removed.
Re: check_mongodb.py
When it comes to that mongodb plugin, it has a tendency to stack trace instead of producing valuable error output. Please verify that you can see the open ports appropriate from your nagios server:
Where mongo.db.server.ip is the IP address of your mongodb server and X is the port number you use to auth against.
Code: Select all
yum install nmap
nmap mongo.db.server.ip -pXRe: check_mongodb.py
Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-18 13:01 MST
Nmap scan report for mongodbIP
Host is up (0.00040s latency).
PORT STATE SERVICE
27017/tcp open unknown
Port is open, are there any additional packages that are required with this plugin?
Nmap scan report for mongodbIP
Host is up (0.00040s latency).
PORT STATE SERVICE
27017/tcp open unknown
Port is open, are there any additional packages that are required with this plugin?
Re: check_mongodb.py
To add to this ive tried using the FQDN as well as the IP address
I
I
Re: check_mongodb.py
I noticed that you didn't specify a database. Try the following:check_mongodb.py -H IP -u "" -p "" This command was intentionally sent with an empty user and password. IP is of course removed.
./check_mongodb.py -H IP -u "" -p "" -d <database>
Are you targeting the master node or the replica sets?
Re: check_mongodb.py
I tried specifying a database still no luck same error.
I am wanting to monitor the replica set in its entirety.
I am wanting to monitor the replica set in its entirety.