Logging.

Jeroen van Meeuwen kanarip at kanarip.com
Thu Mar 4 22:16:24 UTC 2010


On 03/04/2010 07:00 PM, Seth Vidal wrote:
> 
> 
> On Wed, 3 Mar 2010, Stephen John Smoogen wrote:
> 
>> Currently logs are 'shipped' to log01 which uses some syntactic magic
>> to put various logs into hostname appropriate directories.. eg logs
>> from xen10 go into /var/log/hosts/xen10/. However sometimes this does
>> not work correctly. hostnames are found via reverse lookups and if no
>> hostname is found then the IP address is found. So anytime there is a
>> DNS outage or problem, logs get shoved into directories like
>> /var/log/hosts/10.5.126.10/
>>
>> In order to clean up the various spazes, I have moved all the files
>> into appropriate hostnames and made symbolic links so that IP address
>> points to hostname.
> 
> 
> Would it be possible to have puppet or something spit out a list of 
> ips->hostnames from our dns records to a static nss_hosts or other hosts file to put on log01 
> so it never gets to a place where it loses a hostname?
> 

Although that snippet would still use exported resources, which fp.o
currently does not have in place (i believe?), a snippet for just this
would probably look like:

node 'foo' {
  @@host { "$hostname":
    ipaddress => "$ipaddress", # This can also be $ipaddress_eth0 or
whatnot, see `facter`
    host_aliases => "$fqdn",
    tag => "dns_does_not_always_work"
  }
}

node 'log01' {
  Host <<| tag == "dns_does_not_always_work" |>>
}

-- Jeroen


More information about the infrastructure mailing list