Re: Command works on CLI but not in SNMPTT event handler
Posted: Tue May 07, 2019 2:12 pm
Your guess sounds pretty reasonable to me.
In the name of due diligence, I have to ask you a few more questions:
Is there anything interesting happening on your XI filesystem? Any soft links/disk mounts that might have strange permissions?
What linux distribution is your server running on?
Can you verify the permissions on your scripts?
When you send a trap, are you seeing any errors in your other logs? I'd at least check /var/log/messages and possibly also your apache error log (path varies by distro, but on CentOS it's /var/log/httpd/error_log).
Lastly, and this is optional depending on your team's security restrictions/personal security preferences, but would you be able to try giving snmptt a shell and running the SNMPTT EXEC commands as them?
and when finished:
Hopefully we'll either see the issue or be able to re-create a bug with this information
In the name of due diligence, I have to ask you a few more questions:
Is there anything interesting happening on your XI filesystem? Any soft links/disk mounts that might have strange permissions?
What linux distribution is your server running on?
Can you verify the permissions on your scripts?
Code: Select all
ls -l /usr/local/nagiosxi/scripts/nxti.php
ls -l /usr/local/nagios/libexec/submit_passive_service.sh
groups snmptt
Lastly, and this is optional depending on your team's security restrictions/personal security preferences, but would you be able to try giving snmptt a shell and running the SNMPTT EXEC commands as them?
Code: Select all
sed -Ei 's#snmptt(.*)/sbin/nologin#snmptt\1/bin/bash#' /etc/passwd
su snmptt
Code: Select all
sed -Ei 's#snmptt(.*)/bin/bash#snmptt\1/sbin/nologin#' /etc/passwd