0

I set up a logging host in the ryslogd config using python, restart daemon etc and get a correct message:

Sep 20 09:03:20 Desk-r6 CLI[13845]: (admin) (root) (192.168.1.10) startup : Success

Code to restart:

def syslog_restart():

    try:
        pid = subprocess.check_output(["/bin/pidof", "syslogd"]).rstrip()
        if pid:
            with open(os.devnull, 'w') as dev_null:
                # This is automatically respawned as per /etc/inittab
                subprocess.call(["/bin/kill", "-HUP", pid], 
                               stdout=dev_null, stderr=dev_null)
    except subprocess.CalledProcessError:
        pass

However when I add another host, restart the daemon, the message does not appear in the original logging host. The weird thing is if I do yet another host that will appear. The pattern repeats itself, every second host I add to the config will not send a log message to that original server, any ideas?

Example config:

auth,authpriv.*         /var/log/auth.log
*.*;auth,authpriv.none  /var/log/messages
user.*                  /var/log/user.log
local0.*        /var/log/switch.log     
local1.*        /var/log/audit.log      
local4.*        /var/log/firewall.log   
local5.*        /var/log/gap.log       
kern.notice        /var/log/firewall.log
*.emerg                 :omusrmsg:*
local0.err      /dev/ttyS0         
daemon.*        /var/log/switch.log
local2.debug    /var/log/switch.log
local0.* @192.168.1.10:514    
daemon.* @192.168.1.10:514    
local1.* @192.168.1.10:514    
local2.debug @192.168.1.10:514
local3.* @192.168.1.10:514    
local4.* @192.168.1.10:514    
local5.* @192.168.1.10:514    
kern.notice @192.168.1.10:514 
local0.* @192.168.1.11:514    
daemon.* @192.168.1.11:514    
local1.* @192.168.1.11:514    
local2.debug @192.168.1.11:514                     
local3.* @192.168.1.11:514               
local4.* @192.168.1.11:514               
local5.* @192.168.1.11:514               
kern.notice @192.168.1.11:514           
local0.* @192.168.1.12:514              
daemon.* @192.168.1.12:514              
local1.* @192.168.1.12:514              
local2.debug @192.168.1.12:514          
local3.* @192.168.1.12:514         
local4.* @192.168.1.12:514         
local5.* @192.168.1.12:514         
kern.notice @192.168.1.12:514      
local0.* @192.168.1.13:514    
daemon.* @192.168.1.13:514    
local1.* @192.168.1.13:514    
local2.debug @192.168.1.13:514
local3.* @192.168.1.13:514    
local4.* @192.168.1.13:514    
local5.* @192.168.1.13:514    
kern.notice @192.168.1.13:514 

In the below case, 12, 14 and 16 were also added to the config:

    Sep 20 09:03:20 Desk-r6 CLI[13845]: (admin) (root) (192.168.1.10) startup : Success
    Sep 20 09:21:50 Desk-r6 CLI[4732]: (admin) (deskpc) (ttyS0) logging host 192.168.1.11 : Success
    Sep 20 09:31:53 Desk-r6 CLI[4732]: (admin) (deskpc) (ttyS0) logging host 192.168.1.13 : Success
    Sep 20 09:34:28 Desk-r6 CLI[4732]: (admin) (deskpc) (ttyS0) logging host 192.168.1.15 : Success

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.