{"id":45258,"date":"2024-10-06T21:36:15","date_gmt":"2024-10-06T13:36:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45258\/"},"modified":"2024-10-06T21:36:15","modified_gmt":"2024-10-06T13:36:15","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-rhel-8-%e4%b8%8a%e5%ae%89%e8%a3%9d%e5%92%8c%e9%85%8d%e7%bd%ae-nagios-core","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45258\/","title":{"rendered":"\u5982\u4f55\u5728 CentOS 8\/RHEL 8 \u4e0a\u5b89\u88dd\u548c\u914d\u7f6e Nagios Core"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-rhel-8-%e4%b8%8a%e5%ae%89%e8%a3%9d%e5%92%8c%e9%85%8d%e7%bd%ae-nagios-core-HJWZxeqHHC\">\u5982\u4f55\u5728 CentOS 8\/RHEL 8 \u4e0a\u5b89\u88dd\u548c\u914d\u7f6e Nagios Core<\/h1>\n<p>Nagios Core \u662f\u4e00\u6b3e\u5ee3\u6cdb\u4f7f\u7528\u7684\u958b\u6e90\u76e3\u63a7\u7cfb\u7d71\uff0c\u80fd\u5920\u5e6b\u52a9\u7528\u6236\u76e3\u63a7\u7db2\u7d61\u3001\u4f3a\u670d\u5668\u548c\u61c9\u7528\u7a0b\u5e8f\u7684\u72c0\u614b\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 CentOS 8 \u6216 RHEL 8 \u4e0a\u5b89\u88dd\u548c\u914d\u7f6e Nagios Core\uff0c\u8b93\u60a8\u80fd\u5920\u6709\u6548\u5730\u76e3\u63a7\u60a8\u7684 IT \u74b0\u5883\u3002<\/p>\n<h2 id=\"%e5%89%8d%e7%bd%ae%e6%a2%9d%e4%bb%b6-HJWZxeqHHC\">\u524d\u7f6e\u689d\u4ef6<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u6eff\u8db3\u4ee5\u4e0b\u8981\u6c42\uff1a<\/p>\n<ul>\n<li>\u5df2\u5b89\u88dd\u7684 CentOS 8 \u6216 RHEL 8 \u7cfb\u7d71\u3002<\/li>\n<li>\u64c1\u6709 root \u6b0a\u9650\u7684\u7528\u6236\u3002<\/li>\n<li>\u5df2\u5b89\u88dd\u7684 Apache\u3001PHP \u548c GCC\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-1%ef%bc%9a%e5%ae%89%e8%a3%9d%e5%bf%85%e8%a6%81%e7%9a%84%e4%be%9d%e8%b3%b4%e9%a0%85-HJWZxeqHHC\">\u6b65\u9a5f 1\uff1a\u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u9805<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88dd Nagios Core \u6240\u9700\u7684\u4f9d\u8cf4\u9805\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo dnf install -y httpd php gcc glibc glibc-common wget unzip<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e4%b8%8b%e8%bc%89-nagios-core-HJWZxeqHHC\">\u6b65\u9a5f 2\uff1a\u4e0b\u8f09 Nagios Core<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5f9e Nagios \u7684\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 Nagios Core\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>wget https:\/\/github.com\/NagiosEnterprises\/nagioscore\/archive\/refs\/tags\/4.4.6.zip<\/code><\/pre>\n<p>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u89e3\u58d3\u7e2e\u6587\u4ef6\uff1a<\/p>\n<pre><code>unzip 4.4.6.zip<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e7%b7%a8%e8%ad%af%e5%92%8c%e5%ae%89%e8%a3%9d-nagios-core-HJWZxeqHHC\">\u6b65\u9a5f 3\uff1a\u7de8\u8b6f\u548c\u5b89\u88dd Nagios Core<\/h2>\n<p>\u9032\u5165\u89e3\u58d3\u7e2e\u7684\u76ee\u9304\uff0c\u7136\u5f8c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f86\u7de8\u8b6f\u548c\u5b89\u88dd Nagios Core\uff1a<\/p>\n<pre><code>cd nagioscore-4.4.6\n.\/configure --with-command-group=nagios\nmake all\nmake install\nmake install-init\nmake install-config\nmake install-commandmode<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-4%ef%bc%9a%e5%89%b5%e5%bb%ba-nagios-%e7%94%a8%e6%88%b6%e5%92%8c%e7%b5%84-HJWZxeqHHC\">\u6b65\u9a5f 4\uff1a\u5275\u5efa Nagios \u7528\u6236\u548c\u7d44<\/h2>\n<p>\u70ba\u4e86\u5b89\u5168\u8d77\u898b\uff0c\u60a8\u9700\u8981\u5275\u5efa\u4e00\u500b\u540d\u70ba nagios \u7684\u7528\u6236\u548c\u7d44\uff1a<\/p>\n<pre><code>sudo useradd nagios\nsudo usermod -a -G nagios apache<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-5%ef%bc%9a%e5%ae%89%e8%a3%9d-nagios-%e6%8f%92%e4%bb%b6-HJWZxeqHHC\">\u6b65\u9a5f 5\uff1a\u5b89\u88dd Nagios \u63d2\u4ef6<\/h2>\n<p>Nagios \u63d2\u4ef6\u662f\u7528\u4f86\u57f7\u884c\u76e3\u63a7\u4efb\u52d9\u7684\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e0b\u8f09\u548c\u5b89\u88dd\uff1a<\/p>\n<pre><code>wget https:\/\/github.com\/NagiosEnterprises\/nagios-plugins\/archive\/refs\/tags\/2.3.3.zip\nunzip 2.3.3.zip\ncd nagios-plugins-2.3.3\n.\/configure\nmake\nsudo make install<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-6%ef%bc%9a%e9%85%8d%e7%bd%ae-nagios-core-HJWZxeqHHC\">\u6b65\u9a5f 6\uff1a\u914d\u7f6e Nagios Core<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u7de8\u8f2f Nagios \u7684\u914d\u7f6e\u6587\u4ef6\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u958b\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo nano \/usr\/local\/nagios\/etc\/nagios.cfg<\/code><\/pre>\n<p>\u5728\u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8a2d\u7f6e\u76e3\u63a7\u7684\u4e3b\u6a5f\u548c\u670d\u52d9\u3002\u78ba\u4fdd\u60a8\u5df2\u7d93\u6b63\u78ba\u914d\u7f6e\u4e86\u6240\u6709\u9700\u8981\u76e3\u63a7\u7684\u9805\u76ee\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-7%ef%bc%9a%e5%95%9f%e5%8b%95-nagios-%e6%9c%8d%e5%8b%99-HJWZxeqHHC\">\u6b65\u9a5f 7\uff1a\u555f\u52d5 Nagios \u670d\u52d9<\/h2>\n<p>\u5b8c\u6210\u914d\u7f6e\u5f8c\uff0c\u60a8\u53ef\u4ee5\u555f\u52d5 Nagios \u670d\u52d9\uff1a<\/p>\n<pre><code>sudo systemctl start nagios\nsudo systemctl enable nagios<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f-8%ef%bc%9a%e8%a8%aa%e5%95%8f-nagios-web-%e7%95%8c%e9%9d%a2-HJWZxeqHHC\">\u6b65\u9a5f 8\uff1a\u8a2a\u554f Nagios Web \u754c\u9762<\/h2>\n<p>\u6700\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f Nagios \u7684 Web \u754c\u9762\u3002\u6253\u958b\u700f\u89bd\u5668\u4e26\u8f38\u5165\uff1a<\/p>\n<pre><code>http:\/\/your_server_ip\/nagios<\/code><\/pre>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u9ed8\u8a8d\u767b\u9304\u6191\u64da\u767b\u9304\uff1a<\/p>\n<ul>\n<li>\u7528\u6236\u540d\uff1anagiosadmin<\/li>\n<li>\u5bc6\u78bc\uff1a\u60a8\u5728\u914d\u7f6e\u904e\u7a0b\u4e2d\u8a2d\u7f6e\u7684\u5bc6\u78bc<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-HJWZxeqHHC\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u5728 CentOS 8 \u6216 RHEL 8 \u4e0a\u6210\u529f\u5b89\u88dd\u548c\u914d\u7f6e Nagios Core\u3002\u9019\u5c07\u5e6b\u52a9\u60a8\u6709\u6548\u5730\u76e3\u63a7\u60a8\u7684\u4f3a\u670d\u5668\u548c\u61c9\u7528\u7a0b\u5e8f\uff0c\u78ba\u4fdd\u7cfb\u7d71\u7684\u7a69\u5b9a\u904b\u884c\u3002\u5982\u679c\u60a8\u9700\u8981\u9032\u4e00\u6b65\u7684\u652f\u6301\u6216\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 CentOS 8\/RHEL 8 \u4e0a\u5b89\u88dd\u548c\u914d\u7f6e Nagios Core\uff0c\u5be6\u73fe\u9ad8\u6548\u7684\u7cfb\u7d71\u76e3\u63a7\u548c\u7ba1\u7406\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-45258","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=45258"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45258\/revisions"}],"predecessor-version":[{"id":45259,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45258\/revisions\/45259"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}