Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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.
vox 269.226.9550 ext 24
fax 269.349.9076
 http://www.nexcerpt.com
...Nexcerpt...Connecting People With Expertise


In reply to More than just a config file by Mur

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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:
    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
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (7)
    As of 2014-08-20 09:03 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (108 votes), past polls