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.
baber
Posts: 308 Joined: Wed Oct 21, 2015 4:39 am
Post
by baber » Mon Jun 10, 2019 6:37 am
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:
Post
by scottwilkerson » Mon Jun 10, 2019 10:01 am
Can this be run by your NRPE user (nagios or nrpe)? Does it need elevated permissions?
baber
Posts: 308 Joined: Wed Oct 21, 2015 4:39 am
Post
by baber » Mon Jun 10, 2019 8:39 pm
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:
Post
by scottwilkerson » Tue Jun 11, 2019 6:56 am
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?