{"id":3739,"date":"2024-01-30T17:00:22","date_gmt":"2024-01-30T09:00:22","guid":{"rendered":"https:\/\/dasmz.com\/?p=3739"},"modified":"2024-01-30T22:49:38","modified_gmt":"2024-01-30T14:49:38","slug":"%e5%9f%ba%e4%ba%8eopeneuler-22-03%e5%86%85%e7%bd%91%e7%8e%af%e5%a2%83%ef%bc%8c%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85zabbix-agent%e5%ae%a2%e6%88%b7%e7%ab%af-2024-01-30","status":"publish","type":"post","link":"https:\/\/dasmz.com\/?p=3739","title":{"rendered":"\u57fa\u4e8eOpenEuler 22.03\u5185\u7f51\u73af\u5883\uff0c\u7f16\u8bd1\u5b89\u88c5zabbix agent\u5ba2\u6237\u7aef 2024-01-30"},"content":{"rendered":"\n<p><strong>\u524d\u7f00\u3001\u6587\u6863\u4fee\u6539\u8bb0\u5f55<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">20240130 \u521d\u59cb\u5316\u7f16\u8f91\u6b64\u6587\u7ae0\uff0c\u5b8c\u7a3f<\/pre>\n\n\n\n<p><strong>\u7ae0\u82821\u3001\u9700\u6c42\u63cf\u8ff0<\/strong><\/p>\n\n\n\n<p>\u5ba2\u6237\u5185\u7f51\u4fa7\uff0c\u6709\u90e8\u5206\u56fd\u4ea7\u5316\u7684\u64cd\u4f5c\u7cfb\u7edfOpenEuler 22.03\uff0c\u9700\u8981\u5bf9\u5176\u8fdb\u884czabbix agent\u76d1\u63a7\u5ba2\u6237\u7aef\u7684\u5b89\u88c5\uff0c\u7531\u4e8e\u6ca1\u6709\u516c\u7f51\uff0c\u53ea\u80fd\u9009\u62e9\u7f16\u8bd1\u5b89\u88c5\u8fd9\u4e2a\u8def\u5b50\u3002<\/p>\n\n\n\n<p>OpenEuler 22.03\u76f8\u5f53\u4e8e\u5957\u76ae\u7684CentOS 8\u7cfb\u7edf\uff0c\u8fd9\u4e2a\u7f16\u8bd1\u4e5f\u5c31\u6ca1\u4ec0\u4e48\u592a\u5927\u7684\u96be\u5ea6\uff0c\u53ea\u8981\u5904\u7406\u597d\u4f9d\u8d56\u5c31\u53ef\u4ee5\u3002<\/p>\n\n\n\n<p><strong>\u7ae0\u82822\u3001Zabbix Agent\u6e90\u7801\u8d44\u6e90\u4e0b\u8f7d<\/strong><\/p>\n\n\n\n<p>\u5728zabbix\u5b98\u7f51\uff0c\u4e0b\u8f7d <a href=\"https:\/\/cdn.zabbix.com\/zabbix\/sources\/stable\/6.0\/zabbix-6.0.26.tar.gz\" data-type=\"URL\" data-id=\"https:\/\/cdn.zabbix.com\/zabbix\/sources\/stable\/6.0\/zabbix-6.0.26.tar.gz\">Zabbix 6.0 LTS \u6e90\u7801\u5305<\/a> \uff0c \u9009\u62e9Zabbix Sources\uff0c\u9009\u62e9\u6807\u7b7e zabbix 6.0 LTS\uff0c \u70b9\u51fb\u53f3\u4e0b\u65b9\u7684 Download\u6309\u94ae\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/cdn.zabbix.com\/zabbix\/sources\/stable\/6.0\/zabbix-6.0.26.tar.gz\">https:\/\/cdn.zabbix.com\/zabbix\/sources\/stable\/6.0\/zabbix-6.0.26.tar.gz<\/a><\/p>\n\n\n\n<p>\u65f6\u95f4\u62332024-01-30 16:58 \uff0c\u7f16\u5199\u6b64\u6587\u7ae0\u65f6\uff0c\u4e0b\u8f7d\u5230\u7684\u7248\u672c\u662f6.0.26\uff0c\u8bfb\u8005\u4f60\u4eec\u6839\u636e\u5b9e\u9645\u6700\u65b0\u7248\u672c\u6765\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img decoding=\"async\" loading=\"lazy\" width=\"1296\" height=\"842\" src=\"https:\/\/dasmz.com\/wp-content\/uploads\/2024\/01\/Screenshot-from-2024-01-30-16-57-06.png\" alt=\"\" class=\"wp-image-3740\" srcset=\"https:\/\/dasmz.com\/wp-content\/uploads\/2024\/01\/Screenshot-from-2024-01-30-16-57-06.png 1296w, https:\/\/dasmz.com\/wp-content\/uploads\/2024\/01\/Screenshot-from-2024-01-30-16-57-06-768x499.png 768w, https:\/\/dasmz.com\/wp-content\/uploads\/2024\/01\/Screenshot-from-2024-01-30-16-57-06-624x405.png 624w\" sizes=\"(max-width: 1296px) 100vw, 1296px\" \/><\/figure>\n\n\n\n<p>\u5c06\u4e0b\u8f7d\u5230\u7684 zabbix-6.0.26.tar.gz \u4e0a\u4f20\u5230\u9700\u8981\u90e8\u7f72zabbix agent\u7684OpenEuler 22.03\u865a\u62df\u673a \/root\/\u76ee\u5f55\u4e0b\u3002<\/p>\n\n\n\n<p>\u7ae0\u82823\u3001\u5b89\u88c5\u4f9d\u8d56<\/p>\n\n\n\n<p>\u5982\u679c\u6709\u516c\u7f51\u73af\u5883\uff0c\u6709\u4e00\u4e2a\u9760\u8c31\u7684\u6e90\uff0c\u90a3\u4e48\u5b89\u88c5\u4f9d\u8d56\u4ec0\u4e48\u7684\uff0c\u5c31\u975e\u5e38\u7b80\u5355\uff0c\u4f46\u662f\uff0c\u76ee\u524d\uff0c\u5ba2\u6237\u4fa7\u7684\u73af\u5883\u662f\u7eaf\u5185\u7f51\uff0c\u5728\u6ca1\u6709\u5185\u7f51\u6e90\u7684\u73af\u5883\u4e0b\uff0c\u53ea\u80fd\u7528\u8fc7\u6302\u8f7dISO\u6587\u4ef6\u7684\u65b9\u5f0f\uff0c\u6765\u5b89\u88c5\u4f9d\u8d56\u5305\u3002<\/p>\n\n\n\n<p>\u8fd8\u6709\uff0c\u987a\u4fbf\u8bf4\u4e00\u53e5\uff0c\u5b89\u88c5OpenEuler 22.03\uff0c\u6bd4\u8f83\u63a8\u8350\u7684\u5206\u8fa8\u7387\u662f1920 \u00d7 1080\uff0c\u63a8\u8350\u5b89\u88c5\u7cfb\u7edf\u7684\u65f6\u5019\uff0c\u5c31\u5b89\u88c5 Standard \/ Development Tools\u8fd9\u4e24\u4e2a\u5305\uff0c\u5927\u7ea6\u9700\u8981\u5b89\u88c5865\u4e2a\u5305\uff0c\u5e38\u7528\u7684\u4f9d\u8d56\u5305\u5c31\u90fd\u5b89\u88c5\u4e86\uff0c\u8fd9\u7c7b\u7cfb\u7edf\uff0c\u5982\u679c\u7f3a\u4f9d\u8d56\uff0c\u53c8\u662f\u5185\u7f51\u73af\u5883\uff0c\u4f1a\u633a\u9ebb\u70e6\u7684\uff0c\u673a\u623f\u7c7b\u7684\u73b0\u573a\u5b9e\u65bd\uff0c\u6700\u597d\u63d0\u524d\u51c6\u5907\u597dISO\u955c\u50cf\u5305\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img decoding=\"async\" loading=\"lazy\" width=\"609\" height=\"439\" src=\"https:\/\/dasmz.com\/wp-content\/uploads\/2024\/01\/Screenshot-from-2024-01-30-21-46-21.png\" alt=\"\" class=\"wp-image-3751\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u5982\u679c\u662f\u516c\u7f51\nroot@SERVER:~# dnf install gcc make pcre-devel\n\n# \u5982\u679c\u662f\u5185\u7f51\uff0c\u5982\u679c\u6ca1\u6709\u66f4\u597d\u7684\u529e\u6cd5\u5b89\u88c5\u4f9d\u8d56\uff0c\u63a8\u8350\u6302\u8f7d\u5bf9\u5e94\u7cfb\u7edf\u7684 openEuler-22.03-LTS-everything-x86_64-dvd.iso \u5e26everything\u6807\u7b7e\u7684\uff0c\u8fd9\u79cd\u6ee1\u914d\u7684\u955c\u50cf\u3002\nroot@SERVER:~# mkdir \/mnt\/iso\nroot@SERVER:~# mount -t iso9660 -o loop \/root\/openEuler-22.03-LTS-x86_64-dvd.iso \/mnt\/iso\nroot@SERVER:~# cat > openeuler.repo &lt;&lt; EOF\n[OpenEulerBase]\nname=OpenEuler 22.03 base\nbaseurl=file:\/\/\/mnt\/iso\/\n# gpgkey=file:\/\/\/mnt\/iso\/\n# gpgcheck=1    # 1\u8868\u793a\u68c0\u67e5 0\u8868\u793a\u4e0d\u68c0\u67e5\ngpgcheck=0\nenabled=1\nEOF\nroot@SERVER:~# dnf clean all\nroot@SERVER:~# dnf update<\/pre>\n\n\n\n<p><strong>\u7ae0\u82824\u3001\u7f16\u8bd1\u5b89\u88c5zabbix agent<\/strong><\/p>\n\n\n\n<p>4.1\u3001\u589e\u52a0\u7528\u6237\u548c\u7ec4<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u589e\u52a0\u7528\u6237\u548c\u7ec4\nroot@SERVER:~# groupadd zabbix \nroot@SERVER:~# useradd -g zabbix -s \/sbin\/nologin -c \"Zabbix Monitoring System\" zabbix <\/pre>\n\n\n\n<p>4.2\u3001\u68c0\u67e5\u4e00\u4e0b\u4f9d\u8d56<\/p>\n\n\n\n<p>\u786e\u8ba4\u5982\u4e0b\u7684gcc\/make\/pcre\u7684\u4f9d\u8d56\u5305\uff0c\u662f\u5426\u5b89\u88c5\u4e86\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53c2\u8003\u524d\u4e00\u4e2a\u7ae0\u8282<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@SERVER:~# dnf install  gcc make pcre-devel <\/pre>\n\n\n\n<p>4.3\u3001\u7f16\u8bd1zabbix agent 6.0 LTS<\/p>\n\n\n\n<p>\u7f16\u8bd1\u5b89\u88c5 6.0.26 LTS\u7248\u672c\u7684\u8fc7\u7a0b\u5982\u4e0b\uff0c\u4e14\u5047\u8bbe\u6e90\u7801\u5305\u5b58\u653e\u4f4d\u7f6e\u4e3a \/root\/src\/zabbix-6.0.26.tar.gz<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@SERVER:~# cd \/root\/src\/\nroot@SERVER:~# tar -zxf zabbix-6.0.26.tar.gz \nroot@SERVER:~# cd zabbix-6.0.26\nroot@SERVER:~# mkdir -p \/usr\/local\/zabbix \/var\/log\/zabbix \/etc\/zabbix\nroot@SERVER:~# .\/configure --prefix=\/usr\/local\/zabbix --sysconfdir=\/etc\/zabbix --enable-agent \nroot@SERVER:~# make \nroot@SERVER:~# make install \nroot@SERVER:~# chown -R zabbix:zabbix \/usr\/local\/zabbix\/ \/var\/log\/zabbix \/etc\/zabbix<\/pre>\n\n\n\n<p>\u672c\u6b21\u7f16\u8bd1\u5b89\u88c5\u540e\uff0c<\/p>\n\n\n\n<p>zabbix agent \u6267\u884c\u6587\u4ef6\u8def\u5f84 \/usr\/local\/zabbix\/sbin\/zabbix_agentd<\/p>\n\n\n\n<p>zabbix agent \u914d\u7f6e\u6587\u4ef6\u8def\u5f84 \/etc\/zabbix\/zabbix_agentd.conf<\/p>\n\n\n\n<p>4.4\u3001\u4fee\u6539zabbix agent\u7684\u6267\u884c\u6587\u4ef6\u548c\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<p>4.4.1\u3001\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u8def\u5f84 \/etc\/zabbix\/zabbix_agentd.conf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PidFile=\/var\/log\/zabbix\/zabbix_agentd.pid \nLogFile=\/var\/log\/zabbix\/zabbix_agentd.log \nServer=192.168.112.170    #Zabbix\u670d\u52a1\u7aefip\u5730\u5740 \nServerActive=192.168.112.170    #Zabbix\u670d\u52a1\u7aefip\u5730\u5740 \nHostname=someywname    #\u5fc5\u987b\u4e0e\u5728Zabbix WEB\u7ba1\u7406\u9875\u9762\u521b\u5efa\u4e3b\u673a\u65f6\u7684hostname\u4e00\u81f4 <\/pre>\n\n\n\n<p>4.4.2\u3001\u590d\u5236\u5e76\u4fee\u6539\u6267\u884c\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@SERVER:~# cp \/root\/src\/zabbix-6.0.26\/misc\/init.d\/tru64\/zabbix_agentd \/etc\/init.d\/zabbix_agentd\nroot@SERVER:~# chmod +x \/etc\/init.d\/zabbix_agentd<\/pre>\n\n\n\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 \/etc\/init.d\/zabbix_agentd \u4fee\u6539DAEMON\/PIDFILE\u4e24\u884c\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DAEMON=\/usr\/local\/zabbix\/sbin\/zabbix_agentd\nPIDFILE=\/var\/log\/zabbix\/zabbix_agentd.pid<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u4e34\u65f6\u6d4b\u8bd5\u4e00\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/etc\/init.d\/zabbix_agentd  start    # \u5f00\u542f\n\/etc\/init.d\/zabbix_agentd  stop    # \u5173\u95ed<\/pre>\n\n\n\n<p>4.5\u3001\u914d\u7f6e\u5f00\u673a\u542f\u52a8\u670d\u52a1<\/p>\n\n\n\n<p>\u914d\u7f6e\u5f00\u673a\u542f\u52a8\u7684\u670d\u52a1\u9879 \/etc\/systemd\/system\/zabbix-agent.service<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[Unit]\nDescription=Zabbix Agent\nAfter=syslog.target\nAfter=network.target\n\n[Service]\nType=simple\nUser=zabbix\nGroup=zabbix\nRestart=on-failure\nPIDFile=\/var\/log\/zabbix\/zabbix_agentd.pid\nExecStart=\/usr\/local\/zabbix\/sbin\/zabbix_agentd -c \/etc\/zabbix\/zabbix_agentd.conf \n\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n\n\n\n<p>4.6\u3001\u5f00\u542fzabbix-agent\u670d\u52a1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@SERVER:~# systemctl daemon-reload\nroot@SERVER:~# systemctl restart zabbix-agent\nroot@SERVER:~# systemctl enable zabbix-agent<\/pre>\n\n\n\n<p><strong>\u9644\u5f551\u3001\u89c6\u9891\u64cd\u4f5c\u6f14\u793a<\/strong><\/p>\n\n\n\n<p>\u6682\u7a7a<\/p>\n\n\n\n<p><strong>\u9644\u5f552\u3001@Dasmz<\/strong><\/p>\n\n\n\n<p>\u535a\u5ba2\u5185\uff0c\u6240\u6709\u6559\u7a0b\u4e3a\u624b\u6253\u539f\u521b\u6559\u7a0b\uff0c\u5982\u679c\u6280\u672f\u6559\u7a0b\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u6b22\u8fce\u6253\u8d4f\u4f5c\u8005\u3002\u6280\u672f\u5c42\u9762\uff0c\u95fb\u9053\u6709\u5148\u540e\uff0c\u5982\u6709\u758f\u6f0f\u3001\u9519\u8bef\uff0c\u6b22\u8fce\u6307\u6b63\u3002\u6280\u672f\u535a\u5ba2\u7684\u5185\u5bb9\uff0c\u4e00\u822c\u5177\u6709\u4e00\u5b9a\u7684\u73af\u5883\u4f9d\u8d56\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u5e74\u4ee3\u4f9d\u8d56\uff0c\u914c\u60c5\u53c2\u8003\u5176\u4e2d\u7684\u5185\u5bb9\uff0c\u8bf7\u52ff\u5b8c\u5168\u7167\u642c\u7167\u6284\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u535a\u5ba2\u5185\u5df2\u63d0\u53ca\u7684\u4e13\u4e1a\u77e5\u8bc6\uff0c\u5982\u679c\u9700\u8981\u6280\u672f\u6307\u5bfc\uff0c\u6b22\u8fce\u8054\u7cfb\u6211\uff0c\u4ec5\u9700\u652f\u4ed8\u5de5\u65f6\u8d39<\/p>\n\n\n\n<p>Twitter: <a href=\"https:\/\/twitter.com\/fdmove\">Dasmz<\/a><\/p>\n\n\n\n<p>Youtube: <a href=\"https:\/\/www.youtube.com\/@DasmzStudio\" data-type=\"URL\" data-id=\"https:\/\/www.youtube.com\/@DasmzStudio\">@DasmzStudio<\/a><\/p>\n\n\n\n<p>Telegram: <a href=\"https:\/\/t.me\/fdmove\" data-type=\"URL\" data-id=\"https:\/\/t.me\/fdmove\">@Dasmz<\/a><\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"574\" height=\"446\" src=\"https:\/\/dasmz.com\/wp-content\/uploads\/2020\/12\/DONATE.jpg\" alt=\"Donate\" class=\"wp-image-18\"\/><figcaption class=\"wp-element-caption\">\u4e91\u4e5e\u8ba8<\/figcaption><\/figure><\/div>","protected":false},"excerpt":{"rendered":"<p>\u524d\u7f00\u3001\u6587\u6863\u4fee\u6539\u8bb0\u5f55 20240130 \u521d\u59cb\u5316\u7f16\u8f91\u6b64\u6587\u7ae0\uff0c\u5b8c\u7a3f \u7ae0\u82821\u3001\u9700\u6c42\u63cf\u8ff0 \u5ba2\u6237\u5185\u7f51\u4fa7\uff0c\u6709\u90e8\u5206\u56fd\u4ea7\u5316\u7684\u64cd\u4f5c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[125,126,127],"_links":{"self":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts\/3739"}],"collection":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3739"}],"version-history":[{"count":15,"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts\/3739\/revisions"}],"predecessor-version":[{"id":3769,"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts\/3739\/revisions\/3769"}],"wp:attachment":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}