Somewhere I discovered that Webmin accepts variable substitution in a custom email template for a System and Server Status monitor. For example, Webmin will accept Status change noted on ${DATE} at ${TIME}. and inserts the system time and date as indicated. This page describes what I’m looking for but, curiously enough, does not list TIME or DATE.
My question: Is there a complete list of the allowable substitutions available somewhere? Can I substitute environment variables? Are there other possibilities such as HOSTNAME and such?
Environment variables was my first thought too @tpnsolutions. But, unless I’m wrong, my environment doesn’t hold either of those variables. The env command doesn’t list either of them. And echo $DATE prints nothing.
Further research examining /usr/share/webmin/monitor.pl reveals an embedded function named make_message which appears to search the configured custom template for a list of key-words that seems to be limited to: HOST, DATE, TIME, STATUS, and SERVICE. So I’m guessing those 5 are the only variables that can be substituted within a custom template for a System/Service monitor.
The script that implements the monitors is located in /usr/share/webmin/status/ not in /usr/share/webmin/ as I initially wrote.
Also, I incorrectly stated that SERVICE is one of the available replacments. That is wrong. The correct replacement for the name of the service being reported is DESC.
I agree with @keenmouse that a comprehensive list would be nice. But based on what I see from scanning the code, the variables that can be replaced are unique to each function. There doesn’t seem to be any application-wide variable-replacement feature. The replacements I noted above seem to exist only in the code related to System and Service Monitors. Reading the existing documentation I’ve been able to find, the information seems to differ on a function-by-function basis.