Upgrading to Debian Stretch & fixing Cacti thold notification mails
With the upgrade from Debian Jessie to Stretch, the Cacti package went from 0.8.8b to 0.8.8h. A problem I had - and apparently a few other people, according to the Cacti forums - was that Cacti 0.8.8h in combination with the thold v0.5 plugin and Stretch refused to send “Downed device notifications”, or threshold warnings in general. Sending test emails with the Cacti settings plugin worked just fine, but that was it.
The issue lies with the split() function, which had been deprecated for a while and was now removed from PHP 7. Cacti logged the following error:
PHP Fatal error: Uncaught Error: Call to undefined function split() in /usr/share/cacti/site/plugins/thold/includes/polling.php:28
To fix the problem and have Cacti send mails again, simply replace split() with explode() in polling.php:
sed -i -e 's/split(/explode(/g' /usr/share/cacti/site/plugins/thold/includes/polling.php