Q: Is there a way how to disable the ABAP agent in case of any OS maintenance?
A: Yes.
To deactivate the ABAP agent, please follow these steps - all are in the documentation:
To activate it back, follow these steps in reverse order, don't forget to enable HTTP listener for machine agents.