{"id":1539,"date":"2024-10-15T20:17:44","date_gmt":"2024-10-15T12:17:44","guid":{"rendered":"http:\/\/blue.yn.cn\/?p=1539"},"modified":"2024-10-23T22:02:13","modified_gmt":"2024-10-23T14:02:13","slug":"%e7%bd%91%e7%bb%9c%e8%ae%be%e5%a4%87%e6%97%a5%e5%bf%97%e7%9a%84%e7%9b%91%e6%8e%a7%e9%a1%b9","status":"publish","type":"post","link":"http:\/\/blue.yn.cn\/?p=1539","title":{"rendered":"\u76d1\u63a7\u7f51\u7edc\u8bbe\u5907\u65e5\u5fd7"},"content":{"rendered":"<p>\u534e\u4e09\u9632\u706b\u5899<code>F5000<\/code>\u7684<code>log<\/code>\u65e5\u5fd7\u5df2\u7ecf\u8f6c\u5b58\u5230<code>logstash<\/code>\u865a\u673a\u4e0a\uff0c\u7136\u540e\u5bf9\u65e5\u5fd7\u6570\u636e\u7ecf\u8fc7\u7ed3\u6784\u5316\u5904\u7406\u540e\u518d\u8f6c\u5b58\u5230<code>elastic<\/code>\u4e0a\u5b58\u50a8<\/p>\n<p><code>zabbix<\/code>\u5982\u4f55\u76d1\u63a7\u65e5\u5fd7\u4e2d\u7684\u9519\u8bef\u4fe1\u606f\uff08\u5982\u542b\u6709\u5173\u952e\u5b57<code>failed\u3001error\u3001down<\/code>\uff09\u7136\u540e\u89e6\u53d1\u544a\u8b66\uff1f<\/p>\n<h4>logstash\u865a\u673a\u4e0a\u521b\u5efazabbix\u81ea\u5b9a\u4e49\u7528\u6237\u53c2\u6570<\/h4>\n<pre><code class=\"language-bash\">cat \/etc\/zabbix\/zabbix_agent2.d\/default.conf\nUserParameter=system.log,tac \/var\/log\/network\/h3c\/$(date +%Y_%m_%d)-x.x.x.x.log 2&gt; \/dev\/null | egrep -i &quot;fail|error|down&quot; | head -1\n\n# rsyslog\u914d\u7f6e\ncat \/etc\/rsyslog.conf\n$umask 0000\n$FileCreateMode 0755  # \u65b0\u5efa\u7684\u65e5\u5fd7\u6587\u4ef6\u7684\u6743\u9650\u9700\u8ba9\u5176\u4ed6\u7528\u6237\u53ef\u8bfb\n\n# agent\u7aef\u6d4b\u8bd5\nzabbix_agent2 -t system.log\nsystem.log                                    [s|Oct 15 19:30:39 2024 FW1 %%10LB\/5\/LB_CHANGE_LINKQUOTE_PROBERESULT: -DevIP=x.x.x.x; The probe state of (link group dx,link dx) template dx was changed to Failed.]\n\n# server\u7aef\u6d4b\u8bd5\nzabbix_get -s x.x.x.x -k system.log\nOct 15 19:30:39 2024 FW1 %%10LB\/5\/LB_CHANGE_LINKQUOTE_PROBERESULT: -DevIP=x.x.x.x; The probe state of (link group dx,link dx) template dx was changed to Failed.<\/code><\/pre>\n<h4>zabbix sever web\u65b0\u5efa\u76d1\u63a7\u9879<\/h4>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2024\/10\/image-1728995589803.png\" alt=\"file\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2024\/10\/image-1728995638667.png\" alt=\"file\" \/><\/p>\n<p>\u9700\u8fdb\u884c\u9884\u5904\u7406\uff0c\u4e22\u5f03\u672a\u53d8\u5316\u7684\u503c\u4ee5\u53ca\u4e22\u5f03\u4e3a\u7a7a\u884c\u7684\u503c\uff08\u5339\u914d\u7a7a\u884c\u7684\u4fdd\u7559\uff0c\u53d6\u53cd\u5373\u662f\u4e3a\u5339\u914d\u7a7a\u884c\u7684\u4e22\u5f03\uff09<br \/>\n<code>F5000<\/code>\u7684\u65e5\u5fd7\u6587\u4ef6\u4ee5\u65f6\u95f4\u505a\u6587\u4ef6\u540d\uff0c\u65b0\u7684\u4e00\u5929\u5f00\u59cb\u7684\u65f6\u5019\u53ef\u80fd\u8fd8\u6ca1\u751f\u6210\u65e5\u5fd7\u6587\u4ef6<\/p>\n<h4>\u914d\u7f6e\u89e6\u53d1\u5668<\/h4>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2024\/10\/image-1728995977966.png\" alt=\"file\" \/><\/p>\n<p><code>{x.x.x.x:system.log.diff()}=1<\/code>\u95ee\u9898\u8868\u8fbe\u5f0f\u4e3a\u76d1\u63a7\u9879\u7684\u503c\u4e0d\u4e00\u6837\u65f6\u89e6\u53d1\u544a\u8b66\uff08\u76f8\u5f53\u4e8e<code>system.log<\/code>\u76d1\u63a7\u9879\u6709\u65b0\u7684\u503c\uff09<br \/>\n\u6ce8\u610f\uff1a\u95ee\u9898\u4e8b\u4ef6\u751f\u6210\u6a21\u5f0f\u9700\u914d\u7f6e\u4e3a\u591a\u91cd\uff0c\u8fd9\u6837\u5f53\u544a\u8b66\u672a\u6062\u590d\u65f6\u53ef\u4ee5\u591a\u6b21\u89e6\u53d1\u544a\u8b66\u3002<\/p>\n<ul>\n<li>\u6548\u679c\u5982\u4e0b\uff1a<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2024\/10\/image-1728996215907.png\" alt=\"file\" \/><\/p>\n<h4>\u534e\u4e09\u9632\u706b\u5899\u914d\u7f6e<\/h4>\n<p>\u534e\u4e09<code>F5000<\/code>\u9700\u914d\u7f6e<code>info-center syslog utf-8 enable<\/code><br \/>\n\u4e0d\u7136\uff0c<code>rsyslog<\/code>\u4e3b\u673a\u4e2d\u751f\u6210\u7684\u65e5\u5fd7\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u662f<code>latin1<\/code>\uff0c\u5bfc\u81f4\u4e2d\u6587\u4e71\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u534e\u4e09\u9632\u706b\u5899F5000\u7684log\u65e5\u5fd7\u5df2\u7ecf\u8f6c\u5b58\u5230logstash\u865a\u673a\u4e0a\uff0c\u7136\u540e\u5bf9\u65e5\u5fd7\u6570\u636e\u7ecf\u8fc7\u7ed3\u6784\u5316\u5904\u7406\u540e\u518d\u8f6c\u5b58\u5230ela&#8230; &raquo; <a class=\"read-more-link\" href=\"http:\/\/blue.yn.cn\/?p=1539\">\u9605\u8bfb\u5168\u6587<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1539","post","type-post","status-publish","format-standard","hentry","category-zabbix"],"_links":{"self":[{"href":"http:\/\/blue.yn.cn\/index.php?rest_route=\/wp\/v2\/posts\/1539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blue.yn.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blue.yn.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blue.yn.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blue.yn.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1539"}],"version-history":[{"count":7,"href":"http:\/\/blue.yn.cn\/index.php?rest_route=\/wp\/v2\/posts\/1539\/revisions"}],"predecessor-version":[{"id":1592,"href":"http:\/\/blue.yn.cn\/index.php?rest_route=\/wp\/v2\/posts\/1539\/revisions\/1592"}],"wp:attachment":[{"href":"http:\/\/blue.yn.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blue.yn.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1539"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blue.yn.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}