Remotely Monitor Logs via Mac OS X Terminal

System log auditing and monitoring is important in a corporate network. One way of monitoring logs can be done using SSH.

You can monitor system logs of a remote machine using the following command:

ssh adminuser@remotehost 'tail -f /var/log/system.log'
view raw gistfile1.sh hosted with ❤ by GitHub

To output it as a file on your local machine, append '> YourPath/outputLogFile'. Thus,

ssh adminuser@remotehost 'tail -f /va/log/system.log' > YourPath/outputLogFile.log
view raw gistfile1.sh hosted with ❤ by GitHub

Powered by Blogger.