(No output on stdout) stderr: File "/usr/local/nagios/libexe
-
nagiosiqraa
- Posts: 4
- Joined: Mon Nov 08, 2021 12:25 am
(No output on stdout) stderr: File "/usr/local/nagios/libexe
Hi, I have initially installed Nagios XI on Ubuntu server A and installed linux-nrpe-agent on the client Machines and configured services and MongoDB to monitor.
Later the Ubuntu Server A got Damaged and reinstalled the Nagios XI on another Ubuntu server with a different IP. And the I changed the Ip in every linux-nrpe-agent using the steps:
Step 1. sudo nano /etc/xinetd.d/nrpe
In this file, only_from = 127.0.0.1 <Nagios XI new server IP>
Step 2. sudo service xinetd restart
In this way, I was able to connect the New Nagios XI with all the Linux-Nrpe-Agents.
But when I tried configuring MongoDB I'm getting this warning/error:
(No output on stdout) stderr: File "/usr/local/nagios/libexec/check_mongodb.py", line 57
I tried on multiple servers but on all the servers I'm getting the same issue. Then I tried uninstall one linux-nrpe-agent and re-installed it but still, the issue persists. So any suggestion on how to fix it?? (but on the initial installation with Ubuntu Server A it was working fine)
Later the Ubuntu Server A got Damaged and reinstalled the Nagios XI on another Ubuntu server with a different IP. And the I changed the Ip in every linux-nrpe-agent using the steps:
Step 1. sudo nano /etc/xinetd.d/nrpe
In this file, only_from = 127.0.0.1 <Nagios XI new server IP>
Step 2. sudo service xinetd restart
In this way, I was able to connect the New Nagios XI with all the Linux-Nrpe-Agents.
But when I tried configuring MongoDB I'm getting this warning/error:
(No output on stdout) stderr: File "/usr/local/nagios/libexec/check_mongodb.py", line 57
I tried on multiple servers but on all the servers I'm getting the same issue. Then I tried uninstall one linux-nrpe-agent and re-installed it but still, the issue persists. So any suggestion on how to fix it?? (but on the initial installation with Ubuntu Server A it was working fine)
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hello @nagiosiqraa
Thanks for reaching out, let's verify some things from the command line:
Let's 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.
Run command to spin up help:
Do you receive the help dialog. What if you pass it some variables to monitor your mongodb server? Use the help page to setup your check properly, below is just an example:
Thanks,
Perry
Thanks for reaching out, let's verify some things from the command line:
Let's verify that you can see the open ports appropriate from your nagios server:
Code: Select all
yum or apt install nmap
nmap mongo.db.server.ip -pXRun command to spin up help:
Code: Select all
cd /usr/local/nagios/libexec
./check_mongodb.py -hCode: Select all
./check_mongodb.py -H x.x.x.x -P port -u USER -p PASSWDCode: Select all
/usr/local/nagios/libexec/check_mongodb.py -H x.x.x.x -u USER -p PASSWD -d DATABASEPerry
-
nagiosiqraa
- Posts: 4
- Joined: Mon Nov 08, 2021 12:25 am
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hi Perry,
Thanks for the reply.
When I tried :
It was OK.
And next when I tried :
I got an error:
when I tried this
I got the same error.
Thanks for the reply.
When I tried :
Code: Select all
nmap mongo.db.server.ip -p XAnd next when I tried :
Code: Select all
cd /usr/local/nagios/libexec
./check_mongodb.py -h
Code: Select all
./check_mongodb.py -H x.x.x.x -P port -u USER -p PASSWDI got the same error.
You do not have the required permissions to view the files attached to this post.
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hello @nagiosiraa
Thanks for following up, wanted to circle back and find out if you received similar results when using the MongoDB database configuration wizard?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Please let me know the results,
Perry
Thanks for following up, wanted to circle back and find out if you received similar results when using the MongoDB database configuration wizard?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Please let me know the results,
Perry
-
nagiosiqraa
- Posts: 4
- Joined: Mon Nov 08, 2021 12:25 am
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hi Perry,
I tried using the MongoDB database configuration wizard but got the same issue
PS: I think other services doesn't have any issues
I tried using the MongoDB database configuration wizard but got the same issue
Code: Select all
(No output on stdout) stderr: File "/usr/local/nagios/libexec/check_mongodb.py", line 57
except ImportError, e:
^
SyntaxError: invalid syntaxYou do not have the required permissions to view the files attached to this post.
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hello @nagiosiqraa
Thanks for following up, I have spun up a test environment and I am receiving the same error message and will be working through this and will let you know what I find.
Looking at the 'check_mongodb' script we see that it is using '#!/usr/bin/env python3.6'.
On your Nagios XI server environment let's check on python:
and also a list:
Please let us know what you get on these.
Thanks,
Perry
Thanks for following up, I have spun up a test environment and I am receiving the same error message and will be working through this and will let you know what I find.
Looking at the 'check_mongodb' script we see that it is using '#!/usr/bin/env python3.6'.
On your Nagios XI server environment let's check on python:
Code: Select all
which pythonCode: Select all
ls -lahrt /usr/bin/python*Thanks,
Perry
-
nagiosiqraa
- Posts: 4
- Joined: Mon Nov 08, 2021 12:25 am
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hi Perry,
Thanks for following up on the issue.
The output you asked for.
Somehow I have found a way to fix the issue but I'm not sure whether is it the right way or not. While I was going through the check_mongodb.py file I found that it was using python 2 syntax (for example in the print statement, except and all) So what I did is I replaced the content of check_mongodb.py with python3 which I found in this: https://github.com/mzupan/nagios-plugin ... mongodb.py
Now it's working I am able to monitor MongoDB Servers but I'm sure is the right way or not, will it have some other impacts Can you confirm?
For Your reference, I will add both files.
1. The original check_mongodb.py (which has the issue): 2. The check_mongodb.py that I replaced:
Thanks for following up on the issue.
The output you asked for.
Somehow I have found a way to fix the issue but I'm not sure whether is it the right way or not. While I was going through the check_mongodb.py file I found that it was using python 2 syntax (for example in the print statement, except and all) So what I did is I replaced the content of check_mongodb.py with python3 which I found in this: https://github.com/mzupan/nagios-plugin ... mongodb.py
Now it's working I am able to monitor MongoDB Servers but I'm sure is the right way or not, will it have some other impacts Can you confirm?
For Your reference, I will add both files.
1. The original check_mongodb.py (which has the issue): 2. The check_mongodb.py that I replaced:
You do not have the required permissions to view the files attached to this post.
Re: (No output on stdout) stderr: File "/usr/local/nagios/li
Hello @nagiosiqraa
I was looking over the 'check_mongodb.py' last night and noticed that as well. Even though it specifies python3 environment it is referencing python2 code.
Please let us know if there is anything further, otherwise you are good to go,
Perry
I was looking over the 'check_mongodb.py' last night and noticed that as well. Even though it specifies python3 environment it is referencing python2 code.
Please let us know if there is anything further, otherwise you are good to go,
Perry