DNS Zone Hook
I simply need to be able to run a command when a dns zone is deleted. Pretty basic. Any suggestions on how I can make this happen?
-
The full guide goes more in depth Guide to Standardized Hooks - Developer Documentation - cPanel Documentation But ultimately you can write a standardized hook to run when a "hookable event" has occurred. All hookable events are comprised of three main attributes: - category " The event's logical grouping within cPanel & WHM.
- event " The event that cPanel & WHM performs.
- stage " The location of the trigger that runs the hook action code, relative to the event.
0 -
The full guide goes more in depth
- category " The event's logical grouping within cPanel & WHM.
- event " The event that cPanel & WHM performs.
- stage " The location of the trigger that runs the hook action code, relative to the event. What command are you wanting to run when a DNS zone is removed?
I am just wanting to run a curl command when a zone is deleted so i can delete the zone on the slave. Zones are created/updated with AFXR, which obviously doesn't handle deletions. Maybe hooks isn't the right way to go? Whatever is the simplest to setup.0 -
Hello @MACscr :) 1. The quickest way to see if an event is hookable is to enable the following setting for the Standardized Hooks - Debug Mode option under the Development tab in WHM >> Tweak Settings: Debug mode is on. The system displays information about every stage for every hookable event, even if no hooks exist for that stage.
Once this is enabled, perform the action you want to hook into using either cPanel or Web Host Manager, and then monitor the /usr/local/cpanel/logs/error_log output to identify the hook action. The following tutorial includes some helpful information: 3. One alternative to explore is the use of a custom dnsadmin plugin. We document more information along with an example on the link below:0
Please sign in to leave a comment.
Comments
5 comments