Trouble with embedded perl: nagios keeps forking perl plugins

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Tue Mar 15 09:39:14 CET 2005


Dear Sir,

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

On Mon, Mar 14, 2005 at 08:19:11PM -0800, nagios-users-request at lists.sourceforge.net wrote:
> 
> Message: 5
> From: =?iso-8859-1?Q?Nicol=E1s_Alen?= <nicolas.alen at elserver.com>
> To: <nagios-users at lists.sourceforge.net>
> Date: Mon, 14 Mar 2005 21:41:25 -0300
> Subject: [Nagios-users] Trouble with embedded perl: nagios keeps forking perl plugins
> 
> This is a multi-part message in MIME format.
> 
> ------=_NextPart_000_0111_01C528DE.939B81E0
> Content-Type: text/plain;
> 	charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> Dear list:
> =20
> I have re-compiled nagios 1.2 embedded perl and perl cache:
> $ ./configure  --with-nagios-user=3Dnagios --with-nagios-grp=3Dnagios
> --prefix=3D/usr/local/nagios --with-default-perfdata =
> --enable-embedded-perl
> --with-perlcache
> =20
> Nagios binary grew up from 232 K to 1.2 M, so I guess perl interpreted =
> is
> now embedded in nagios,

</path/to/nag/bin>nagios -m will also tell you if Perl is embedded in 
the Nag binary (for 1.x only).

You should check that the Nag you are running has responds like

tsitc> ./nagios -m

Nagios 1.3
Copyright (c) 1999-2004 Ethan Galstad (nagios at nagios.org)
Last Modified: 10-24-2004
License: GPL

External Data I/O
-----------------
Object Data:      TEMPLATE
Status Data:      DEFAULT
Retention Data:   DEFAULT
Comment Data:     DEFAULT
Downtime Data:    DEFAULT
Performance Data: DEFAULT

Options
-------
* Embedded Perl compiler (With caching)



> but all the plugins are still forked from the =
> nagios
> process (I can see several "perl -w xxx.pl" in the processlist).

This shouldn't be happening (are these the Perl plugins you have defined 
in checkcommands.cfg ?).

With ePN (embedded Perl Nagios) there is no difference in the rate of 
forking of Nagios than without embedding, but instead of exec'ing the 
plugin binary (and likewise loading and forking Perk), the Nag child 
process calls a function

perl_call_pv("Embed::Persistent::run_package", G_EVAL)

to run the previously compiled plugin.

(FWIW, the Nagios process must split the processing between the Nag 
daemon - which compiles and caches the Perl plugin - and the child 
processes which call the function corresp to the previously compiled 
plugin [the plugin name is passed via the Perl stack prior to 
perl_call_pv])


> Load
> average and plugin lattency didn't got better.
> =20
> =BFMust I do something to enable it? I hope you can help.
> =20
> =20

Do your plugins contain a shebang line ?

Nag looks for '/bin/perl' in the plugin source to decide if the plugin 
is Perl ?

Are you using the standard plugins that were properly installed ?

I find the ePN helps considerably with Perl plugin performance.

However there is a bad tradeoff in an unacceptable (for many)  memory 
leak. 

Unfortunately this is unlikely to get fixed any time soon.

The only way of nailing this, or any plugin/Nag problem, is by building 
a Nag with debug options and running it in a sandpit.

See also ./configure --help.



> Thanks!
> Nicol=E1s Alen
> 


> ------=_NextPart_000_0111_01C528DE.939B81E0
> Content-Type: text/html;
> 	charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Diso-8859-1">

  ... 

Acres of HTML deleted; please don't do this.

Yours sincerely.

-- 
Stanley Hopcroft

IP Australia
Ph: (02) 6283 3189  Fax: (02) 6281 1353
PO Box 200 Woden  ACT 2606
http://www.ipaustralia.gov.au
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: disclaimer.txt
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050315/18894039/attachment.txt>


More information about the Users mailing list