Re: [Nagios-devel] -epn seems not work in 3.x

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] -epn seems not work in 3.x

Post by Guest »

Thanks for the note Peter - I'll post a patch to CVS which should fix
this.

Peter Ringe wrote:
> Hi Ethan, hi al,
>
> I think there is a problem in base/utils.c, when comparing the string,
> found in the perl script with
> "+epn" or ".epn" .
>
> There Ehtan has used strcmp
>
>
> if(!strcmp(ptr,"+epn")){
> use_epn=TRUE;
> found_epn_directive=TRUE;
> }
> else if(!strcmp(ptr,"-epn")){
> use_epn=FALSE;
> found_epn_directive=TRUE;
> }
>
> I think (I'm not amn c expert) instead of strcmp, strstr would be better
> due to leading/trailing whitespaces linefeeds in ptr. actually
>
> actually with
>
> # nagios: -epn"
>
> ptr will be " +epn\n", the leading blank as well as the trailing
> linefeed is part of ptr
>
>
>
> regards,
>
> peter
>
>
>
>
> william(at)elan.net schrieb:
>> On Wed, 11 Jul 2007, Hendrik Baecker wrote:
>>
>>
>>> Hi Ingo,
>>>
>>> Ingo Lantschner schrieb:
>>>
>>>> But to my understanding of the tag "#nagios: -epn" it should disable
>>>> epn for the particular plugin even if use_embedded_perl ist set to 1.
>>>> But unfortunately the output still gets messed up.
>>>>
>>> yes - this should do the trick, but after regarding the docs it should be
>>>
>>> "# nagios: -epn" instead of
>>> "#nagios: -epn"
>>>
>>> There is a blank between '#' and 'n'.
>>>
>> While this is all fine, a simple way (that also works with any 2.x
>> code) based on how nagios decides if it is or not a perl plugin is to
>> just remove the first line "#!/usr/bin/perl" from pliugin and in
>> commands.cfg instead of just specifying plugin name directly add
>> explicit call to /usr/bin/perl, i.e.
>> command_line /usr/bin/perl your_plugin.pl
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Nagios-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/lis ... gios-devel


--


Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked