Nagios::* namespace accepted on CPAN.

Patrick LeBoutillier patrick_leboutillier at hotmail.com
Wed Jun 11 18:09:46 CEST 2003


I'll work on preparing the Nagios::Config module for CPAN submission
shortly.

When I post it will "explode templates" (many levels) and provide POD
and accessor generic accessor methods (no autoloading for now).

NOTE: I do not intent to make this module "intelligent" about the different
objects that Nagios uses. This means that it will parse the config files,
and provide
ways to access the different attributes for each object without knowing what
those
attributes are or if they are valid or not.

If someone want to write such a module, I'll gladly rename mine
Nagios::Config::Simple
in order to liberate the more generic namespace. Or else I'll proceed with
Nagios::Config.


Cheers,

Patrick LeBoutillier

---------------------
Patrick LeBoutillier
Laval, Quebec, Canada

----- Original Message -----
From: "Stanley Hopcroft" <Stanley.Hopcroft at IPAustralia.Gov.AU>
To: "Patrick LeBoutillier" <patrick_leboutillier at hotmail.com>
Sent: Tuesday, June 10, 2003 1:25 AM
Subject: Re: [Nagios-users] Re: Nagios::* namespace accepted on CPAN.


> Dear Sir,
>
> I am writing to thank you for your letter and say,
>
> On Thu, May 29, 2003 at 07:53:09AM -0400, Patrick LeBoutillier wrote:
> > I'm very pleased with this.
> >
> > I also have NagiosPlugin.pm, that could be renamed Nagios::Plugin.pm, an
> > object oriented
> > wrapper to create Perl Nagios Plugins. You basically use it like this,
> > implementing the usage(),
> > validate_options() and test() methods:
> >
> > -----------------------------------
> > #!/usr/bin/perl
> >
> > package check_xxx ;
> > @ISA = qw(NagiosPlugin) ;
> >
> > use strict ;
> > use NagiosPlugin ;
> >
> > sub new {
> >     my $class = shift ;
> >     my $this = $class->SUPER::new('check_xxx', '1.0', "-H=s", "-p=i",
> > "-t=i") ;
> > }
> >
> > sub usage {
> >     my $this = shift ;
> >     return "Usage: check_xxx.pl -H host -p port [-t timeout]\n" ;
> > }
> >
> > sub validate_options {
> >     my $this = shift ;
> >     if ((! $this->{opts}->{H})||(! $this->{opts}->{p})){
> >         die($this->usage()) ;
> >     }
> > }
> >
> > sub test {
> >     my $this = shift ;
> >     my $host = $this->{opts}->{H} ;
> >     my $port = $this->{opts}->{p} ;
> >
> >     my $time = $this->now() ;
> >     my $ok = 0 ;
> >     # Test xxx @ $host:$port
> >     my $d = sprintf("%.3f", $this->now() - $time) ;
> >     if ($ok){
> >        $this->ok("XXX OK -  $d seconds response time") ;
> >     }
> >     else{
> >         $this->critical("XXX failed: <put your reason here>") ;
> >     }
> > }
> >
> > my $p = new check_xxx() ;
> > $p->run() ;
> > -----------------------------------
>
> that I am not sure that I follow you here and probably only would after
> having seen Nagios::Plugin
>
> (I import the subs &support and &print_revision from utils.pm and
> implement sub usage in each plugin. This is Ok.).
>
> Do you intend to publish your Nagios Configuration module. I have forked
> it futher since last writing and think your module sufficiently useful
> for others to use.
>
> Do you want a look at what I have (or propose) ie
>
> . handle multiple templates for each type of thing - it may even handle
> multiple 'use TEMPLATE's in an obj def.
>
> . accessors (memoized autoloaded) to get stuff
>
> . POD
>
> ?
>
> 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: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
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