Add sudoers file for check_osrf Nagios/Icinga
authorChris Sharp <csharp@georgialibraries.org>
Fri, 26 Oct 2018 13:40:24 +0000 (09:40 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 26 Oct 2018 13:40:24 +0000 (09:40 -0400)
The opensrf user needs permission to run the nagios
check, so add that to sudoers.d.

GenaSYS.sh
templates/check_osrf.sudoers [deleted file]
templates/monitor/check_osrf.sudoers [new file with mode: 0644]

index e988621..675e3e4 100755 (executable)
@@ -2876,6 +2876,7 @@ echo 'cp "${WD}/monitoring/check_postgres.pl" "/usr/lib/nagios/plugins"' >>$TMPS
 echo 'cp "${WD}/monitoring/check_cpu.sh" "/usr/lib/nagios/plugins"' >>$TMPSETUPMONITOR
 echo 'cp "${WD}/monitoring/check_freemem" "/usr/lib/nagios/plugins"' >>$TMPSETUPMONITOR
 echo 'cp "${WD}/monitoring/check_osrf" "/usr/lib/nagios/plugins"' >>$TMPSETUPMONITOR
+echo 'cp "${WD}/monitoring/check_osrf.sudoers" "/etc/sudoers.d"' >>$TMPSETUPMONITOR
 echo 'cp "${WD}/monitoring/nrpe_local.cfg" "/etc/nagios"' >>$TMPSETUPMONITOR
 chmod 755 $TMPSETUPMONITOR
 
@@ -3108,6 +3109,7 @@ do
                cp $TEMPLATEDIR/monitor/check_postgres.pl ../setup_${SUBFOLDER}/monitoring
                cp $TEMPLATEDIR/monitor/check_cpu.sh ../setup_${SUBFOLDER}/monitoring
                cp $TEMPLATEDIR/monitor/check_osrf ../setup_${SUBFOLDER}/monitoring
+               cp $TEMPLATEDIR/monitor/check_osrf.sudoers ../setup_${SUBFOLDER}/monitoring
                cp -r $TEMPLATEDIR/apache2/websockets ../setup_${SUBFOLDER}
                touch ../setup_${SUBFOLDER}/.osrf_node
                sed -i "s^HOSTNAME^${SUBFOLDER}^g" ../setup_${SUBFOLDER}/debconf-settings
diff --git a/templates/check_osrf.sudoers b/templates/check_osrf.sudoers
deleted file mode 100644 (file)
index 4fcd354..0000000
+++ /dev/null
@@ -1 +0,0 @@
-nagios ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/check_osrf
diff --git a/templates/monitor/check_osrf.sudoers b/templates/monitor/check_osrf.sudoers
new file mode 100644 (file)
index 0000000..4fcd354
--- /dev/null
@@ -0,0 +1 @@
+nagios ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/check_osrf