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

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.
Locked
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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]#

Attachments
check_my_hwclock.sh
(464 Bytes) Downloaded 235 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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.

scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked