NRPE: Unable to read output

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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Post by tgriep »

Can you post your full nrpe.cfg file from that remote system.
Can you login as root to that server, run the following command and post the /tmp/ls.txt file?
lr -lR /apps/nagios >/tmp/ls.txt

Also, take a look at the NRPE troubleshooting guide and on page 17 has tips for the error you are having.
https://assets.nagios.com/downloads/nag ... utions.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
rahul.srivastava1
Posts: 21
Joined: Mon Feb 06, 2017 6:44 am

Re: NRPE: Unable to read output

Post by rahul.srivastava1 »

Hi,

I am attaching the nrpe.cfg and ls.txt files from the remote server.

Also,i have gone through the documents which you suggested. It did not solve our issue.
We are struggling with this one command. Others are working fine.



Regards,
Rahul
Attachments
ls.txt
(80.32 KiB) Downloaded 136 times
nrpe.cfg
(8.24 KiB) Downloaded 145 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Post by tgriep »

Can you post these files

Code: Select all

check_jmx
jmx.cfg
From this folder

Code: Select all

/apps/nagios/libexec/nagios-jmx-plugin-1.2.3
so we can view the settings?

Also, check the syslog files on the remote server for any errors that could help and post them here.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rahul.srivastava1
Posts: 21
Joined: Mon Feb 06, 2017 6:44 am

Re: NRPE: Unable to read output

Post by rahul.srivastava1 »

Hi,

I am attaching the check_jmx and jmx.cfg files from /apps/nagios/libexec/nagios-jmx-plugin-1.2.3 path.


Syslog only shows the below:
ssb-voor-01 nrpe[18471]: [ID 927837 mail.info] connect from ssbpops01.ssb.sungard.com


here ssb-voor-01 is our remote server and ssbpops01.ssb.sungard.com is ournagios server

Regards,
Rahul
Attachments
jmx.cfg
(206 Bytes) Downloaded 145 times
rahul.srivastava1
Posts: 21
Joined: Mon Feb 06, 2017 6:44 am

Re: NRPE: Unable to read output

Post by rahul.srivastava1 »

Seems like i am unable to upload check_jmx file. It has FILE extension.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Post by tgriep »

In the ls.txt file, it doesn't show an extension for one of the check_jmx files. In that folder is a check_jmx and a check_jmx.jar file but I shouldn't need to see the check_jmx.jar file.
Try running these command instead and post the output.

Code: Select all

cat /apps/nagios/libexec/nagios-jmx-plugin-1.2.3/check_jmx
cat /apps/nagios/libexec/nagios-jmx-plugin-1.2.3/README.txt
Be sure to check out our Knowledgebase for helpful articles and solutions!
rahul.srivastava1
Posts: 21
Joined: Mon Feb 06, 2017 6:44 am

Re: NRPE: Unable to read output

Post by rahul.srivastava1 »

Hi,

Here are the outputs:

1. cat /apps/nagios/libexec/nagios-jmx-plugin-1.2.3/check_jmx

Code: Select all

#!/bin/sh
#
# Nagios JMX plugin.
#

JAVA_CMD=`which java`

if [ -z $JAVA_CMD ]
then

  if [ -x $JAVA_HOME/bin/java ]
  then
    JAVA_CMD=$JAVA_HOME/bin/java
  else
    echo JMX CRITICAL - java not found.
    exit 2
  fi

fi

DIR=`dirname $0`
$JAVA_CMD -jar $DIR/check_jmx.jar "$@"

2. cat /apps/nagios/libexec/nagios-jmx-plugin-1.2.3/README.txt

Code: Select all

Copyright 2009 Felix Roethenbacher

*******************************************************************************
*                                                                             *
* Nagios JMX Plugin                                                           *
*                                                                             *
*******************************************************************************

Version 1.2.3


Copy

  - check_jmx
  - check_jmx.jar

to your Nagios plugin directory.

For a couple of sample command definitions copy

  - jmx.cfg

to your Nagios plugin configuration directory.


For further information see http://snippets.syabru.ch/nagios-jmx-plugin/index.html
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Post by tgriep »

Can you login to the remote server, run the following commands and post the output?

Code: Select all

su nagios
/apps/nagios/libexec/nagios-jmx-plugin-1.2.3/check_jmx -U service:jmx:rmi:///jndi/rmi://168.162.97.143:7780/jmxrmi -O jboss.system:type=ServerInfo -A TotalMemory -w 3247300864 -c 3251495168
ls -l /usr/sh
which java
env |grep JAVA
I do have a question, does the Nagios server have access directly to the server at IP Address 168.162.97.143?
If so, why not install the plugin on the Nagios server and run it from there.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rahul.srivastava1
Posts: 21
Joined: Mon Feb 06, 2017 6:44 am

Re: NRPE: Unable to read output

Post by rahul.srivastava1 »

Hi,

su nagiois
[nagios@ssb-voor-01]:~ $ /apps/nagios/libexec/nagios-jmx-plugin-1.2.3/check_jmx -U service:jmx:rmi:///jndi/rmi://168.162.97.143:7780/jmxrmi -O jboss.system:type=ServerInfo -A TotalMemory -w 3247300864 -c 3251495168
JMX OK - TotalMemory = 3147300864 | 'TotalMemory'=3147300864;3247300864;3251495168;;



[nagios@ssb-voor-01]:~ $ ls -l /usr/sh
ls: cannot access /usr/sh: No such file or directory

[nagios@ssb-voor-01]:~ $ which java
/usr/java7u121/jdk1.7.0_121/bin/java

Also, about running the plugin from nagios server, i will see what are the possibilities.

Regards,
Rahul
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Post by tgriep »

I setup the same check_jmx plugin on a Solaris 10 system, configures a check command in nrpe and it worked for me when I tested it from my nagios server

Code: Select all

./check_nrpe -H 192.168.112.159 -c check_jmx                                                                            
JMX OK - HeapMemoryUsage.used = 13249136 | 'HeapMemoryUsage used'=13249136;;;;.
The only thing I can thing of is after editing the nrpe.cfg file, you did not restart the NRPE Agent so it did not pickup the changes.
Running the following command reloaded the nrpe agent on my system. You may have to edit the service name to match your environment.

Code: Select all

svcadm restart svc:/network/nrpe/tcp:default
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked