nrpe.cfg reconfig?
Re: nrpe.cfg reconfig?
Yep that works fine. In fact, check_nrpe commands work fine for everything other than this plugin.
That said, I "think" I might have found the problem.
To allow the nagios user to run the necessary Cassandra command, I had to add it to the group that has permissions to run the Cassandra command (in addition to its primary nagios group of course).
However, when I look at the /etc/xinetd.d/nrpe file, I noticed that it has specified
user = nagios
group = nagios.
Could the problem be that "group" nagios does not have permission to run the Cassandra command? And if so, can I just add an additional group to this line in file, or does NRPE require that only one group is specified?
That said, I "think" I might have found the problem.
To allow the nagios user to run the necessary Cassandra command, I had to add it to the group that has permissions to run the Cassandra command (in addition to its primary nagios group of course).
However, when I look at the /etc/xinetd.d/nrpe file, I noticed that it has specified
user = nagios
group = nagios.
Could the problem be that "group" nagios does not have permission to run the Cassandra command? And if so, can I just add an additional group to this line in file, or does NRPE require that only one group is specified?
Re: nrpe.cfg reconfig?
Bummer, didn't work either. I even tried changing the user and group in the NRPE conf file to the Cassandra user, still gets the silly output 
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: nrpe.cfg reconfig?
Do you need to add this Cassandra command to sudoers?
What happens when you run the command on the remote server as the user nagios?
What happens when you run the command on the remote server as the user nagios?
Code: Select all
su nagios
/usr/local/nagios/libexec/check_cassandra_cluster.sh -H localhost -P 7199 -w 1 -c 0As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: nrpe.cfg reconfig?
I'm able to run the Cassandra command fine as user nagios, both locally on the machine and via ssh.
The only problem seems to be trying to run it via NRPE for some reason
The only problem seems to be trying to run it via NRPE for some reason
Re: nrpe.cfg reconfig?
Is "mytestcassandranode-c" a typo? You need to have a space there:./check_nrpe -H mytestcassandranode-c check_cassandra_cluster -a '-H mytestcassandranode -P 7199 -w 1 -c 0'
Code: Select all
./check_nrpe -H mytestcassandranode -c check_cassandra_cluster -a '-H mytestcassandranode -P 7199 -w 1 -c 0'Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: nrpe.cfg reconfig?
Yep it was just a typo, would've been awesome if it was the problemIs "mytestcassandranode-c" a typo? You need to have a space there
don't_blame_nrpe=1 is definitely defined, this is a totally clean virtual test environment so I started from scratch configuring the client properly to allow command arguments.Can you show us how the "check_cassandra_cluster" command is defined on the client (remote machine)? Also, do you have "dont_blame_nrpe=1" in the "nrpe.cfg" file?
However, I've now switched to a plugin written by someone who has the arguments actually hardcoded in plugin/script, but still have the same problem. With the new script that doesn't require arguments here is the command definition from the client nrpe file:
command[check_cassandra]=/usr/local/nagios/libexec/check_cassandra
I've also tried it by putting the exact host in the definition:
command[check_cassandra]=/usr/local/nagios/libexec/check_cassandra - H IPaddressofCassandrahost
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: nrpe.cfg reconfig?
I would double check that with your clean system that you compiled using --enable-command-argsxpac wrote:don't_blame_nrpe=1 is definitely defined, this is a totally clean virtual test environment so I started from scratch configuring the client properly to allow command arguments.
Defining the arguments in the command definition is the best way to diagnose the problem. If it doesn't work like this then there is something else going on.xpac wrote:command[check_cassandra]=/usr/local/nagios/libexec/check_cassandra - H IPaddressofCassandrahost
Now I know this is probably another typo but I'm going to point it out:
Code: Select all
command[check_cassandra]=/usr/local/nagios/libexec/check_cassandra - H IPaddressofCassandrahostCode: Select all
command[check_cassandra]=/usr/local/nagios/libexec/check_cassandra -H IPaddressofCassandrahostDoes the nagios user have a home directory on the remote host?
OK to share some thoughts about other things to look at.
I'm seen with NRPE running plugins in the past that the plugin itself might be using an internal command which works fine as the nagios user who is logged on, but when it's not in an interactive session then it fails.
An example of this is the "top" command.
Code: Select all
top -n 1Code: Select all
top -n 1 -bOne of the troubleshooting steps I take in this situation is to comment out all the lines in the script except for the first two and then test it with a minimal script. If that works then keep uncommenting lines until the problem appears.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: nrpe.cfg reconfig?
I would double check that with your clean system that you compiled using --enable-command-args
Yep this has been verified, I can run other plugins w/args just fine remotely via NRPE, such as "check_users"
Yep another typoNow I know this is probably another typo but I'm going to point it out:
It does, and I made sure the nagios user also can execute the necessary Cassandra commands both locally on that machine and remotely via ssh so we're good there.Does the nagios user have a home directory on the remote host?
I think I'll have to take a look at the plugin/s themselves next as you suggested. The problem definitely lies with NRPE and/or the plugin itself - as I mentioned earlier when I run the command via NRPE it IMMEDIATELY returns the incorrect value, the Cassandra command at the very minimum requires 4-5 seconds to run locally and produce the output (more if there is a problem or the Cassandra cluster is under a heavy workload), so there is no way the command is being properly executed.
Re: nrpe.cfg reconfig?
I haven't seen anyone ask if you have selinux enabled:
or
Code: Select all
getenforceCode: Select all
sestatusRe: nrpe.cfg reconfig?
In this test instance I have selinux set to permissive and iptables is stopped and set to off.ssax wrote:I haven't seen anyone ask if you have selinux enabled:
orCode: Select all
getenforce
Code: Select all
sestatus