{"id":5528,"date":"2019-11-27T15:35:16","date_gmt":"2019-11-27T07:35:16","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=5528"},"modified":"2019-11-28T21:48:39","modified_gmt":"2019-11-28T13:48:39","slug":"logwatch","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/logwatch","title":{"rendered":"logwatch\u547d\u4ee4 – \u904d\u5386\u7cfb\u7edf\u65e5\u5fd7"},"content":{"rendered":"\n

logwatch\u547d\u4ee4\u662f\u4e00\u4e2a\u53ef\u5b9a\u5236\u548c\u53ef\u63d2\u5165\u5f0f\u7684\u65e5\u5fd7\u76d1\u89c6\u7cfb\u7edf\uff0c\u5b83\u901a\u8fc7\u904d\u5386\u7ed9\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\u800c\u4ea7\u751f\u65e5\u5fd7\u62a5\u544a\u3002logwatch\u9ed8\u8ba4\u6bcf\u5929\u6267\u884c\u4e00\u6b21\uff0c\u53ef\u4ee5\u4ece\/etc\/cron.daily\u91cc\u770b\u5230\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>logwatch [\u53c2\u6570] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

--detail<\/td>\u6307\u5b9a\u65e5\u5fd7\u62a5\u544a\u7684\u8be6\u7ec6\u7a0b\u5ea6<\/td><\/tr>
--range<\/td>\u6307\u5b9a\u5904\u7406\u65e5\u5fd7\u7684\u65e5\u671f\u8303\u56f4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong> <\/p>\n\n\n\n

\u53ea\u770bsshd\u7684\u65e5\u5fd7\u60c5\u51b5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# logwatch --service sshd --detail High<\/pre>\n\n\n\n

\u67e5\u770bsshd\u5f53\u5929\u7684\u65e5\u5fd7\u60c5\u51b5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# logwatch --service sshd --detail High --range today<\/pre>\n\n\n\n

\u67e5\u770bsshd\u6628\u5929\u7684\u65e5\u5fd7\u60c5\u51b5\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# logwatch --service sshd --detail High --range yesterday<\/pre>\n\n\n\n

\u67e5\u770bsshd\u4ece2018\u5e7410\u670824\u65e5\u52302019\u5e7410\u670824\u65e5\u7684\u65e5\u5fd7\u60c5\u51b5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# logwatch --service sshd --detail High --range 'between 10\/24\/2018 and 10\/24\/2019'<\/pre>\n","protected":false},"excerpt":{"rendered":"

logwatch\u547d\u4ee4\u662f\u4e00\u4e2a\u53ef\u5b9a\u5236\u548c\u53ef\u63d2\u5165\u5f0f\u7684\u65e5\u5fd7\u76d1\u89c6\u7cfb\u7edf\uff0c\u5b83\u901a\u8fc7\u904d\u5386\u7ed9\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\u800c\u4ea7\u751f\u65e5\u5fd7\u62a5\u544a […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5528"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=5528"}],"version-history":[{"count":2,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5528\/revisions"}],"predecessor-version":[{"id":5744,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5528\/revisions\/5744"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=5528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=5528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=5528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}