There are many ways to do this, but none through the Nagios API, if that is what you are asking about. You *could* change all of your hosts and services through the API, but it isn't global in the sense that you want.
Possibly the most straight forward and cleanest way to do this is just to close the ports mail is going out on (25, 587, whatever it is in your environment). Depending on your version of CentOS/RHEL either IPTables or firewalld would be the way to do this. You would need to flush your mail queue once things are back up though.
Another option would be to turn off nagios with
service nagios stop. Checks aren't running then, so that would not be good if reporting is important, but it means you don't have to remember to flush the mail queue. If don't want notifications and you can't reach the web to see status there, this does seem like a reasonable approach. You might as well also bring down ndo2db during this time with
service ndo2db stop, but you'll need to turn then both back on when you have everything cleared up.
Nothing about Core 5.0.0 has been officially decided, but there's a possibility that there will be more notifications options in the future:
https://github.com/NagiosEnterprises/na ... /issues/52
Please let us know if you'd like any additional detail on the firewall or API.