Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
@pmoradiya, That might be the cause of this problem. When you're running the command with -u tomcat8 the system is trying to run it in a shell. Please enable the shell access for this user:
1. Open /etc/passwd file and look for tomcat8 username.
2. Change the ending from /sbin/nologin to /bin/bash
*After that please make sure that you can logion with su - tomcat8.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko wrote:@pmoradiya, That might be the cause of this problem. When you're running the command with -u tomcat8 the system is trying to run it in a shell. Please enable the shell access for this user:
1. Open /etc/passwd file and look for tomcat8 username.
2. Change the ending from /sbin/nologin to /bin/bash
*After that please make sure that you can logion with su - tomcat8.
The nagios user is able to switch to tomcat8 and can run the nrpe command as below:
@pmoradiya, When you run the command locally you're using a shell. But NRPE doesn't run with a shell. And then I believe when NRPE sees -u tomcat8 it tries to actually run the following command using a shell. But tomcat8 does not have a shell. Does that make sense?
Let's try to change the command in nrpe.cfg file(for sake of the experiment):
Which I believe piggy-backs off the shell of the parent process's user (but I am so totally not a glibc expert).
Surprisingly I can't find much information on how popen handles this particular situation, but I can't imagine popen is going to have a concept of what shell should be used for a given execution beyond the user under which the parent process is running (for security reasons among others). In a nutshell, it's entirely possible Bash (your nagios user's shell) is taking some liberties in this particular situation that popen cannot. Liberties like passing the current shell off to the targeted user.
For this reason, you might also try specifying a shell in your command definition:
Thanks @mcapra and @npolovenko for your detailed attention to this. I tried adding bash or sh to the command definition that returned "Unable to read output"
@pmoradiya, In your first post you mentioned that this exact plugin works just fine on another client servers. Let's assume for now that it is the NRPE compatibility issue. Can you check what version of NRPE do the other servers have? nrpe -V
You could remove the new nrpe client from the servers using this tutorial:https://support.nagios.com/kb/article/n ... -nrpe.html
Before you do that I'd make a copy of /usr/local/nagios/nrpe.cfg file and save it somewhere safe.
Then you can install the older version instead. If you tell us which version you need I can provide you with a download link. https://sourceforge.net/projects/nagios/files/nrpe-2.x/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko wrote:@pmoradiya, In your first post you mentioned that this exact plugin works just fine on another client servers. Let's assume for now that it is the NRPE compatibility issue. Can you check what version of NRPE do the other servers have? nrpe -V
You could remove the new nrpe client from the servers using this tutorial:https://support.nagios.com/kb/article/n ... -nrpe.html
Before you do that I'd make a copy of /usr/local/nagios/nrpe.cfg file and save it somewhere safe.
Then you can install the older version instead. If you tell us which version you need I can provide you with a download link. https://sourceforge.net/projects/nagios/files/nrpe-2.x/
All my client servers are running the same version (v3.2.1), installed and configured exactly the same way.