ashok.g has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Perl Modules
by afoken (Chancellor) on Jan 02, 2012 at 11:23 UTC

    http://search.cpan.org/

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      I have already searched CPAN before posting this question. But I just want the recommended and the best modules for my purpose.

      1. Didn't find any module for this. Is there any?
      2. Using Config::General; Is there any better/similar one?
      3. better/similar than Nmap::Scanner?
      4. Didn't find any module for this. Is there any?
      5. Is there any single module for getting most of the info.
      6. Good to go with Net::SNMP

      Thanks,
      Ashok

        If you already researched modules, why did you not tell us the results you got in your first post? When you tell us about the results and your conclusions, that helps us gauge what your needs are.

        Have you looked at the results of Log for logfiles?

        Serious operating systems provide information via CIM / WMI and/or SNMP, so I'd look for that on CPAN.

        [...] I just want [...] the best modules for my purpose.

        Well, as usual, please define "best". What is "good" for your purpose? Lines of code? Maintainability? External dependencies? Documentation? Warm fuzzy feeling?

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Perl Modules
by i5513 (Pilgrim) on Jan 02, 2012 at 12:22 UTC

    I think you need a monitoring solution, like zabbix or nagios, may be you need some of that modules to develop a plugin for any of tons monitorion solutions in the market. Search them again in cpan

    Maybe you can search inside nagios plugin (there are various written in perl)

    For easy XML tag "extracter" search XPATH in cpan, or use xmlstarlet

    Cheers,
      We tried even Nagios but still we need to go for our custom script which will best suit for our needs..
            We tried even Nagios but still we need to go for our custom script which will best suit for our needs..

        My first thought is you have failed miserably to communicate what your needs are. I can't for the life of me imagine any real world need that Nagios can't be coerced into fitting and I've seen a few that defy the term "real world"™. In one shop I worked at someone had rigged a sensor, interfaced it to a serial port on a Linux box and using nrpe sent pages to the support team when the level in the coffee pot got too low. If that could work you would have to work really hard to find a monitoring requirement that some effort and creativity won't solve.

        In fact, I'm starting to think you just might be a troll.

        Usually when I see someone ask a question, a bunch of folks offer solutions and the asker still says "That won't work" without saying specifically why I start thinking they just want validation that they cannot find a solution.

        Didn't start out write a rant, but I did...


        Peter L. Berghold -- Unix Professional
        Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

        Hi,

        Your points 1, 3, 4, 5 are covered by builtin items and triggers inside zabbix agent

        Search in zabbix doc by proc.num, net.tcp.listen, vfs.fs or vm.memory for examples

        Cheers,
Re: Perl Modules
by CountZero (Bishop) on Jan 02, 2012 at 15:50 UTC
    There are a lot of modules interfacing with Nagios.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Perl Modules
by aartist (Pilgrim) on Jan 02, 2012 at 18:00 UTC
    Tell us more.

    What you have tried and what does not work for your needs?

Re: Perl Modules
by blue_cowdawg (Monsignor) on Jan 05, 2012 at 13:59 UTC
        I need some Perl modules which can server the following purpose. To monitor up/down status of a given process.

    Problem definition:

    • What platform? Winbloze, *nix, VMS, or ????
    • Assuming for a moment this is *nix is there a PID file I can use to determine the alleged PID of the runing process or are we going to have to search the process table?

        To get the properties and values defined in some custom file (e.g an XML)
    So... parse it... Check out cpan:XML::Simple for instance.

        To monitor port status and health
    What is your criteria for health? What kind of port is it TCP or UDP? What's on the other side of that port? Is there authentication involved?

        To write a log file and consolidate a log file and monitor errors.
    Eh? Which is it, consolidate or write a log? Writing a log is pretty basic stuff and you don't need to find a module for that.
    OPEN LOG," /var/log/mylogfile.log" or die "logging: $!"; printf LOG "Some pithy log message\n"; close LOG;

        To get general health of the server – Disk, Memory, CPU, Partition etc
    Again: define the platform. There are many ways to skin a cat here... of course the cat may not be too happy about being skinned.

        To send traps to a server.
    Seems to me you don't need a Perl module for this. There are a wealth of SNMP trap "senders" out there. On *nix snmptrap being the first to come to mind.

    If you are trying to do system and/or network monitoring you might want to investigate Nagios or M/Monit. Where Nagios provides a means of centralized monitoring M/Monit runs on each host being monitored. M/Monit is largely Perl based and you can also mine it for "how do you do this" since you'd have the source code.

    I've used both of those products (as well as other off the shelf products) in my professional world with a lot of success. I don't believe in rw-inventing the wheel when there are so many nice wheels to choose from.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg