event handler issue
Posted: Thu Sep 08, 2016 1:46 pm
I am trying to setup event handler for ntpd service..
i created event handler script that restarts ntpd using command "/etc/init.d/ntpd restart" in nagios core.
on the remote server, i have below entries in the sudoers file
nagios ALL=NOPASSWD: /usr/sbin/ntpd
Defaults:nagios !requiretty
nagios ALL= NOPASSWD: /etc/init.d/ntpd restart
problem is it keeps throwing the errors "sudo: no tty present and no askpass program specified"..
when i run the restart command as nagios user on the server it works fine
su -s /bin/bash nagios
sudo -u root /etc/init.d/ntpd restart -- this works
but through event handler its not workking..am i missing something here ?
pls help
Shan
i created event handler script that restarts ntpd using command "/etc/init.d/ntpd restart" in nagios core.
on the remote server, i have below entries in the sudoers file
nagios ALL=NOPASSWD: /usr/sbin/ntpd
Defaults:nagios !requiretty
nagios ALL= NOPASSWD: /etc/init.d/ntpd restart
problem is it keeps throwing the errors "sudo: no tty present and no askpass program specified"..
when i run the restart command as nagios user on the server it works fine
su -s /bin/bash nagios
sudo -u root /etc/init.d/ntpd restart -- this works
but through event handler its not workking..am i missing something here ?
pls help
Shan