title: zabbix user sudo issue in mdraid monitoring
body: <p>I am trying to use this script to monitor software raids:
  <a href="https://github.com/linuxsquad/zabbix_mdraid" rel="nofollow">https://github.com/linuxsquad/zabbix_mdraid</a></p>
  
  <p>When I have the following setting (with SUDO) in zabbix_agentd.conf:</p>
  
  <pre><code>UserParameter=mdraid[*], sudo /usr/local/bin/zabbix_mdraid.sh -m'$1' -$2'$3'
  UserParameter=mdraid.discovery, sudo /usr/local/bin/zabbix_mdraid.sh -D
  </code></pre>
  
  <p>And execute the following from Zabbix proxy:</p>
  
  <pre><code>zabbix_get -s HOSTNAME -k mdraid[/dev/md0,d,1]
  </code></pre>
  
  <p>I am getting the following error ("sorry, you must have a tty to run sudo") in zabbix_agentd.log:</p>
  
  <pre><code>25547:20141229:090259.961 Requested [mdraid[/dev/md0,d,1]]
  25547:20141229:090259.961 In zbx_popen() command:' sudo /usr/local/bin/zabbix_mdraid.sh -m'/dev/md0' -d'1''
  25547:20141229:090259.962 End of zbx_popen():7
  25552:20141229:090259.962 zbx_popen(): executing script
  sudo 25546:20141229:090259.970 listener #1 [processing request]
  25546:20141229:090259.970 Requested [system.cpu.util[,steal]]
  25546:20141229:090259.970 Sending back [0.000000]
  25546:20141229:090259.970 listener #1 [waiting for connection]
  : sorry, you must have a tty to run sudo
  </code></pre>
  
  <p>Yes, I have already tweaked /etc/sudoers file:</p>
  
  <pre><code>/etc/sudoers:
  zabbix ALL=(ALL) NOPASSWD: ALL
  
  Defaults:zabbix !requiretty
  </code></pre>
  
  <p>Also tried commenting out all lines that contain requiretty in /etc/sudoers</p>
  
  <p>when I switch to zabbix user and run the script manually:</p>
  
  <pre><code>-bash-4.1$ sudo /usr/local/bin/zabbix_mdraid.sh -m'/dev/md0' -eState
  clean,degraded-bash-4.1$
  </code></pre>
  
  <p>It works just fine. So the script is good and /etc/sudoers does not require tty for zabbix user. What else can be wrong? Any ideas how to make this work?</p>
  
  <p>This is RHEL 6.5 by the way (agent, proxy and server)</p>