Apply Configuration fails with XI 2014* on RHEL 6.6
Posted: Tue Apr 14, 2015 10:14 pm
I've installed XI on 2 different RHEL systems, and encountered the same problem on both.
restart_nagios_with_export.sh attempts to execute su root -c "./manage_services.sh restart nagios", which fails because su(1) can't get a tty for the password prompt:
Instead, restart_nagios_with_export.sh should be using sudo(8), as is configured in /etc/sudoers(5):
Here's a proposed patch, that works on both installations:
restart_nagios_with_export.sh attempts to execute su root -c "./manage_services.sh restart nagios", which fails because su(1) can't get a tty for the password prompt:
Code: Select all
cmdsubsys.log
Things look okay - No serious problems were detected during the pre-flight check
RET: 0
standard in must be a tty
OUTPUT=RET: 0
RETURNCODE=6Code: Select all
/etc/sudoers
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *Code: Select all
restart_nagios_with_export.diff
--- restart_nagios_with_export.sh.orig 2015-04-14 22:54:00.535043805 -0400
+++ restart_nagios_with_export.sh 2015-04-14 22:54:45.324043039 -0400
@@ -41,7 +41,7 @@
if [ $ret -eq 0 ]; then
# Restart Nagios
- su root -c "./manage_services.sh restart nagios"
+ sudo ./manage_services.sh restart nagios
ret=$?
if [ $ret -gt 0 ]; then
# Remove LOCKFILE