{"id":407,"date":"2014-01-09T20:52:49","date_gmt":"2014-01-10T03:52:49","guid":{"rendered":"http:\/\/somethingk.com\/main\/?p=407"},"modified":"2014-01-09T21:04:55","modified_gmt":"2014-01-10T04:04:55","slug":"logwatch-on-ubuntu","status":"publish","type":"post","link":"https:\/\/somethingk.com\/main\/logwatch-on-ubuntu\/","title":{"rendered":"Logwatch on Ubuntu"},"content":{"rendered":"<p><strong>What is logwatch?<\/strong><\/p>\n<p>It is an awesome monitoring tool. I have it running on one of my servers. Every night I get a status report on the behavior of my server.<\/p>\n<p><strong>Logwatch\u00a0benefits:<\/strong><\/p>\n<ul>\n<li>\n<div>Perform daily log analysis every night on a host machine<\/div>\n<\/li>\n<li>\n<div>Can be configured to email reports to admin users<\/div>\n<\/li>\n<li>\n<div>System Administrator Usage<\/div>\n<ul>\n<li>Easy setup<\/li>\n<\/ul>\n<ul>\n<li>Monitor host machines for all access and usage stats<\/li>\n<li>Alert suspicious usage or access attempts<\/li>\n<li>Email reports in an organized and easy to read format<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Simple Install<\/strong><\/p>\n<div>Just run the following command:<\/div>\n<pre>sudo apt-get install logwatch<\/pre>\n<p><strong>Configuration<\/strong><\/p>\n<div>Look into the configuration file and edit the settings to reflect the email account you want reports to be sent. By default it uses local mail. Look into the email options section to get logwatch to email external accounts like Gmail.<\/div>\n<pre>vim \/usr\/share\/logwatch\/default.conf\/logwatch.conf<\/pre>\n<pre>Output = mail\r\nFormat = html\r\nMailTo = &lt;YOUR LOCAL EMAIL&gt;<\/pre>\n<p><strong>Email Options (For Gmail, etc.)<\/strong><\/p>\n<div>Either setup a mail server like postfix or utilize another agent to send out logs via email.<\/div>\n<div><\/div>\n<div>Here is a great <a href=\"http:\/\/linuxserver2011.wordpress.com\/2011\/11\/30\/ubuntu-server-log-monitoring-via-email-without-the-need-of-a-mail-server-sendemail\/\" target=\"_blank\">tutorial<\/a> explaining an alternative to a mail server using sendmail.<\/div>\n<div>\n<p><strong>Run the Reports Daily<\/strong><\/p>\n<div>To have logwatch run daily, set the command to the crontab.<\/div>\n<pre><tt>crontab\u00a0-e<\/tt><\/pre>\n<p>The format for a cron job is:<br \/>\n(minute) (hour) (day of the month) (month) (day of the week) command<\/p>\n<p>A * stands for every.<\/p>\n<p>Here is an example of a crontab entry to run logwatch daily:<\/p>\n<pre>0 0 * * * logwatch<\/pre>\n<\/div>\n<p><strong>\u00a0Reports<\/strong><\/p>\n<p>Below are just some screenshots of the reports I receive from the tool. The reports are outdated and I no longer use the machine they detail&#8230; just in case you were curious.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatched.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter  wp-image-433\" alt=\"logwatched\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatched.png\" width=\"481\" height=\"414\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatched.png 1002w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatched-300x258.png 300w\" sizes=\"(max-width: 481px) 100vw, 481px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch2.png\"><img decoding=\"async\" class=\"aligncenter  wp-image-411\" alt=\"logwatch2\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch2.png\" width=\"562\" height=\"438\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch2.png 1172w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch2-300x233.png 300w\" sizes=\"(max-width: 562px) 100vw, 562px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch4.png\"><img decoding=\"async\" class=\"aligncenter  wp-image-409\" alt=\"logwatch4\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch4.png\" width=\"428\" height=\"416\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch4.png 892w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/logwatch4-300x291.png 300w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is logwatch? It is an awesome monitoring tool. I have it running on one of my servers. Every night I get a status report on the behavior of my server. Logwatch\u00a0benefits: Perform daily log analysis every night on a host machine Can be configured to email reports to admin users System Administrator Usage Easy setup Monitor host machines for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[108,110,109,111,107],"class_list":["post-407","post","type-post","status-publish","format-standard","hentry","category-linux","tag-logwatch","tag-monitoring","tag-sysadmin","tag-tools","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/comments?post=407"}],"version-history":[{"count":19,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/407\/revisions"}],"predecessor-version":[{"id":434,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/407\/revisions\/434"}],"wp:attachment":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/media?parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/categories?post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/tags?post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}