-epn seems not work in 3.x

Peter Ringe Peter.Ringe at web.de
Wed Jul 11 14:30:26 CEST 2007


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/




More information about the Developers mailing list