You are here: Smart Control > Sample Trigger Script for Rebooting the System

Sample Trigger Script for Rebooting the System

The following is an example of a trigger script that will reboot the system (causing a failover) if a critical IP address cannot be reached or"‘pinged". It should be noted that the script uses string parsing and will consume a fair amount of CPU resources. It is recommended that you use this type of script if no other mechanisms are available.

$out = adc::cli("ping 10.0.0.68");

// if the ping fails, the string “0 packets received” is output, so look for that

if (strstr($out['cli_buf'], "0 packets received")) {
       adc::cli(“reboot”);
}