I'm tasked with developing a system that monitors the rest of our application, and issues alert messages when certain measurements exceed predefined limits. I have a design in mind for how to do this, but what I still need is a way to supply the limits in the form of an external config file.
I know there are all sorts of .INI file parsers, but what I need is a bit stronger. I envision the configuration looking something like the following:
ALERT1 green 0 - 20
yellow 21 - 40
red > 40
ALERT2 green IN ('a','b','c')
yellow IN ('d','e')
red OTHERWISE
ALERT3 yellow < 12
red >= 12
Each alert would correspond to an external script that would measure something (say, load average), and return a single value. That value might be a number on a scale, or it might be a discrete value (like a string). The alert levels might be scaled so that "high" values are "redder", or it might be the other way around. Some alert levels might be undefined (as the "green" level is in ALERT3, above).
What I'm hoping to find is a parser for a format like this. It's a long shot, but I figure it couldn't hurt to ask here. I poked around at CPAN for a bit, but I don't have a good "search" term that will filter out the various *.INI-type modules.
| -- |
| Jeff Boes |
| Database Engineer |
| Nexcerpt, Inc. |
|
|
|
...Nexcerpt...Connecting People With Expertise
|