Ok, it would seem that you and I know about as much as each other about how to do this. Presumably you know something about swap space, where I do not, and clearly you do not know any perl whereas I do. So that makes us even. :-)

So, where to start? Well presumably there are some tools that you use routinely to monitor and manage your swapspace. Get em out and start figuring out how to parse them. That would mean using regexes, which are documented in perlre. You mention a config file. Well, personally I use Config::Inifile or plain oldData::Dumper to do this type of stuff, but a lot of people seem to be quite keen on YAML. Of course you'll want to exec the tools from the perl side of things so you should have a look at backticks, system and perlopentut.

Hopefully thats a good starting point?


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

• Update:  
Conversation in the CB has lead to me hunting down the following link How (Not) To Ask A Question which is the (IMO) canonical PM node about how to get the best out of the talents that hang out here. My node is a bit tongue in cheek because theres no code for us to help you on. Beyond what Abigail-II and I have said theres not much anybody can say. Try to reply or ask your question again with a better question and im sure youll get something that you can work with. :-)



In reply to Re: swap space monitor script by demerphq
in thread swap space monitor script by agent

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.