<div dir="auto"><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;border:0px;line-height:inherit;font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:15px;vertical-align:baseline;color:rgb(12,13,14);background-color:rgb(255,255,255)">I am testing the collectd Exec plugin using sample scripts before using it for my end purpose. But I am facing issues with the <a href="https://gist.github.com/apeckham/f783aa297516663f5c56" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;text-decoration-line:none;color:rgb(0,119,204)">sample script</a> itself.</p><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;border:0px;line-height:inherit;font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:15px;vertical-align:baseline;color:rgb(12,13,14);background-color:rgb(255,255,255)">This is the error:</p><pre style="margin-top:0px;padding:12px;border:0px;line-height:1.30769;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;font-size:13px;vertical-align:baseline;max-height:600px;width:auto;border-radius:5px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;vertical-align:baseline;max-height:300px;border-radius:0px">collectd[4585]: exec plugin: Failed to execute ``/home/ec2-user/magic_level.sh'': Permission denied
</code></pre><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;border:0px;line-height:inherit;font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:15px;vertical-align:baseline;color:rgb(12,13,14);background-color:rgb(255,255,255)">More info:</p><pre style="margin-top:0px;padding:12px;border:0px;line-height:1.30769;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;font-size:13px;vertical-align:baseline;max-height:600px;width:auto;border-radius:5px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;vertical-align:baseline;max-height:300px;border-radius:0px">$cat /home/ec2-user/magic_level.sh
#!/bin/bash
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
INTERVAL="${COLLECTD_INTERVAL:-60}"
while sleep "$INTERVAL"; do
echo "PUTVAL \"$HOSTNAME/exec-magic/gauge-magic_level\" interval=$INTERVAL N:$(date +%N)"
done
$ls -l /home/ec2-user/magic_level.sh
-rwxrwxr-x. 1 ec2-user ec2-user 244 Dec 27 16:28 /home/ec2-user/magic_level.sh
</code></pre><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;border:0px;line-height:inherit;font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:15px;vertical-align:baseline;color:rgb(12,13,14);background-color:rgb(255,255,255)">My exec plugin configuration:</p><pre style="margin-top:0px;padding:12px;border:0px;line-height:1.30769;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;font-size:13px;vertical-align:baseline;max-height:600px;width:auto;border-radius:5px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;vertical-align:baseline;max-height:300px;border-radius:0px"><Plugin exec>
Exec "ec2-user" "/home/ec2-user/magic_level.sh"
</Plugin>
</code></pre><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;border:0px;line-height:inherit;font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:15px;vertical-align:baseline;color:rgb(12,13,14);background-color:rgb(255,255,255)">Note: I could see that SELINUX is enabled. But I couldn't see any denials for this script in the log</p><p style="margin:0px;padding:0px;border:0px;line-height:inherit;font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:15px;vertical-align:baseline;color:rgb(12,13,14);background-color:rgb(255,255,255)">Can someone please help me resolve this</p></div>