Logoj0ke.net Open Build Service > Projects > home:netmax:playground:monitoring > nrpe3 > Changes
Sign Up | Log In

Changes of Revision 6

[-] Changed nrpe.spec
x
 
1
@@ -184,6 +184,23 @@
2
 %else
3
 %systemd_post nrpe.service
4
 %endif
5
+if [ -d /etc/sudoers.d ] ; then
6
+        cat > /etc/sudoers.d/50_nagios << EOF
7
+nagios          ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/,/usr/lib64/nagios/plugins/
8
+Defaults:nagios !requiretty
9
+Defaults:nagios !env_keep
10
+EOF
11
+chmod 0440 /etc/sudoers.d/50_nagios
12
+
13
+elif [ -f /etc/sudoers ] ; then
14
+        if [ -z "`grep ^nagios /etc/sudoers`" ] ; then
15
+                echo "nagios          ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/,/usr/lib64/nagios/plugins/" >> /etc/sudoers
16
+        fi
17
+        if [ -z "`grep ^Defaults:nagios`" ] ; then
18
+                echo "Defaults:nagios !requiretty" >> /etc/sudoers
19
+                echo "Defaults:nagios !env_keep" >> /etc/sudoers
20
+        fi
21
+fi
22
 
23
 %postun
24
 %if 0%{?el6}
25