Hi,
We wrote a script on the client machine which is a Linux server.
When we execute the script at command prompt it is giving correct result.
[root@host1 tmp]# sh /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
No blocking sessions
We defined it in /etc/nagios/nrpe.cfg file as follows
command[check_blocking_sessions]=/usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
When we invoke the script from Nagios server, we are getting following error
[root@nagios libexec]# ./check_nrpe -H host1 -c check_blocking_sessions
NRPE: Unable to read output
Later we add sudo to the following
command[check_blocking_sessions]=sudo /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
and made an entry in /etc/sudoers
nagios ALL= NOPASSWD: /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
no requiretty defined in /etc/sudoers
[root@host1 ce]# cat /etc/sudoers|grep requiretty
[root@host1 ce]#
but no luck.
Ofcourse, we restarted nrpe daemon whenever me made changes in nrpe.cfg file.
Following are the directory and file permissions.
[root@host1 ce]# ls -ld /usr/lib64/nagios/plugins/ce/
drwxr-xr-x. 1 root root 210 May 5 17:00 /usr/lib64/nagios/plugins/ce/
[root@host1 ce]# ls -l /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
-rwxr-xr-x. 1 root root 634 May 5 16:58 /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
Where we went wrong?
NRPE: Unable to read output
Re: NRPE: Unable to read output
Did you add the Nagios user to the sudoers?
Please refer to the following help article for more possible causes. Is there anything in that article that you haven't considered?
https://support.nagios.com/kb/article/n ... t-620.html
Code: Select all
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/additional/check_openmanagehttps://support.nagios.com/kb/article/n ... t-620.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE: Unable to read output
[quote="jbrunkow"]Did you add the Nagios user to the sudoers?
Following is the entry in /etc/sudoers file
nagios ALL= NOPASSWD: /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
Code: Select all
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/additional/check_openmanagenagios ALL= NOPASSWD: /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
-
raosri1992
- Posts: 14
- Joined: Thu May 07, 2020 8:46 am
Re: NRPE: Unable to read output
I'm having same problems. Custom scripts works fine on the Remote server on which NRPE agent is installed. When I try to invoke the scripts from nagios server I'm getting same error.
I trying this scripts https://github.com/colebrooke/kubernetes-nagios
Let me know if you get an answer for this.
I trying this scripts https://github.com/colebrooke/kubernetes-nagios
Let me know if you get an answer for this.
-
raosri1992
- Posts: 14
- Joined: Thu May 07, 2020 8:46 am
Re: NRPE: Unable to read output
HI Pratap,
Which version of NRPE agent are you running?
Thanks,
Srikanth
Which version of NRPE agent are you running?
Thanks,
Srikanth
-
raosri1992
- Posts: 14
- Joined: Thu May 07, 2020 8:46 am
Re: NRPE: Unable to read output
Pratapa wrote:jbrunkow wrote:Did you add the Nagios user to the sudoers?Following is the entry in /etc/sudoers fileCode: Select all
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/additional/check_openmanage
nagios ALL= NOPASSWD: /usr/lib64/nagios/plugins/ce/check_blocking_sessions.sh
##############My Analysis######33
I'm having similar problem. I have tested these scripts https://github.com/colebrooke/kubernetes-nagios using NRPE 4.0.3 and NRPE 3.2.1
What is the root cause, can anyone help us.