Permission error when Nagios user runs a bash script, also with sudo

So the problem here is that SELinux is not allowing Nagios to do a variety of things which, presumably, you actually want it to do (such as running ssh). It's impossible for the distribution to guess at all the things you might need Nagios to do, so while the SELinux policy allows most things related to monitoring, it isn't allowing these things.

You can work around the issue for the time being by setting Nagios to permissive mode (you don't have to set all of SELinux to permissive, you can do it for individual types):

semanage permissive -a nagios_t

After doing this, the audit log will over time accumulate all of the AVCs you need to create a custom SELinux policy module, if you wish, and after installing that custom policy module you can return SELinux to enforcing for Nagios.

semanage permissive -d nagios_t

(Note that it doesn't work to try to create a custom policy module unless the domain is permissive, because not all of the necessary permissions would be triggered and logged in enforcing mode.)