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')
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.
...Nexcerpt...Connecting People With Expertise
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||