{"id":200,"date":"2014-03-22T01:11:27","date_gmt":"2014-03-22T00:11:27","guid":{"rendered":"http:\/\/labo.sebipic.fr\/?p=200"},"modified":"2014-03-22T01:11:27","modified_gmt":"2014-03-22T00:11:27","slug":"logwatch-ou-comment-je-surveille-les-logs","status":"publish","type":"post","link":"https:\/\/www.maisse-sebastien.fr\/index.php\/logwatch-ou-comment-je-surveille-les-logs\/","title":{"rendered":"Logwatch : o\u00f9 comment je surveille les logs !"},"content":{"rendered":"<p>Vous avez un serveur linux, probl\u00e8me, vous n&rsquo;avez pas le temps de faire le tour de ses logs.<\/p>\n<p>A ce l\u00e0, une r\u00e9ponse : <a title=\"Site officiel de Logwatch\" href=\"http:\/\/www.logwatch.org\">Logwatch<\/a><\/p>\n<p>Ce logiciel permet d&rsquo;analyser les diff\u00e9rents logs d&rsquo;un linux et de g\u00e9n\u00e9rer un rapport d\u00e9taill\u00e9.<\/p>\n<p>Voici une petite proc\u00e9dure pour l&rsquo;installer sur votre syst\u00e8me :<\/p>\n<p><strong>aptitude install logwatch<\/strong><\/p>\n<p>Puis on copie le fichier de config&rsquo; :<\/p>\n<p><strong>sudo cp \/usr\/share\/logwatch\/default.conf\/logwatch.conf \/etc\/logwatch\/conf\/<\/strong><\/p>\n<p>Ensuite, on \u00e9dite le fichier de configuration :<\/p>\n<p><strong>sudo nano \/etc\/logwatch\/conf\/logwatch.conf<\/strong><\/p>\n<p>Au niveau config voici ce que l&rsquo;on peut faire :<\/p>\n<p><strong>LogDir = \/var\/log<\/strong><br \/>\n<strong>TmpDir = \/var\/cache\/logwatch<\/strong><br \/>\n<strong>Output = mail<\/strong><br \/>\n<strong>Format = html<\/strong><br \/>\n<strong>Encode = none<\/strong><br \/>\n<strong>MailTo = le1eremail@mondomaine.fr eventuellement2email@mondomaine.fr<\/strong><br \/>\n<strong>MailFrom = Logwatch@mondomaine.fr<\/strong><br \/>\n<strong>Filename = \/tmp\/logwatch<\/strong><br \/>\n<strong>Archives = Yes<\/strong><br \/>\n<strong>Range = all<\/strong><br \/>\n<strong>Detail = Med<\/strong><br \/>\n<strong>Service = All<\/strong><br \/>\n<strong>Service = \u00ab\u00a0-zz-network\u00a0\u00bb<\/strong><br \/>\n<strong>Service = \u00ab\u00a0-zz-sys\u00a0\u00bb <\/strong><br \/>\n<strong>Service = \u00ab\u00a0-eximstats\u00a0\u00bb<\/strong><\/p>\n<p>On enregistre les modifications.<\/p>\n<p>Ensuite, on lance la commande :<\/p>\n<p><strong>sudo logwatch<\/strong><\/p>\n<p>Ceci va lancer le programme logwatch puis envoyer le rapport version html vers la boite e-mail d\u00e9fini.<\/p>\n<p>Voici un exemple de rapport HTML :<\/p>\n<div id=\"attachment_203\" style=\"width: 594px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/labo.sebipic.fr\/wp-content\/uploads\/2014\/03\/logwatch_rapport_html.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-203\" class=\"size-large wp-image-203\" alt=\"Rapport HTML de Logwatch\" src=\"http:\/\/labo.sebipic.fr\/wp-content\/uploads\/2014\/03\/logwatch_rapport_html-1024x165.png\" width=\"584\" height=\"94\" srcset=\"https:\/\/www.maisse-sebastien.fr\/wp-content\/uploads\/2014\/03\/logwatch_rapport_html-1024x165.png 1024w, https:\/\/www.maisse-sebastien.fr\/wp-content\/uploads\/2014\/03\/logwatch_rapport_html-300x48.png 300w, https:\/\/www.maisse-sebastien.fr\/wp-content\/uploads\/2014\/03\/logwatch_rapport_html-500x80.png 500w, https:\/\/www.maisse-sebastien.fr\/wp-content\/uploads\/2014\/03\/logwatch_rapport_html.png 1087w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><p id=\"caption-attachment-203\" class=\"wp-caption-text\">Rapport HTML de Logwatch<\/p><\/div>\n<p>Et vous, vous utilisez quel logiciel pour analyser vos logs ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vous avez un serveur linux, probl\u00e8me, vous n&rsquo;avez pas le temps de faire le tour de ses logs. A ce l\u00e0, une r\u00e9ponse : Logwatch Ce logiciel permet d&rsquo;analyser les diff\u00e9rents logs d&rsquo;un linux et de g\u00e9n\u00e9rer un rapport d\u00e9taill\u00e9. &hellip; <a href=\"https:\/\/www.maisse-sebastien.fr\/index.php\/logwatch-ou-comment-je-surveille-les-logs\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"two_page_speed":[],"footnotes":""},"categories":[3],"tags":[107,109,32,105,104,108,20,106],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-informatique","tag-analyse","tag-journaux","tag-linux","tag-log","tag-logwatch","tag-parse","tag-serveur","tag-surveillance"],"_links":{"self":[{"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":6,"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":207,"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/posts\/200\/revisions\/207"}],"wp:attachment":[{"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/media?parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/categories?post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.maisse-sebastien.fr\/index.php\/wp-json\/wp\/v2\/tags?post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}