Using MRTG's threshold feature to execute a php script
- by Dan Fried
I've set up mrtg using the online manual and the only online tutorial I found on the subject of thresholds, and the threshold just isn't firing.
In my mrtg.cfg file, the relevant lines are
ThreshDir: /path/to/mrtg/thresh
ThreshMaxI[performance]: 1
ThreshMaxO[performance]: 1
ThreshProgI[performance]: /path/to/mrtg/scripts/alert.php
ThreshProgO[performance]: /path/to/mrtg/scripts/alert.php
The paths are right, because if I enter the paths wrong I get an error on executing mrtg.
websitePerformance checks how long it takes to download the homepage, in milliseconds, so it should be exceeding the max every time.
Alert.php is working fine when invoked directly from the shell, and when I point to a nonexistent script it tells me the script is not executable.
No error messages are being generated, that I can find.
The thresh directory is always empty.
Why isn't the threshold being triggered by results that are greater than 1?
Anyone have any suggestions?