I want to implement a Script to send an email or SMS when a failover ocurrs, I have checked it and I think the best option is create it based on this command
But I wondering if there is a better option, maybe some name in the alert field in /config/user_alert.conf or a script with icall.
So you mean not the F5 but the servers/Pool Members? Better provide more info so that to get more precise answers . For add node monitor and when the servers go down there will be an alarm in /var/log/ltm and as @DenisG has said then just configure the alarms for nodes being marked down.