NRPE: Unable to read output
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: NRPE: Unable to read output
Hi,
[root@cleint_nrpe~]# more /usr/local/nagios/libexec/check_site.sh
#!/bin/bash
sudo /home/nagios/apache-jmeter-3.0/bin/jmeter.pl -j /home/nagios/apache-jmeter-3.0/ -p /home/nagios/apache-jmeter-3.0/bin/dermsl01_buono.jmx -w 15 -c 30
Thanks.
Natalia
[root@cleint_nrpe~]# more /usr/local/nagios/libexec/check_site.sh
#!/bin/bash
sudo /home/nagios/apache-jmeter-3.0/bin/jmeter.pl -j /home/nagios/apache-jmeter-3.0/ -p /home/nagios/apache-jmeter-3.0/bin/dermsl01_buono.jmx -w 15 -c 30
Thanks.
Natalia
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: NRPE: Unable to read output
We will leave this open for community input. Unfortunately, we cannot fully support custom development.
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: NRPE: Unable to read output
Any suggestions?
Thanks everyone.
Natalia.
Thanks everyone.
Natalia.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: NRPE: Unable to read output
Looking back through the thread, we never got a description of what it is you are trying to accomplish with your script. If you could explain that, we can help better with the script. Thanks!
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: NRPE: Unable to read output
EDIT: Please use code tags
Hi,
I need to monitor my website, I created a jmeter test and now with help of nrpe I need to monitor my website.
Jmeter try to login and check availability from more parts of the site and check the response times.
ex:
Thanks.
Natalia
Hi,
I need to monitor my website, I created a jmeter test and now with help of nrpe I need to monitor my website.
Jmeter try to login and check availability from more parts of the site and check the response times.
ex:
Code: Select all
[root@client_nrpe ~]# /usr/local/nagios/libexec/check_site.sh
OK : sum:2542 : 2.542 seconds to complete.
Code: Select all
[root@client_nrpe ~]# su - nrpe
-bash-4.1$ sudo /usr/local/nagios/libexec/check_site.sh
+ sudo /usr/local/nagios/libexec/apache-jmeter-3.0/bin/jmeter.pl -j /usr/local/nagios/libexec/apache-jmeter-3.0/ -p /usr/local/nagios/libexec/apache-jmeter-3.0/bin/dermsl01_buono.jmx -w 15 -c 30
OK : sum:5656 : 5.656 seconds to complete.
-bash-4.1$ sudo /usr/local/nagios/libexec/check_nrpe -H localhost -c check_jmeter
NRPE: Unable to read output
-bash-4.1$ sudo /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
USERS OK - 1 users currently logged in |users=1;5;10;0
-bash-4.1$ sudo /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
OK - load average: 0.00, 0.01, 0.00|load1=0.000;15.000;30.000;0; load5=0.010;10.000;25.000;0; load15=0.000;5.000;20.000;0;
Natalia
Re: NRPE: Unable to read output
On the remote machine, can you share the contents of /usr/local/nagios/libexec/check_site.sh? Be sure to sanitize any JMX credentials in-use.
Can you also share the output of the following command from the remote machine's CLI:
ls -al /usr/local/nagios/libexec/
Can you also share the output of the following command from the remote machine's CLI:
ls -al /usr/local/nagios/libexec/
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: NRPE: Unable to read output
[root@client_nrpe]# more /usr/local/nagios/libexec/check_site.sh
#!/bin/bash
sudo /usr/local/nagios/libexec/apache-jmeter-3.0/bin/jmeter.pl -j /usr/local/nagios/libexec/apache-jmeter-3.0/ -p /usr/local/nagios/libexec/apache-jmeter-3.0/bin/de_buono.jmx
I attached the list
"ls -al /usr/local/nagios/libexec/"
Thanks.
Natalia
#!/bin/bash
sudo /usr/local/nagios/libexec/apache-jmeter-3.0/bin/jmeter.pl -j /usr/local/nagios/libexec/apache-jmeter-3.0/ -p /usr/local/nagios/libexec/apache-jmeter-3.0/bin/de_buono.jmx
I attached the list
"ls -al /usr/local/nagios/libexec/"
Thanks.
Natalia
- Attachments
-
- listanrpe.txt
- (4.16 KiB) Downloaded 336 times
Re: NRPE: Unable to read output
I see that you have debugging enabled in the nrpe.cfg file, when that command that creates the error is run, you you see any errors in the syslog files which are usually in the /var/log folder?
Another thing to try is to edit the script and put the full path to the sudo command and see if that helps.
Another thing to try is to edit the script and put the full path to the sudo command and see if that helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 29
- Joined: Mon Aug 22, 2016 8:14 am
Re: NRPE: Unable to read output
Hi,
1. there are the log :
Connection from localhost port 9097
Host address is in allowed_hosts
Handling the connection...
Host is asking for command 'check_jmeter' to be run...
Running command: /usr/bin/sudo /usr/local/nagios/libexec/check_site.sh
Command completed with return code 1 and output:
Return Code: 1, Output: NRPE: Unable to read output
Connection from ▒▒▒h▒#177 closed.
Connection from localhost port 9609
Host address is in allowed_hosts
Handling the connection...
Host is asking for command 'check_swap' to be run...
Running command: /usr/bin/sudo /usr/local/nagios/libexec/check_swap -w 20% -c 10%
Command completed with return code 1 and output:
Return Code: 1, Output: NRPE: Unable to read output
Connection from ▒▒▒h▒#177 closed.
I created new plugin for another test "check_swap" and I have the same output, I think I missing sudo but I don't know where.
But when I exec check_swap manualy the function is correctly:
[root@client_nrpe ~]# /usr/local/nagios/libexec/check_swap -w 20% -c 10%
SWAP OK - 100% free (4077 MB out of 4094 MB) |swap=4077MB;818;409;0;4094
2. Yes I try but the output is same.
Thanks.
Natalia
1. there are the log :
Connection from localhost port 9097
Host address is in allowed_hosts
Handling the connection...
Host is asking for command 'check_jmeter' to be run...
Running command: /usr/bin/sudo /usr/local/nagios/libexec/check_site.sh
Command completed with return code 1 and output:
Return Code: 1, Output: NRPE: Unable to read output
Connection from ▒▒▒h▒#177 closed.
Connection from localhost port 9609
Host address is in allowed_hosts
Handling the connection...
Host is asking for command 'check_swap' to be run...
Running command: /usr/bin/sudo /usr/local/nagios/libexec/check_swap -w 20% -c 10%
Command completed with return code 1 and output:
Return Code: 1, Output: NRPE: Unable to read output
Connection from ▒▒▒h▒#177 closed.
I created new plugin for another test "check_swap" and I have the same output, I think I missing sudo but I don't know where.
But when I exec check_swap manualy the function is correctly:
[root@client_nrpe ~]# /usr/local/nagios/libexec/check_swap -w 20% -c 10%
SWAP OK - 100% free (4077 MB out of 4094 MB) |swap=4077MB;818;409;0;4094
2. Yes I try but the output is same.
Thanks.
Natalia
Re: NRPE: Unable to read output
Try logging in to the remote system and change to the nrpe user by running
Then run the command that you have defined in the nrpe.cfg line the example below.
You will probable see and error similar to below.
Sorry, user nrpe is not allowed to execute '/usr/local/nagios/libexec/check_swap -w 20% -c 10%' as root on localhost.localdomain.
If you see that error, try running it without sudo in the command like the following
If it works, remove the /usr/bin/sudo from your commands and that should fix it for you.
One thing to note, you are running the agent as the nrpe user and the plugins are installed as the nagios user account.
You may have to adjust the owner of the plugins to the nrpe user to get them to function.
Code: Select all
su nrpe
Code: Select all
/usr/bin/sudo /usr/local/nagios/libexec/check_swap -w 20% -c 10%
Sorry, user nrpe is not allowed to execute '/usr/local/nagios/libexec/check_swap -w 20% -c 10%' as root on localhost.localdomain.
If you see that error, try running it without sudo in the command like the following
Code: Select all
/usr/local/nagios/libexec/check_swap -w 20% -c 10%
One thing to note, you are running the agent as the nrpe user and the plugins are installed as the nagios user account.
You may have to adjust the owner of the plugins to the nrpe user to get them to function.
Be sure to check out our Knowledgebase for helpful articles and solutions!