[Nagiosplug-devel] Nagios::Plugin api
Vonnahme, Nathan
nathan.vonnahme at bannerhealth.com
Tue Sep 5 20:10:23 CEST 2006
Good point about new users, John, although I hope they will read the POD
for examples before googling.
Shall we just leave it as
$plugin->nagios_die(CRITICAL, "aiiiii") if $bad;
$plugin->nagios_exit(); # OK
?
Gavin Carr wrote:
> On Fri, Sep 01, 2006 at 06:17:00PM -0400, John P. Rouillard wrote:
> > Why use die at all? It is some attempt to make current
> programs using die
> > return something useful?
> >
> > Why not use nagios_exit("msg", $UNKNOWN) or some such.
> Overloading is
> > nice if you understand it, but I see a lot of people making plugins
> > that have only a bare grasp of programming. I think
> overloading die is
> > just going to bring problems. A user does a google for die to see
> > how to use it. Does s/he get info about the overloaded function?
> >
> > On the other hand if they google for nagios_exit or some such they
> > have a much better chance of finding useful info and examples.
>
> It's a good point. In addition, we were talking about using both 'die'
> and 'exit', and overloading 'exit' is non-trivial. I actually used
> nagios_exit() in my earlier Nagios::Plugin variant, so +1 from me.
>
More information about the Devel
mailing list