I know this is a couple years old, but your script works perfectly!!!!
However, I'm trying to figure out how to implement putting graphs directly into the THOLD messages in Slack. I'm a little confused as to what you mean by mapping a directory to Apache.
N00b at this, I guess.
What it is saying is that :
slack_image_url = "http://cacti/tmp/img/"
Needs to go to the same folder as :
image_path = '/var/www/html/tmp/img/'
This is my path's and I am using ubuntu server 16.04. I also have "cacti" map to the ip address of my server in DNS.
I still have not got this to work yet. I think the script is looking for an image attachment and the new system puts inline images into the e-mail. I have tried to change it to PNG and JPEG attached images and it still does not work. The images are not getting copied to that directory. I am at a loss at this point. It also does not look like the e-mails are changing image formats when I change the settings, so I am not sure whats going on.