一、使用飞信(添加中文注释之间的代码) /* Sends a group of graphs to a user */ function thold_mail($to, $from, $subject, $message, $filename, $headers = '') { global $config; include_once($config['base_path'] . '/plugins/settings/include/mailer.php'); include_once($config['base_path'] . '/plugins/thold/setup.php'); //添加的内容 file_put_contents('/var/www/html/cacti/plugins/thold/changed.log',$subject); exec("/var/www/html/cacti/plugins/thold/sendsms.sh"); //到此为止 $subject = trim($subject); $message = str_replace('<SUBJECT>', $subject, $message); $how = read_config_option('settings_how'); sendsms.sh的内容 #!/bin/bash if [ -s "/var/www/html/cacti/plugins/thold/changed.log" ] then admin=&