{"id":742,"date":"2011-03-24T18:42:49","date_gmt":"2011-03-24T09:42:49","guid":{"rendered":"http:\/\/www.key-p.com\/blog\/staff\/?p=742"},"modified":"2011-03-24T18:48:22","modified_gmt":"2011-03-24T09:48:22","slug":"ubuntu%e3%81%ablogwatch%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.key-p.com\/blog\/staff\/archives\/742","title":{"rendered":"Ubuntu\u306bLogwatch\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>\n\u30c8\u30de\u30c8\uff20\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e91\u3005\u62c5\u5f53\u3067\u3059\u3002<br \/>\n<strong><\/strong><br \/>\nUbuntu\u306bLogwatch\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u6307\u5b9a\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3078\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<br \/>\nRed Hat\u7cfb\uff08RHEL\u3084CentOS\uff09\u3067\u306f\u3001\u6a19\u6e96\u3067\u5165\u3063\u3066\u3044\u307e\u3059\u304c\u3001Ubuntu\u306b\u306f\u5165\u3063\u3066\u3044\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3001\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n<strong><\/strong><br \/>\n\u25a0\u691c\u8a3c\u74b0\u5883<br \/>\n<\/p>\n<blockquote><p>\n\u30b5\u30fc\u30d0\uff1aUbuntu 8.04.4 LTS<\/p><\/blockquote>\n<p>\n<strong><\/strong><br \/>\n\u25a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<br \/>\n<\/p>\n<blockquote><p>\nsudo apt-get update<br \/>\nsudo apt-get install logwatch<\/p><\/blockquote>\n<p>\n<strong><\/strong><br \/>\n\u25a0\u8a2d\u7f6e\u3055\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4e2d\u8eab\uff08crontab\u304b\u3089\u81ea\u52d5\u5b9f\u884c\u3055\u308c\u307e\u3059\uff09<br \/>\n<\/p>\n<blockquote><p>\n$ cat \/etc\/cron.daily\/00logwatch <br \/>\n#!\/bin\/bash<br \/>\n<br \/>\n#Check if removed-but-not-purged<br \/>\ntest -x \/usr\/share\/logwatch\/scripts\/logwatch.pl || exit 0<br \/>\n==&gt;\u300ctest -x\u300d\u3067\u3001\u5b9f\u884c\u53ef\u80fd\u304b\u3092\u8a55\u4fa1\u3057\u3001\u5b9f\u884c\u53ef\u80fd\u3067\u7121\u3051\u308c\u3070\u3001\u300cexit 0\u300d\u3067\u7d42\u4e86<br \/>\n<br \/>\n#execute<br \/>\n\/usr\/sbin\/logwatch &#045;&#045;mailto<br \/>\n==&gt;logwatch\u3092\u3001\u300c&#045;&#045;mailto\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u5b9f\u884c<\/p><\/blockquote>\n<p>\n<strong><\/strong><br \/>\n<!--more--><br \/>\n\u25a0\u30e1\u30fc\u30eb\u306e\u5b9b\u5148\u3092\u5909\u66f4<br \/>\n<\/p>\n<blockquote><p>\n$ grep \"MailTo\" \/usr\/share\/logwatch\/default.conf\/logwatch.conf<br \/>\nMailTo = root<br \/>\n==&gt;\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u3001\u300croot\u300d\u5b9b\u306b\u98db\u3076\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b<br \/>\n\u300clogwatch.conf\u300d\u5074\u3067\u3082\u8a2d\u5b9a\u51fa\u6765\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u3001\u300caliases\u300d\u3067\u8ee2\u9001\u8a2d\u5b9a\u3092\u3057\u307e\u3059<br \/>\n<br \/>\n$ sudo vim \/etc\/aliases<br \/>\n-------------------------------------------------------------<br \/>\n# Added by installer for initial user<br \/>\nroot:\tadmin@example.com<br \/>\n==&gt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059<br \/>\n-------------------------------------------------------------<br \/>\n<br \/>\n$ sudo newaliases <\/p><\/blockquote>\n<p>\n<strong><\/strong><br \/>\n\u25a0\u3044\u308d\u3044\u308d\u306a\u5b9f\u884c\u65b9\u6cd5<br \/>\n<\/p>\n<blockquote><p>\n$ logwatch<br \/>\n==&gt;\u30bf\u30fc\u30df\u30ca\u30eb\u4e0a\u306b\u8868\u793a<br \/>\n<br \/>\n$ logwatch &#045;&#045;mailto<br \/>\n==&gt;\u30e1\u30fc\u30eb\u9001\u4fe1\uff08\u300clogwatch.conf\u300d\u5185\u306e\u3001MailTo\u8a2d\u5b9a\u5024\u5b9b\u306b\u5c4a\u304d\u307e\u3059\uff09<br \/>\n<br \/>\n$ logwatch &#045;&#045;mailto admin@example.com<br \/>\n==&gt;\u6307\u5b9a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3078\u30e1\u30fc\u30eb\u9001\u4fe1<br \/>\n<br \/>\n$ logwatch &#045;&#045;output html &gt; repo.html<br \/>\n==&gt;HTML\u5f62\u5f0f\u3067\u51fa\u529b\u3000<a href=\"http:\/\/www.key-p.com\/blog\/staff\/wp-content\/uploads\/2011\/03\/Logwatch.png\">\u25a0<\/a><\/p><\/blockquote>\n<p>\n<strong><\/strong><br \/>\n\u25a0\u5c0f\u30cd\u30bf<br \/>\n<\/p>\n<blockquote><p>\n$ which logwatch<br \/>\n\/usr\/sbin\/logwatch<br \/>\n<br \/>\n$ ls -l \/usr\/sbin\/logwatch<br \/>\nlrwxrwxrwx 1 root root 37 2011-03-23 14:01 \/usr\/sbin\/logwatch -&gt; ..\/share\/logwatch\/scripts\/logwatch.pl<br \/>\n==&gt;\u300clogwatch\uff08\u30b3\u30de\u30f3\u30c9\uff09\u300d\u306f\u3001\u300clogwatch.pl\uff08perl\uff09\u300d\u3067\u3057\u305f<\/p><\/blockquote>\n<p>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c8\u30de\u30c8\uff20\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e91\u3005\u62c5\u5f53\u3067\u3059\u3002 Ubuntu\u306bLogwatch\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb &hellip; <a href=\"https:\/\/www.key-p.com\/blog\/staff\/archives\/742\">\u7d9a\u304d\u3092\u8aad\u3080 <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":[],"categories":[12],"tags":[],"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/742"}],"collection":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/comments?post=742"}],"version-history":[{"count":33,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/742\/revisions"}],"predecessor-version":[{"id":776,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/742\/revisions\/776"}],"wp:attachment":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/media?parent=742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/categories?post=742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/tags?post=742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}