Skip to content

Latest commit

 

History

History
105 lines (76 loc) · 2.26 KB

test-bench.md

File metadata and controls

105 lines (76 loc) · 2.26 KB

Test bench

  1. [HOST] Download VirtualBox and Vagrant and install them

  2. [HOST] Create a Vagrantfile

    Vagrant.configure("2") do |config|
      config.vm.box = "ubuntu/trusty64"
      config.ssh.host = "127.0.0.1"
      config.ssh.username = "vagrant"
      config.ssh.password = "vagrant"
      config.vm.network :forwarded_port, id: 'ssh', guest: 22, host: 2222, auto_correct: false
      config.vm.network :forwarded_port, guest: 514, host: 1514, protocol: "tcp", auto_correct: false
      config.vm.network :forwarded_port, guest: 514, host: 1514, protocol: "udp", auto_correct: false
    end
  3. [HOST] Start the VM

    vagrant up
  4. [HOST] Connect to the VM with SSH on port 2222

  5. [GUEST] Switch to the root user

    su
  6. [GUEST] Uncomment the following /etc/rsyslog.conf lines:

    #$ModLoad imudp
    #$UDPServerRun 514
    
    #$ModLoad imtcp
    #$InputTCPServerRun 514
    
  7. [GUEST] Add the following /etc/rsyslog.d/50-default.conf line under the user.* one (prefixing a path with the minus sign omits flushing after every log event)

    local4.*                        /var/log/local4.log
    
  8. [GUEST] Restart Syslog service

    service rsyslog restart
  9. [HOST] Restart the VM

    vagrant reload
  10. [GUEST] Make sure RSyslog is running

    ps -A | grep rsyslog
  11. [GUEST] Check RSyslog configuration

    rsyslogd -N1
  12. [GUEST] Check Linux system log for RSyslog errors

    cat /var/log/syslog | grep rsyslog
  13. [GUEST] Perform a local test

    logger --server 127.0.0.1 --port 514 --priority local4.error "TCP local test"
    logger --server 127.0.0.1 --port 514 --priority local4.warning --udp "UDP local test"
    tail -3 /var/log/syslog
    tail -3 /var/log/local4.log
  14. [GUEST] Prepare for a remote test

    tail -f /var/log/syslog

    OR

    tcpdump port 514 -vv
  15. [HOST] Perform a remote test

    telnet 127.0.0.1 1514
  16. [HOST] Perform a remote test with the NLog target (configuring it to use the Local4 facility)