Over the past week, I've learned a new way to go about working with templates, and a new (best practice?) for working with triggers (in templates).
The first trick was how to create new templates that are similar to old ones. In the past, I always made use of the Full Clone button, renamed the template, and then made any edits. The problem with this is that it not only gets tedious, it's also error prone. It is very easy to fail to update one item, or to update it incorrectly. The solution here is the magic of exporting and importing. You can export an existing template, edit the resulting XML file in your favorite editor (use one that understands XML, obviously), and then import the new file. Do you need to change a lot of Numeric(Float) values to Numeric(Unsigned)? Your text editor will undoubtedly have a useful search-and-replace function that will be not only faster, but more reliable, than the click-click-click process you'll need in the web UI.
The second trick has to do with needing to customize triggers. Let me explain with a concrete example. One of the things I monitor is MySQL replication lag. For most of our systems, we want an alert if replication falls behind more than 600 seconds, and pages if it falls behind more than 3600 seconds. Thus, we wrote up our triggers to check for that. Then we started monitoring a database that was configured as a replication slave that lags a full 24 hours behind its master. The easy solution for dealing with this (though it wasn't obvious to me, thanks to Todd Mortensen for leading me to it) was to create a pair of user macros *in the template*, with the values of 3600 and 600 assigned to them, and then update the triggers to compare against macros instead of hard-coded values. Now, tuning one database to allow for a 24-hour lag is as simple as creating a user macro on the host (which overrides the one in the template) with the correct values for that host! While I'm still searching for a solution that will scale (groups of hundreds of hosts), this is still a huge step forward to reducing insane proliferation of templates.