Cassandra Monitoring plugin not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sandeep09412
Posts: 9
Joined: Mon Aug 28, 2017 6:55 am

Cassandra Monitoring plugin not working

Post by sandeep09412 »

Hi,

I am following below documentation for Cassandra monitoring.

https://assets.nagios.com/downloads/nag ... ios_XI.pdf

I am facing issue in executing command on Nagios Xi server.

# /usr/local/nagios/libexec/check_nrpe -H 10.30.0.169 -c cassandra

I am getting this.

CASSANDRA CRITICAL - cannot run /home/user/apache-cassandra-3.0.14/bin/nodetool;

Can you please help me with this.
Last edited by sandeep09412 on Wed Aug 30, 2017 1:06 am, edited 1 time in total.
bolson

Re: Cassandra Monitoring plugin not working

Post by bolson »

Hello,

This appears to be a configuration issue or a permissions issue. Pleas post the output of the following from the remote host. (The Cassandra host):

Code: Select all

ls -l /home/user/apache-cassandra-3.0.14/bin/nodetool
sandeep09412
Posts: 9
Joined: Mon Aug 28, 2017 6:55 am

Re: Cassandra Monitoring plugin not working

Post by sandeep09412 »

Code: Select all

-rwxrwxrwx. 1 user user  3359 Jun 20 04:19 nodetool
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Cassandra Monitoring plugin not working

Post by dwhitfield »

On the remote host, what is the output of the following

Code: Select all

find / -name nodetool
/home/user/apache-cassandra-3.0.14/bin/nodetool
sestatus
Also, can you please post the exact command you are using...that check_nrpe command is not valid. It may be something simply, but I want to see for sure.
bolson

Re: Cassandra Monitoring plugin not working

Post by bolson »

Please execute the following command on your Cassandra server:

Code: Select all

nodetool status 
And post the output.
sandeep09412
Posts: 9
Joined: Mon Aug 28, 2017 6:55 am

Re: Cassandra Monitoring plugin not working

Post by sandeep09412 »

I have checked cassandra is working fine and path to nodetool is correct and nodetool is having executable permission for everyone.

I am executing below caommand on cassandra server as specified in documentation.

# /usr/local/nagios/libexec/check_nrpe -H 10.30.0.169 -c cassandra

I am getting this.
CASSANDRA CRITICAL - cannot run /home/user/apache-cassandra-3.0.14/bin/nodetool;

Code: Select all

[user@localhost libexec]$ nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens       Owns (effective)  Host ID                               Rack
UN  127.0.0.1  228.37 KiB  256          100.0%            a3c12454-d92e-4e48-82ae-6e0a19563304  rack1

Code: Select all

[user@localhost bin]$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
When i excute the plugin script through perl its working

Code: Select all

[user@localhost libexec]$ perl cassandra.pl 
CASSANDRA OK -  | heap_mem=9.33 
Its giving that issues when the plugin script is run through check_npre
bolson

Re: Cassandra Monitoring plugin not working

Post by bolson »

I suspect that your issue is related to selinux. Can you disable selinux on that host momentarily as a test?
sandeep09412
Posts: 9
Joined: Mon Aug 28, 2017 6:55 am

Re: Cassandra Monitoring plugin not working

Post by sandeep09412 »

I am using Centos7.

Still same after disableing selinux

Code: Select all

[user@localhost libexec]$ sestatus
SELinux status:                 disabled
bolson

Re: Cassandra Monitoring plugin not working

Post by bolson »

Please execute locally on the cassandra host:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c cassandra
And post the result. We need to determine if the issue is communication, authentication, or permissions.
sandeep09412
Posts: 9
Joined: Mon Aug 28, 2017 6:55 am

Re: Cassandra Monitoring plugin not working

Post by sandeep09412 »

To check the issue i have reinstalled cassandra at other place but issue is still there.

Please find below the command output received at cassandra server

Code: Select all

[user@localhost libexec]$ /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c cassandra
CASSANDRA CRITICAL -  cannot run /home/user/Downloads/apache-cassandra-3.11.0/bin/nodetool;
NRPE logs from /etc/log/message for the above command on cassandra server

Code: Select all

[root@localhost log]# tail -f messages 
Aug 31 15:14:39 localhost xinetd[1106]: START: nrpe pid=4304 from=::ffff:127.0.0.1
Aug 31 15:14:40 localhost nrpe[4304]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Aug 31 15:14:40 localhost nrpe[4305]: ERROR: my_system() seteuid(0): Operation not permitted
Aug 31 15:14:40 localhost xinetd[1106]: EXIT: nrpe status=0 pid=4304 duration=1(sec)
From cassandra server

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H 10.30.0.169 -c cassandra
CASSANDRA CRITICAL -  cannot run /home/user/Downloads/apache-cassandra-3.11.0/bin/nodetool;
NRPE logs from /etc/log/message for the above command on cassandra server

Code: Select all

[root@localhost log]# tail -f messages 
Aug 31 15:10:32 localhost xinetd[1106]: START: nrpe pid=4208 from=::ffff:10.30.0.206
Aug 31 15:10:32 localhost nrpe[4208]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Aug 31 15:10:32 localhost nrpe[4209]: ERROR: my_system() seteuid(0): Operation not permitted
Aug 31 15:10:33 localhost xinetd[1106]: EXIT: nrpe status=0 pid=4208 duration=1(sec)
Locked