Wildcards for allowed_hosts in nsca.cfg

Andreas Ericsson ae at op5.se
Fri Jul 22 15:58:16 CEST 2005


François Laupretre wrote:
>>Is there a way to use wildcard for allowed_hosts in nsca.cfg? 
>>If there was a way to simply allow access from *every* host, 
>>I would be happy.
> 
> 
> No, it is not supported.
> 
> Here is an ugly patch to authorize it : In nsca.c, add the following line at
> the beginning of the is_an_allowed_host() function :
> 
> if ((allowed_hosts[0]=='*')&&(allowed_hosts[0]=='\0')) return 1;
> 

Replace '&&' with '||' or the expression will always evaluate to false 
(actually, the compiler will recognize it as dead code and remove it 
completely).

> Then, you can use '*' to authorize access from everywhere.
> 
> Hope this helps, although not very nice :)
> 
> François
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Ce message et ses pièces jointes (le "message") est destiné à l'usage    
> exclusif de son destinataire.                                            
> Si vous recevez ce message par erreur, merci d'en aviser immédiatement   
> l'expéditeur  et de le détruire ensuite. Le présent message  pouvant  
> être altéré à notre insu,  CALYON Corporate and Investment Bank                              
> ne peut pas être engagé par son contenu. Tous droits réservés. 
>           
> This message and/or any  attachments (the "message") is intended for     
> the sole use of its addressee.                                            
> If you are not the addressee, please immediately notify the sender and    
> then destroy the message.  As this message and/or any attachments may 
> have been altered without our knowledge,  its content  is not legally 
> binding on CALYON Corporate and Investment Bank. All rights reserved.                                                                

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list