Re: [Nagios-devel] $0 under ePN
Posted: Tue Aug 29, 2006 3:59 am
On Mon, Aug 21, 2006 at 02:03:27AM -0400, sean finney wrote:
> On Mon, Aug 21, 2006 at 02:48:19PM +1000, Gavin Carr wrote:
> > Under ePN $0 contains the full path to the ePN interpreter (e.g.
> > /usr/local/bin/p1.pl) instead of the path to the currently running
> > plugin. This makes it difficult for plugins that want to determine
> > how they were invoked in order to present different personalities.
> >
> > 1. modify nagios to set an environment variable before it invokes
> > the plugin (or ePN) containing the full path to the plugin
> > e.g. NAGIOS_PLUGIN or some such
>
> i think that within epn is probably the best place to fix this, since
> it's only a problem from within epn.
>
> i'm guessing that epn doesn't do fork/exec at all, so it would be
> hard to "trick" the plugin by overwriting $0. perhaps what you
> suggest would be a good approach wrt setting an environment variable
> and doing some automatic setting in the perl plugin module.
>
> > 2. workaround the issue in p1.pl for ePN only (see e.g. the attached
> > one-line patch to p1.pl)
Any other thoughts on this? Do people agree with Sean that it's
probably better restricted to ePN than using a more general solution?
Ethan, are you happy to apply that one line patch to p1.pl in my
original email, if so?
Cheers,
Gavin
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
> On Mon, Aug 21, 2006 at 02:48:19PM +1000, Gavin Carr wrote:
> > Under ePN $0 contains the full path to the ePN interpreter (e.g.
> > /usr/local/bin/p1.pl) instead of the path to the currently running
> > plugin. This makes it difficult for plugins that want to determine
> > how they were invoked in order to present different personalities.
> >
> > 1. modify nagios to set an environment variable before it invokes
> > the plugin (or ePN) containing the full path to the plugin
> > e.g. NAGIOS_PLUGIN or some such
>
> i think that within epn is probably the best place to fix this, since
> it's only a problem from within epn.
>
> i'm guessing that epn doesn't do fork/exec at all, so it would be
> hard to "trick" the plugin by overwriting $0. perhaps what you
> suggest would be a good approach wrt setting an environment variable
> and doing some automatic setting in the perl plugin module.
>
> > 2. workaround the issue in p1.pl for ePN only (see e.g. the attached
> > one-line patch to p1.pl)
Any other thoughts on this? Do people agree with Sean that it's
probably better restricted to ePN than using a more general solution?
Ethan, are you happy to apply that one line patch to p1.pl in my
original email, if so?
Cheers,
Gavin
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]