Perl Modules (Was Re: Cost of Nagios)

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Thu Jun 17 08:25:03 CEST 2004


Dear Sir,

I am writing to thank you for your letter and say,

On Wed, Jun 16, 2004 at 11:40:16PM -0500, Demetri Mouratis wrote:
> On Thu, 17 Jun 2004, Stanley Hopcroft wrote:
> 
> > If speed is required, some of the power tools like nmap + CPAN
> > Nagios::Config might get one going very quickly,
>

Ho-hum.
 
> If speed is required, Nagios::Config is a non-starter:
> 


> Module          Nagios::Config::File
> (T/TO/TOBEYA/Nagios-Object-0.03.tar.gz)
> Module          Nagios::Object  (T/TO/TOBEYA/Nagios-Object-0.03.tar.gz)
> Module          Nagios::Object::Config
> (T/TO/TOBEYA/Nagios-Object-0.03.tar.gz)

These are the modules I was referring to. Sorry about that.

Here is the synopsis

 use Nagios::Object;
     my $generic_host = Nagios::Host->new(
        register                     => 0,
        parents                      => undef,
        check_command                => $some_command,
        max_check_attempts           => 3,
        checks_enabled               => 1,
        event_handler                => $some_command,
        event_handler_enabled        => 0,
        low_flap_threshhold          => 0,
        high_flap_threshhold         => 0,
        flap_detection_enabled       => 0,
        process_perf_data            => 1,
        retain_status_information    => 1,
        retain_nonstatus_information => 1,
        notification_interval        => $timeperiod,
        notification_options         => [qw(d u r)],
        notifications_enabled        => 1,
        stalking_options             => [qw(o d u)]
     );

     my $localhost = Nagios::Host->new(
        use       => $generic_host,
        host_name => "localhost",
        alias     => "Loopback",
        address   => "127.0.0.1"
     );

     my $hostname = $localhost->host_name();
     printf "max check attempts for $hostname is %s.\n",
         $localhost->max_check_attempts;
     
     $localhost->set_event_handler(
         Nagios::Command->new(
             command_name => "new_event_handler",
             command_line => "/bin/true"
         )
     );

seemingly allowing the lightning quick construction of objects 
representing the Nag config in template format.

Then the dump method

'
dump() 

        Output a Nagios define { } block from an object. This is still 
EXPERIMENTAL, but may eventually be robust enough to use for a 
configuration GUI.

            print $object->dump();
'

should output the configuration.

> 
> Too early to specify a build action 'Build'.  Do 'Build Build' instead.
> make: *** [Build] Error 29
>   /usr/bin/make  -- NOT OK
> Running make test
>   Can't test without successful make
> Running make install
>   make had returned bad status, install seems impossible
> 
> Or am I missing something?


I should have shut up actually.

However, this module 

- does _not_ use Make::Maker (so perl Makefile.PL; make; make test etc
  fails to work).

- uses a CPAN module that quoting from the README

'Installation:

If you don't have Module::Build installed, you'll have to install it 
before you can use this module's installer.  That is the only dependency 
in  this module.  No, I won't add Make::MakeMaker support.  The easiest way to 
installModule::Build is to do "perl -MCPAN -e 'install Module::Build'".
 
  perl Build.PL
  ./Build
  ./Build test
  ./Build install

'

I have found Module::Build  will not build (sucks to me) on ancient 
Perls (5.005_03.).

However, while I have not verified the utility of Nagios::Object, I
trust the author.

> ---------------------------------------------------------------------
> Demetri Mouratis
> dmourati at linfactory.com
> 

I have probably wasted your and the lists time enough (BTW, congrats on 
the good showing of the Greek Football team in Euro 2004)

I beg your pardon.

Yours sincerely.

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list