Page 1 of 1

my script not run through nrpe but can run it without nrpe

Posted: Mon Jun 10, 2019 6:37 am
by baber
Dear friend
Hi

i have write script but when i run it in my os the out put is ok but while run that through nrpe it cannot show correct output

i have attache the script

this is my output

Code: Select all

[root@rac1 tmp]# ./check_my_hwclock.sh
Hardware clock is OK
[root@rac1 tmp]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_my_hwclock
Hardware clock has Problem
[root@rac1 tmp]#


Re: my script not run through nrpe but can run it without nr

Posted: Mon Jun 10, 2019 10:01 am
by scottwilkerson
Can this be run by your NRPE user (nagios or nrpe)? Does it need elevated permissions?

Code: Select all

su nagios
./check_my_hwclock.sh

Re: my script not run through nrpe but can run it without nr

Posted: Mon Jun 10, 2019 8:39 pm
by baber
Dear friend
nagios user is nologin

Code: Select all

[root@rac1 ~]# cat /etc/passwd | grep nagios
nagios:x:1000:1000::/home/nagios:/sbin/nologin


actually while use su nagios will be show

Code: Select all

[root@rac1 ~]# su nagios
This account is currently not available.


Re: my script not run through nrpe but can run it without nr

Posted: Tue Jun 11, 2019 6:56 am
by scottwilkerson
Can you temp change it to /bin/bash so you can see the results of running this as the user that will actually be executing the checks?