EPN, RRDfiles etc

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Wed Aug 20 15:35:27 CEST 2003


> From: Jamie Baddeley <jamie.baddeley at vpc.co.nz>
> Reply-To: jamie.baddeley at vpc.co.nz
> To: nagios-users at lists.sourceforge.net
> Date: Wed, 20 Aug 2003 19:55:09 +1200
> Subject: [Nagios-users] EPN, RRDfiles etc
> 
>

<yelp>
Aaargh ! Multi-part in the digest .. is indegistible
 
> --------------Boundary-00=_XBRWNLL92J52KZPYCQNI
> Content-Type: text/plain;
>   charset="iso-8859-1"
> Content-Transfer-Encoding: 8bit
> 

</yelp>

> Hi All,
> 
> I'm working on getting a new plugin sorted out. Ages ago Daniel Rich 
> posted a plugin to read RRD files generated by Cricket. It's an awesome 
> little plugin designed to read RRD files. This means you can use your 
> favourite rrd based system to go out and get the info from the network, and 
> Nagios can poll the resultant RRD's locally. Nice. A Nice efficient way of 
> doing things.
> 
> Anyway, I'm testing Daniel's plugin, and I've come up against a problem. The 
> plugin uses perl's IPC::Open3 module to call rrdtool to get the info. 
> Unfortunately there appears to be a problem with Nagios that has EPN compiled 
> and Open3. 
> 

It may not be Open3; try a hello world sort of test program that uses
this module - maybe the synopsis from the perldoc Open3.


> Ref:
> http://www.mail-archive.com/embperl@perl.apache.org/msg05441.html
> 
> When I use the plugin I get nothing but (no output!).
> 
> Debugging, I'm getting this:
> Can't locate object method "OPEN" via package "OutputTrap" (perhaps you 
> forgot to load "OutputTrap"?) at /usr/lib/perl5/5.6.1/IPC/Open3.pm line 136.
> 
> ...when I run Nagios (run in foreground to debug).
> 
> My question is what do people think are sensible ways around this?
> - Recompile Nagios without EPN support?
> - Find_another_way with the plugin?
> - Discover some other magic fix?
> 
> I've attached the plugin, as I think it's a great way of doing what a lot of 
> people are trying to do with Apan etc, except that it takes advantage of 
> tried and true time-series trending systems such as cricket or perhaps cacti 
> etc.
>

Unfortunately, your mailer has base-64 encoded the plugin (in digest
format anyway) so that it's hard to see what is causing ePN to choke.
 
> I'm hesitant to walk away from EPN, as we have the learned Mr Hopcroft often 
> extolling the virtues of EPN. 


Noisy and extremely non politically correct, non mixed company
raspberry. ePN buys somethings but you lose others; I like it but YMMV.

Some modules simply don't work with ePN (eg Parse::HTML); there are some
things that cannot be done with an embedded Perl interpreter (there's
some notes on the Nag web site about the definitely verboten stuff but
Stas Beckmans __book__ [his notes finally ended up as an ORA
publication] on mod_perl [the free HTML version of the book is linked on
the mod_perl site - thoroughly recommended if you are interested in
getting to grips with Perl] is the authority).

You may need to hack the plugin and then try it out with the mini_epn.c
in the contrib directory (you may need the version in the CVS if you
have a threaded Perl)

But there is always more than one way to do it.

In this case

1 make a C wrapper for your plugin eg

/* $Id: check_pams.c,v 1.2 2002-12-04 15:55:23+11 anwsmh Exp anwsmh $ */

/* $Log: check_pams.c,v $
 * */

int
main(int argc, char *argv) {
  execv("/usr/local/nagios/libexec/check_pams.pl", argv) ;
}


2 s/check_pams\.pl/your_plugin.pl/

3 gcc -o your_plugin your_plugin_wrapper.c

/* also handly for Perl plugins that need to be suid */
> 
> 
> Thoughts? 
> 
> jamie
> 

-- 
Stanley Hopcroft



DESOLATION ROW
(Words and Music by Bob Dylan)

They're selling postcards of the hanging
They're painting the passports brown
The beauty parlor is filled with sailors
The circus is in town
Here comes the blind commissioner
They've got him in a trance
One hand is tied to the tight-rope walker
The other is in his pants
And the riot squad they're restless
They need somewhere to go
As Lady and I look out tonight
>From Desolation Row

Cinderella, she seems so easy
"It takes one to know one," she smiles
And puts her hands in her back pockets
Bette Davis style
And in comes Romeo, he's moaning
"You Belong to Me I Believe"
And someone says," You're in the wrong place, my friend
You better leave"
And the only sound that's left
After the ambulances go
Is Cinderella sweeping up
On Desolation Row


-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
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