Hi Team,
Following the Nagios upgrade from 5.7.8 to the latest version on Ubuntu, all services and hosts are functioning as expected, except for the MongoDB monitoring script (/usr/local/nagios/libexec/check_mongodb.py). This is due to Python version incompatibility. The old Nagios server (CentOS 7) uses Python 2.17, while the new server uses Python 3.12.3. Please provide an updated script compatible with the latest Nagios version and Python 3.12.3 that will allow us to monitor all MongoDB statistics as before.
Refer the below screenshot
(No output on stdout) stderr: File "/usr/local/nagios/libexec/check_mongodb.py", line 57
MongoDB monitoring issue
Re: MongoDB monitoring issue
You might check if a python 2 is installed and if so edit the shebang line at the top of the script to use python2.
Re: MongoDB monitoring issue
After installing Python 2.7.5 and updating the shebang, I'm getting a "No module named pymongo" error.
Re: MongoDB monitoring issue
You might want to install it.
Re: MongoDB monitoring issue
do you have updated script that will support latest version of python.
Re: MongoDB monitoring issue
You may want to check the nagios exchange or the internet since this isn't likely to be a standard plugin.
Re: MongoDB monitoring issue
CRITICAL - General MongoDB Error: command find requires authentication, full error: {'ok': 0.0, 'errmsg': 'command find requires authentication', 'code': 13, 'codeName': 'Unauthorized', '$clusterTime': {'clusterTime': Timestamp(1747916204, 2), 'signature': {'hash': b'\xf4=\x939\xe2\x97\xbc\xbc\xf7\xe3\xd5\x88\x91\x02\r\xc7\xdb\xd1\xc0\xe7', 'keyId': 7462416246990962689}}, 'operationTime': Timestamp(1747916204, 2)}
Nagios monitoring of MongoDB connections is reporting the above response.
I have configured using nagios configuration wizards
Nagios monitoring of MongoDB connections is reporting the above response.
I have configured using nagios configuration wizards