{"id":43901,"date":"2023-04-27T03:12:59","date_gmt":"2022-11-17T00:52:45","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/"},"modified":"2024-04-30T01:29:54","modified_gmt":"2024-04-29T17:29:54","slug":"%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/","title":{"rendered":"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406"},"content":{"rendered":"<h2>\u592a\u957f\u4e0d\u770b<\/h2>\n<p>\u5728GCE\u4e0a\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u6279\u91cf\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff08Debian\uff09\uff0c\u6211\u60f3\u8981\u4f7f\u7528Nagios\u5b9a\u671f\u6267\u884cPython\u811a\u672c\u5e76\u76d1\u6d4b\u5176\u7ed3\u679c\uff0c\u4ee5\u53ca\u76d1\u63a7\u5b9e\u4f8b\u672c\u8eab\u7684\u72b6\u6001\uff0c\u800c\u4e0d\u9700\u82b1\u8d39\u989d\u5916\u6210\u672c\uff08\u4f5c\u4e3aNagios\u7684\u521d\u5b66\u8005\uff09\u3002<\/p>\n<p>\u7136\u800c\uff0c\u7531\u4e8e\u641c\u7d22\u5f15\u64ce\u7684\u641c\u7d22\u7ed3\u679c\u5e76\u6ca1\u6709\u627e\u5230\u6700\u8fd1\u6709\u5173\u4ece\u5b89\u88c5\u5230\u8fd0\u884c\u7684\u65e5\u8bed\u6587\u7ae0\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u641c\u7d22\u80fd\u529b\u4e0d\u8db3\uff0c\u6240\u4ee5\u6211\u60f3\u505a\u4e00\u4efd\u5907\u5fd8\u5f55\u5c06\u5176\u603b\u7ed3\u8d77\u6765\u3002<\/p>\n<h2>&#8220;\u90a3\u5409\u65af&#8221;\u662f\u4ec0\u4e48?<\/h2>\n<p>\u4e00\u6b3e\u80fd\u591f\u76d1\u63a7 CPU\u3001\u5185\u5b58\u3001\u786c\u76d8\u7b49\u8d44\u6e90\u72b6\u6001\u3001\u8fdb\u7a0b\u548c\u670d\u52a1\u72b6\u6001\uff0c\u8fd8\u80fd\u6839\u636e\u8f93\u51fa\u5230\u65e5\u5fd7\u6587\u4ef6\u7684\u5b57\u7b26\u4e32\u8fdb\u884c\u5224\u65ad\uff0c\u5e76\u68c0\u6d4b\u6545\u969c\u53d1\u751f\/\u89e3\u51b3\uff0c\u5e76\u8fdb\u884c\u6545\u969c\u901a\u77e5\u7684\u76d1\u63a7\u5de5\u5177\u3002<\/p>\n<p>\u6709Nagios XI\uff08\u4ed8\u8d39\u7248\u672c\uff09\u548cNagios Core\uff08\u5f00\u6e90\u7248\u672c\uff09\u4e24\u79cd\u9009\u62e9\u3002<br \/>\n\u6709\u5173\u5dee\u5f02\uff0c\u8bf7\u53c2\u8003\u6b64\u94fe\u63a5\u3002<\/p>\n<p>\u7b80\u800c\u8a00\u4e4b\uff0cNagios Core\u53ef\u4ee5\u63d0\u4f9b\u8d44\u6e90\u76d1\u63a7\u3001\u65e5\u5fd7\u76d1\u63a7\u548c\u6545\u969c\u901a\u77e5\u7b49\u6700\u57fa\u672c\u7684\u529f\u80fd\uff0c\u4f46\u9700\u8981\u53e6\u5916\u5b89\u88c5\u63d2\u4ef6\u624d\u80fd\u8fdb\u884c\u56fe\u5f62\u663e\u793a\u7b49\u53ef\u89c6\u5316\u64cd\u4f5c\u3002\u800cNagios XI\u5219\u96c6\u6210\u4e86\u8fd9\u4e9b\u529f\u80fd\uff0c\u5e76\u4e14\u8fd8\u62e5\u6709\u5176\u4ed6\u7528\u6237\u53cb\u597d\u7684\u529f\u80fd\u3002<\/p>\n<p>\u6211\u8fd9\u6b21\u4e3b\u8981\u60f3\u8981\u505a\u7684\u4e8b\u60c5\u662f\uff0c<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u6bcf\u5929\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u6279\u5904\u7406\u6587\u4ef6\uff0c\u5e76\u5728\u5931\u8d25\u65f6\u901a\u77e5Slack\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>\u5728\u6279\u5904\u7406\u5b9e\u4f8b\u65e0\u6cd5\u8fd0\u884c\u4e4b\u524d\u76d1\u63a7\u5b9e\u4f8b\u5e76\u53ca\u65f6\u901a\u77e5\u3002<\/p>\n<p>\u7531\u4e8e\u53ea\u6709\u8fd9\u4e24\u4e2a\u9009\u9879\uff0c\u4e14\u4e0d\u9700\u8981\u9891\u7e41\u8fdb\u884c\u6dfb\u52a0\u3001\u4fee\u6b63\u6216\u66f4\u6539\uff0c\u56e0\u6b64\u4e5f\u4e0d\u9700\u8981\u8fc7\u4e8e\u5f3a\u5927\u7684\u56fe\u5f62\u7528\u6237\u754c\u9762(GUI)\uff0c\u56e0\u6b64\u6211\u4eec\u4f1a\u5728\u8fd9\u91cc\u4f7f\u7528\u514d\u8d39\u7248\u672c\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<h3>\u88dc\u8db3- \u8865\u5145\u5b8c\u6574<\/h3>\n<p>\u9664\u4e86Zabbix\u548cPrometheus\u4e4b\u5916\uff0cOSS\u76d1\u89c6\u5de5\u5177\u8fd8\u6709\u5176\u4ed6\u7684\u9009\u62e9\u3002\u4f46\u662f\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f1a\u8bb0\u5f55\u4e0b\u4e3a\u4f55\u4e0d\u9009\u62e9\u5b83\u4eec\u3002<br \/>\n\u7b80\u800c\u8a00\u4e4b\uff0c\u4e3b\u8981\u539f\u56e0\u662f\u6211\u4eec\u8fd9\u6b21\u5e0c\u671b\u4fdd\u6301\u7b80\u5355\uff0c\u5e76\u4e14Nagios\u7f3a\u5c11\u4e00\u4e9b\u65b9\u4fbf\u7684\u529f\u80fd\uff08\u8fc7\u5269\u8bbe\u8ba1\uff09\u800c\u8fd9\u4e9b\u529f\u80fd\u5bf9\u6211\u4eec\u6765\u8bf4\u5e76\u4e0d\u5fc5\u8981\u3002<\/p>\n<h4>\u5171\u540c\u7684\u539f\u56e0 de<\/h4>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5728Zabbix\u548cPrometheus\u4e2d\uff0c\u4e3a\u4e86\u76d1\u63a7\u800c\u83b7\u53d6\u7684\u6570\u636e\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u800c\u5728Nagios\u7684\u6807\u51c6\u8bbe\u7f6e\u4e2d\uff0c\u6570\u636e\u53ea\u4f1a\u88ab\u8f93\u51fa\u5230\u6587\u672c\u6587\u4ef6\u4e2d\u3002\u7136\u800c\uff0c\u8fd9\u6b21\u6211\u4eec\u53ea\u60f3\u8981\u786e\u8ba4\u6bcf\u5929\u7684\u6279\u5904\u7406\u6587\u4ef6\u662f\u5426\u6b63\u5e38\u6267\u884c\u4ee5\u53ca\u6267\u884c\u5b9e\u4f8b\u662f\u5426\u6b63\u5e38\u8fd0\u884c\uff0c\u6240\u4ee5\u4e0d\u9700\u8981\u8003\u8651\u65f6\u95f4\u53d8\u52a8\u6216\u957f\u671f\u8d8b\u52bf\uff0c\u4e5f\u4e0d\u9700\u8981\u5728\u6570\u636e\u5e93\u4e0a\u8fdb\u884c\u8c03\u6574\u7b49\u8fd0\u7ef4\u64cd\u4f5c\uff0c\u4e0d\u60f3\u82b1\u8d39\u989d\u5916\u6210\u672c\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>\u5728Nagios\u4e2d\uff0c\u76d1\u63a7\u7684\u8bbe\u7f6e\u662f\u901a\u8fc7\u6587\u672c\u6587\u4ef6\u8fdb\u884c\u8bb0\u5f55\u7684\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528Git\u8fdb\u884c\u7ba1\u7406\uff0c\u5e76\u4e14\u5b66\u4e60\u6210\u672c\u8f83\u4f4e\uff08\u4f46\u9700\u8981\u6709\u4e00\u5b9a\u7684\u641c\u7d22\u80fd\u529b\uff09\u3002<\/p>\n<h4>Zabbix\u72ec\u7279\u4e4b\u5904\u7684\u7406\u7531<\/h4>\n<p>\u5c3d\u7ba1Nagios\u53ef\u4ee5\u5728\u4e00\u6b21\u53d6\u503c\u8fc7\u7a0b\u4e2d\u83b7\u53d6\u591a\u4e2a\u503c\uff0c\u4f46\u662fZabbix\u5728\u4e00\u6b21\u6761\u76ee\u53d6\u503c\u8fc7\u7a0b\u4e2d\u53ea\u80fd\u83b7\u53d6\u4e00\u4e2a\u503c\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5982\u679c\u8981\u5728 Zabbix \u4e2d\u50cf Nagios \u90a3\u6837\u4e00\u6b21\u83b7\u53d6\u591a\u4e2a\u503c\uff0c\u9700\u8981\u4e0e zabbix_sender \u7b49\u7ed3\u5408\u4f7f\u7528\uff0c\u5728\u6bcf\u6b21\u503c\u83b7\u53d6\u5904\u7406\u7684\u673a\u5236\u4e0a\u83b7\u53d6\u591a\u4e2a\u503c\uff0c\u5e76\u51c6\u5907\u4e00\u4e2a\u811a\u672c\u6765\u4f7f\u7528 zabbix_sender \u547d\u4ee4\u5c06\u591a\u4e2a\u503c\u53d1\u9001\u5230 Zabbix \u670d\u52a1\u5668\u4ee5\u8fdb\u884c\u76f8\u5e94\u5904\u7406\u3002<\/p>\n<p>\u56e0\u4e3a\u8fd9\u6b21\u6211\u60f3\u8981\u540c\u65f6\u8fd0\u884c\u591a\u4e2a\u6279\u5904\u7406\u6587\u4ef6\uff08\u53ef\u80fd\u8fd8\u6709\u989d\u5916\u7684\u6f5c\u5728\u9700\u6c42\uff09\uff0c\u6240\u4ee5\u4e3a\u4e86\u5728\u914d\u7f6e\u548c\u7ba1\u7406\u4e0a\u90fd\u9700\u8981\u989d\u5916\u7684Zabbix\u652f\u6301\uff0c\u8fd9\u5c06\u5e26\u6765\u4e00\u5b9a\u7684\u6210\u672c\u3002<\/p>\n<h4>Prometheus\u72ec\u7279\u7684\u539f\u56e0<\/h4>\n<p>Prometheus \u4e0d\u540c\u4e8e Naigos \u548c Zabbix\uff0c\u5176\u4e13\u6ce8\u4e8e\u76d1\u63a7\u4e91\u5bb9\u5668\uff0c\u5e76\u91c7\u7528\u4e0e All in One \u4e0d\u540c\u7684\u601d\u60f3\u8fdb\u884c\u8bbe\u8ba1\u3002\u56e0\u6b64\uff0c\u4e3a\u4e86\u5b9e\u73b0\u901a\u77e5\u7b49\u529f\u80fd\uff0c\u9700\u8981\u4f7f\u7528\u5176\u4ed6\u7ec4\u4ef6\uff0c\u56e0\u6b64\u76f8\u6bd4\u4e8e Nagios\uff0c\u914d\u7f6e\u548c\u7ba1\u7406\u4e0a\u5219\u53d8\u5f97\u66f4\u52a0\u590d\u6742\uff0c\u6210\u672c\u4e5f\u66f4\u9ad8\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d556e37434c4406cd647e\/20-0.png\" alt=\"\u69cb\u6210\u56f3\" \/><\/div>\n<h4>Cron- \u6574\u5408\u4efb\u52a1\u8ba1\u5212\u7684\u5de5\u5177<\/h4>\n<p>\u867d\u7136\u53ef\u4ee5\u7b80\u5355\u5730\u4f7f\u7528Cron\u5b9a\u671f\u6267\u884c\u5e76\u5728\u811a\u672c\u4e2d\u901a\u77e5\u9519\u8bef\uff0c\u4f46\u7531\u4e8e\u76d1\u63a7\u5b9e\u4f8b\u7684\u751f\u6b7b\u72b6\u6001\u6bd4\u8f83\u9ebb\u70e6\uff0c\u6240\u4ee5\u6392\u9664\u4e86\u8fd9\u79cd\u65b9\u6cd5\u3002\uff08\u5728\u672c\u5730\u90e8\u7f72\u4e0d\u540c\uff0c\u4f46\u5728GCE\u4e0a\u8fdb\u884c\u50cf\u8fd9\u6b21\u8fd9\u6837\u7684\u64cd\u4f5c\u65f6\uff0c\u7531\u4e8eStackdriver\u4f1a\u81ea\u52a8\u76d1\u63a7\u5b9e\u4f8b\u7684\u751f\u6b7b\u72b6\u6001\uff0c\u6240\u4ee5\u4f7f\u7528Cron\u4e5f\u662f\u53ef\u4ee5\u7684\uff0c\u9700\u8981\u8003\u8651\u7684\u662f\u5728\u4e00\u4e2a\u914d\u7f6e\u4e2d\u80fd\u591f\u8986\u76d6\u5230\u4ec0\u4e48\u7a0b\u5ea6\u7684\u95ee\u9898\uff09\u3002<\/p>\n<h2>\u5b89\u88c5Nagios\uff08\u7248\u672c4.4.4\uff09<\/h2>\n<p>\u867d\u7136\u524d\u8a00\u4e0d\u642d\u540e\u8bed\uff0c\u4f46\u6211\u4eec\u5c06\u7ee7\u7eed\u8fdb\u884cNagios Core\u7684\u5b89\u88c5\u3002\u6211\u4eec\u5c06\u4ece\u5df2\u7ecf\u5728GCE\u4e0a\u8fd0\u884c\u7684\u5b9e\u4f8b\uff08Debian\uff09\u5f00\u59cb\u64cd\u4f5c\u3002\uff08\u5bf9\u4e8e\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b89\u88c5\u5e2e\u52a9\u63d0\u4f9b\u7684\u53c2\u8003\u4e5f\u9002\u7528\uff09<\/p>\n<p>\uff08\u901a\u8fc7\u4f7f\u7528apt-get install nagios3\u8fdb\u884c\u5b89\u88c5\u7684\u6b65\u9aa4\u6307\u5357\u57282019\/08\/05\u4e0d\u518d\u6709\u6548\u3002\uff09<\/p>\n<h4>\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>apt-get update\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>apt-get <span class=\"nb\">install<\/span> <span class=\"nt\">-y<\/span> autoconf gcc libc6 make wget unzip apache2 apache2-utils php libgd-dev\r\n<\/code><\/pre>\n<h4>\u521b\u5efa\u4e0b\u8f7d\u6587\u4ef6\u5939\u5e76\u4e0b\u8f7d\u6e90\u4ee3\u7801\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">mkdir <\/span>downloads\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cd <\/span>downloads\r\n<span class=\"nv\">$ <\/span>wget <span class=\"nt\">-O<\/span> nagioscore.tar.gz https:\/\/github.com\/NagiosEnterprises\/nagioscore\/archive\/nagios-4.4.4.tar.gz\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">tar <\/span>xzf nagioscore.tar.gz\r\n<\/code><\/pre>\n<h4>\u7f16\u8bd1\u6e90\u4ee3\u7801<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cd <\/span>nagioscore-nagios-4.4.3\r\n<span class=\"nv\">$ <\/span>.\/configure <span class=\"nt\">--with-httpd-conf<\/span><span class=\"o\">=<\/span>\/etc\/apache2\/sites-enabled\r\n<span class=\"nv\">$ <\/span>make all\r\n<\/code><\/pre>\n<h4>\u5c06\u7528\u6237\u548c\u7ec4\u6dfb\u52a0\u5230Nagios\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make install-groups-users\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>usermod <span class=\"nt\">-a<\/span> <span class=\"nt\">-G<\/span> nagios www-data\r\n<\/code><\/pre>\n<h4>\u5b89\u88c5\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make <span class=\"nb\">install<\/span>\r\n<\/code><\/pre>\n<h4>\u5b89\u88c5Nagios\u7684\u670d\u52a1\u548c\u5b88\u62a4\u7a0b\u5e8f\u6587\u4ef6\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make install-daemoninit\r\n<\/code><\/pre>\n<h4>\u5b89\u88c5\u547d\u4ee4\u6a21\u5f0f\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make install-commandmode\r\n<\/code><\/pre>\n<h4>\u5b89\u88c5Nagios\u914d\u7f6e\u6587\u4ef6\u7684\u6837\u672c\u7248\u672c\u3002<\/h4>\n<p>\u7531\u4e8e\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u53ea\u662f\u4e00\u4e2a\u521d\u59cb\u6267\u884c\u7684\u793a\u4f8b\uff0c\u6240\u4ee5\u4e4b\u540e\u9700\u8981\u6839\u636e\u81ea\u5df1\u60f3\u8981\u505a\u7684\u4e8b\u60c5\u8fdb\u884c\u76f8\u5e94\u7684\u66f4\u6539\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make install-config\r\n<\/code><\/pre>\n<h4>\u5b89\u88c5Apache\u914d\u7f6e\u6587\u4ef6\u3002<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make install-webconf\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>a2enmod rewrite\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>a2enmod cgi\r\n<\/code><\/pre>\n<h4>\u9632\u706b\u5899\u8bbe\u7f6e<\/h4>\n<p>\u5728\u8fd9\u4e24\u4e2a\u547d\u4ee4\u4e2d\uff0c\u4f1a\u6709\u4e00\u4e9b\u786e\u8ba4\u9700\u8981\u8f93\u5165\uff0c\u4f46\u57fa\u672c\u4e0a\u9009\u62e9\u201c\u662f\u201d\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>iptables <span class=\"nt\">-I<\/span> INPUT <span class=\"nt\">-p<\/span> tcp <span class=\"nt\">--destination-port<\/span> 80 <span class=\"nt\">-j<\/span> ACCEPT\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>apt-get <span class=\"nb\">install<\/span> <span class=\"nt\">-y<\/span> iptables-persistent\r\n<\/code><\/pre>\n<h4>Nagios \u7ba1\u7406\u7528\u6237\u7684\u521b\u5efa<\/h4>\n<p>\u8bf7\u968f\u610f\u8bbe\u7f6e\u5bc6\u7801\u3002<br \/>\n\u540c\u65f6\uff0c\u5728\u5c06\u6765\u6dfb\u52a0\u7528\u6237\u65f6\uff0c\u9700\u8981\u5220\u9664\u6b64\u547d\u4ee4\u4e2d\u7684 -c\u3002\u5426\u5219\uff0c\u901a\u8fc7\u6b64\u547d\u4ee4\u521b\u5efa\u7684\u7ba1\u7406\u7528\u6237\u5c06\u88ab\u66ff\u6362\u5e76\u6d88\u5931\uff0c\u6240\u4ee5\u8bf7\u52a1\u5fc5\u6ce8\u610f\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>htpasswd <span class=\"nt\">-c<\/span> \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin\r\n<\/code><\/pre>\n<h4>\u963f\u5e15\u5947\u7f51\u7edc\u670d\u52a1\u5668\u7684\u542f\u52a8<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>systemctl restart apache2.service\r\n<\/code><\/pre>\n<h4>Nagios \u670d\u52a1\u548c\u5b88\u62a4\u7a0b\u5e8f\u7684\u542f\u52a8<\/h4>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>systemctl start nagios.service\r\n<\/code><\/pre>\n<p>\u4e00\u65e6\u5230\u8fd9\u91cc\uff0c\u4f60\u53ef\u4ee5\u770b\u5230Nagios\u7684Web\u754c\u9762\u3002\u8bf7\u786e\u4fdd\u901a\u8fc7http:\/\/[\u670d\u52a1\u5668IP]\/nagios\u8fdb\u884c\u8bbf\u95ee\uff0c\u5e76\u786e\u8ba4\u662f\u5426\u6b63\u5e38\u542f\u52a8\u3002\u5982\u679c\u663e\u793a\u4ee5\u4e0b\u8fd9\u6837\u7684\u754c\u9762\uff0c\u5219\u8868\u793a\u6210\u529f\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d556e37434c4406cd647e\/55-0.png\" alt=\"GUI.png\" \/><\/div>\n<p>\u7136\u800c\uff0c\u5728\u8fd9\u91cc\uff0c\u56e0\u4e3a\u5c1a\u672a\u5b89\u88c5Nagios-Plugin\uff0c\u6240\u4ee5\u5728\u5f53\u524d\u72b6\u6001\u4e0b\u663e\u793a\u4e3a&#8221;(No output on stdout) stderr: execvp(\/usr\/local\/nagios\/libexec\/check_load, &#8230;) failed. errno is 2: No such file or directory&#8221;\u8fd9\u4e00\u4e25\u91cd\u9519\u8bef\u3002<\/p>\n<h2>\u5b89\u88c5Nagios-Plugins\uff08\u7248\u672c2.2.1\uff09\u3002<\/h2>\n<p>\u4e3a\u4e86\u89e3\u51b3\u4e0a\u8ff0\u9519\u8bef\uff0c\u6309\u987a\u5e8f\u5b89\u88c5\u6240\u9700\u7684Nagios\u63d2\u4ef6\u3002\u5728\u8fd9\u91cc\uff0c\u5927\u81f4\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5982\u679c\u8fd8\u9700\u8981\u5176\u4ed6\u5fc5\u8981\u7684\u5185\u5bb9\uff0c\u8bf7\u53c2\u8003\u6b64\u94fe\u63a5\u3002<\/p>\n<h3>\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\u3002<\/h3>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>apt-get <span class=\"nb\">install<\/span> <span class=\"nt\">-y<\/span> autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext\r\n<\/code><\/pre>\n<h3>\u4e0b\u8f7d\u6765\u6e90<\/h3>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cd <\/span>downloads\r\n<span class=\"nv\">$ <\/span>wget <span class=\"nt\">--no-check-certificate<\/span> <span class=\"nt\">-O<\/span> nagios-plugins.tar.gz https:\/\/github.com\/nagios-plugins\/nagios-plugins\/archive\/release-2.2.1.tar.gz\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">tar <\/span>zxf nagios-plugins.tar.gz\r\n<\/code><\/pre>\n<h3>\u5c06\u6e90\u4ee3\u7801\u8fdb\u884c\u7f16\u8bd1<\/h3>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cd <\/span>nagios-plugins-release-2.2.1\/\r\n<span class=\"nv\">$ <\/span>.\/tools\/setup\r\n<span class=\"nv\">$ <\/span>.\/configure\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>make <span class=\"nb\">install<\/span>\r\n<\/code><\/pre>\n<p>\u8bf7\u518d\u6b21\u8bbf\u95eehttp:\/\/[\u670d\u52a1\u5668\u5916\u90e8IP]\/nagios\uff0c\u5e76\u70b9\u51fb&#8221;Current Status&#8221;\u4e0b\u7684&#8221;Hosts or Services&#8221;\uff0c\u7136\u540e\u70b9\u51fb&#8221;localhost&#8221;\u3002<br \/>\n\u7136\u540e\uff0c\u70b9\u51fb&#8221;Host Commands&#8221;\u4e0b\u7684&#8221;Re-schedule the next check of this host&#8221;\u547d\u4ee4\uff0c\u6267\u884c\u6b64\u547d\u4ee4\u540e\uff0c\u5c06\u4f1a\u66f4\u65b0\u5230\u6700\u65b0\u72b6\u6001\u3002<\/p>\n<p>\u7ec8\u4e8e\u53ef\u4ee5\u4f7f\u7528Nagios\u4e86\u3002<\/p>\n<h2>\u5b9a\u671f\u8fd0\u884c\u548c\u76d1\u63a7\u6279\u5904\u7406\u6587\u4ef6\u3002<\/h2>\n<p>\u4ece\u8fd9\u91cc\u5f00\u59cb\uff0c\u6309\u987a\u5e8f\u8bbe\u7f6e\u60f3\u8981\u505a\u7684\u4e8b\u60c5\u3002\u9996\u5148\u662f1\u7684\u5b9a\u671f\u6267\u884c\u548c\u76d1\u89c6\u3002<br \/>\n\u901a\u8fc7\u5728Nagios\u4e2d\u5199\u5165\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\u7684\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u5b9a\u671f\u6267\u884c\u6307\u5b9a\u7684\u6587\u4ef6\uff0c\u5e76\u63a5\u6536\u5176\u6807\u51c6\u8f93\u51fa\uff0c\u5e76\u6839\u636e\u6b64\u53d1\u51fa\u8b66\u62a5\u3002<\/p>\n<p>\u9996\u5148\uff0c\u5c06\u6b64\u6b21\u4f7f\u7528\u7684\u6279\u5904\u7406\u6587\u4ef6(hello.py)\u653e\u7f6e\uff08\u590d\u5236\uff09\u5230 \/usr\/local\/nagios\/libexec\/ \u76ee\u5f55\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo cp <\/span>hello.py \/usr\/local\/nagios\/libexec\/hello.py\r\n<\/code><\/pre>\n<p>\u68c0\u67e5\u5df2\u914d\u7f6e\u6587\u4ef6\u7684\u6743\u9650\uff0c\u6839\u636e\u5176\u72b6\u6001\u6388\u4e88\u6743\u9650\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo chmod <\/span>755 \/usr\/local\/nagios\/libexec\/hello.py\r\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728 \/usr\/local\/nagios\/etc\/objects\/commands.cfg \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u6240\u9700\u6267\u884c\u7684\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>define command {\r\n    command_name    hello\r\n    command_line    $USER1$\/hello.py\r\n}\r\n<\/code><\/pre>\n<p>\u7136\u540e\uff0c\u5728\/usr\/local\/nagios\/etc\/objects\/templates.cfg\u6587\u4ef6\u4e2d\u6dfb\u52a0\u76f8\u5e94\u7684\u6267\u884c\u8bbe\u7f6e\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<pre class=\"post-pre\"><code>define service {\r\n\r\n    name                            batch-service           ; The 'name' of this service template\r\n    active_checks_enabled           1                       ; Active service checks are enabled\r\n    passive_checks_enabled          1                       ; Passive service checks are enabled\/accepted\r\n    parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)\r\n    obsess_over_service             1                       ; We should obsess over this service (if necessary)\r\n    check_freshness                 0                       ; Default is to NOT check service 'freshness'\r\n    notifications_enabled           1                       ; Service notifications are enabled\r\n    event_handler_enabled           1                       ; Service event handler is enabled\r\n    flap_detection_enabled          1                       ; Flap detection is enabled\r\n    process_perf_data               1                       ; Process performance data\r\n    retain_status_information       1                       ; Retain status information across program restarts\r\n    retain_nonstatus_information    1                       ; Retain non-status information across program restarts\r\n    is_volatile                     0                       ; The service is not volatile\r\n    check_period                    batch_time              ; The service can be checked at 9:00(JST) of the day\r\n    max_check_attempts              1                       ; Re-check the service up to 1 times in order to determine its final (hard) state\r\n    check_interval                  60                      ; Check the service every 60 minutes under normal conditions\r\n    retry_interval                  45                      ; Re-check the service every 45 minutes until a hard state can be determined\r\n    contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group\r\n    notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events\r\n    notification_interval           60                      ; Re-notify about service problems every hour\r\n    notification_period             24x7                    ; Notifications can be sent out at any time\r\n    register                        0                       ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!\r\n}\r\n<\/code><\/pre>\n<p>\u4e3a\u4e86\u66f4\u52a0\u6e05\u6670\u660e\u4e86\uff0c\u672c\u6b21\u4e3a\u4e86\u65b9\u4fbf\u7406\u89e3\u5168\u90e8\u8fdb\u884c\u4e86\u63cf\u8ff0\u3002\u7136\u800c\uff0c\u82e5\u4e0e\u73b0\u6709\u8bbe\u7f6e\u6709\u5f88\u591a\u91cd\u590d\u65f6\uff0c\u4e5f\u53ef\u4ee5\u7701\u7565\u5982\u4e0b\uff0c\u5e76\u53ea\u63cf\u8ff0\u53d8\u66f4\u90e8\u5206\u3002<\/p>\n<pre class=\"post-pre\"><code>define service {\r\n\r\n    name                            batch-service           ; The name of this service template\r\n    use                             generic-service         ; Inherit default values from the generic-service definition\r\n    check_period                    batch_time              ; The service can be checked at 9:00(JST) of the day\r\n    max_check_attempts              1                       ; Re-check the service up to 1 times in order to determine its final (hard) state\r\n    check_interval                  60                      ; Check the service every 60 minutes under normal conditions\r\n    retry_interval                  45                      ; Re-check the service every 45 minutes until a hard state can be determined\r\n}\r\n<\/code><\/pre>\n<p>\u5728 \/usr\/local\/nagios\/etc\/objects\/timeperiods.cfg \u4e2d\uff0c\u6211\u5c06 check_period \u8bbe\u7f6e\u4e3a batch_time\uff08\u6bcf\u65e59:00-9:30\u4ee5\u65e5\u672c\u65f6\u95f4\u6267\u884c\uff09\uff0c\u4e00\u65e6\u68c0\u6d4b\u5230\u9519\u8bef\uff0c\u5c06\u53ea\u6267\u884c\u4e00\u6b21\uff0c\u4e14\u4e00\u5929\u53ea\u6267\u884c\u4e00\u6b21\u3002\u540c\u65f6\uff0c\u6211\u5c06\u68c0\u6d4b\u95f4\u9694\uff08check_interval\uff09\u8bbe\u7f6e\u4e3a\u8d85\u8fc7\u8bbe\u5b9a\u65f6\u95f4\u95f4\u9694\u768460\u5206\u949f\uff0c\u5e76\u5c06\u91cd\u8bd5\u95f4\u9694\uff08retry_interval\uff09\u8bbe\u7f6e\u4e3a45\u5206\u949f\u3002<\/p>\n<pre class=\"post-pre\"><code># run batch file everyday once\r\n\r\ndefine timeperiod {\r\n\r\n    name                    batch_time\r\n    timeperiod_name         batch_time\r\n    alias                   run batch at 9:00(JST) everyday\r\n\r\n    sunday                  00:00-00:30\r\n    monday                  00:00-00:30\r\n    tuesday                 00:00-00:30\r\n    wednesday               00:00-00:30\r\n    thursday                00:00-00:30\r\n    friday                  00:00-00:30\r\n    saturday                00:00-00:30\r\n    sunday                  00:00-00:30\r\n}\r\n<\/code><\/pre>\n<p>\u5e76\u4e14\uff0c\u5229\u7528\u4e0a\u8ff0\u5b9a\u4e49\u7684\u670d\u52a1\u6a21\u677f\uff0c\u5728\/usr\/local\/nagios\/etc\/objects\/localhost.cfg\u4e2d\u5b9a\u4e49\u8981\u6267\u884c\u7684\u547d\u4ee4(\u670d\u52a1)\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code># Define a service to run batch file on the local machine.\r\n\r\ndefine service {\r\n    use                     batch-service ; Name of service template to use\r\n    host_name               localhost\r\n    service_description     run the hello\r\n    check_command           hello\r\n}\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u70b9\u4e0a\uff0c\u6267\u884c\u73af\u5883\u7684\u8bbe\u7f6e\u5df2\u7ecf\u5b8c\u6210\u3002\u90a3\u4e48\uff0c\u8ba9\u6211\u4eec\u9a8c\u8bc1\u4e00\u4e0b\u914d\u7f6e\u6587\u4ef6\u662f\u5426\u6709\u9519\u8bef\uff08\u5982\u679c\u6709\u672a\u5b9a\u4e49\u7b49\u9519\u8bef\uff0c\u53ef\u4ee5\u5728\u8fd9\u91cc\u68c0\u6d4b\u5230\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo<\/span> \/usr\/local\/nagios\/bin\/nagios <span class=\"nt\">-v<\/span> \/usr\/local\/nagios\/etc\/nagios.cfg\r\n\r\nNagios Core 4.4.4\r\nCopyright <span class=\"o\">(<\/span>c<span class=\"o\">)<\/span> 2009-present Nagios Core Development Team and Community Contributors\r\nCopyright <span class=\"o\">(<\/span>c<span class=\"o\">)<\/span> 1999-2009 Ethan Galstad\r\nLast Modified: 2019-07-29\r\nLicense: GPL\r\n\r\nWebsite: https:\/\/www.nagios.org\r\nReading configuration data...\r\n   Read main config file okay...\r\n   Read object config files okay...\r\n\r\nRunning pre-flight check on configuration data...\r\n\r\nChecking objects...\r\n    Checked 9 services.\r\n    Checked 1 hosts.\r\n    Checked 1 host groups.\r\n    Checked 0 service groups.\r\n    Checked 1 contacts.\r\n    Checked 1 contact groups.\r\n    Checked 25 commands.\r\n    Checked 6 <span class=\"nb\">time <\/span>periods.\r\n    Checked 0 host escalations.\r\n    Checked 0 service escalations.\r\nChecking <span class=\"k\">for <\/span>circular paths...\r\n    Checked 1 hosts\r\n    Checked 0 service dependencies\r\n    Checked 0 host dependencies\r\n    Checked 6 timeperiods\r\nChecking global event handlers...\r\nChecking obsessive compulsive processor commands...\r\nChecking misc settings...\r\n\r\nTotal Warnings: 0\r\nTotal Errors:   0\r\n\r\nThings look okay - No serious problems were detected during the pre-flight check\r\n<\/code><\/pre>\n<p>\u786e\u8ba4\u6ca1\u6709\u95ee\u9898\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u4ee5\u5e94\u7528\u8bbe\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>systemctl restart nagios.service\r\n<\/code><\/pre>\n<p>\u603b\u7ed3\u8d77\u6765\uff0c\u53ea\u9700\u8981\u66f4\u65b04\u4e2a\u6587\u4ef6\u5e76\u91cd\u65b0\u542f\u52a8Nagios\u5373\u53ef\uff01\u5f88\u7b80\u5355\uff01\uff08\u867d\u7136\u82b1\u4e86\u4e00\u4e9b\u65f6\u95f4\u624d\u627e\u5230\u6b63\u786e\u7684\u65b9\u6cd5\uff09<\/p>\n<h3>\u586b\u88dc\u7f3a\u53e3<\/h3>\n<p>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0c\u5728\u4f7f\u7528Linux\u7cfb\u5217\u64cd\u4f5c\u7cfb\u7edf\u6267\u884cPython\u811a\u672c\u65f6\uff0c\u9700\u8981\u5728\u6587\u4ef6\u5f00\u5934\u52a0\u4e0a\u7c7b\u4f3c\u4e8e #!\/usr\/bin\/env python3 \u8fd9\u6837\u7684shebang\uff0c\u8981\u6ce8\u610f\u4e00\u4e0b\uff08\u6211\u9047\u5230\u4e86\u8fd9\u4e2a\u95ee\u9898\uff09\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u5904\u7406\u9700\u8981\u8d85\u8fc71\u5206\u949f\uff0c\u5219\u9700\u8981\u6ce8\u610f\u4fee\u6539\/usr\/local\/nagios\/etc\/nagios.cfg\u4e2d\u7684service_check_timeout\u3002\u8fd9\u4e2aservice_check_timeout\u7684\u9ed8\u8ba4\u503c\u662f60\u79d2\uff0c\u6240\u4ee5\u6839\u636e\u6279\u5904\u7406\u7684\u6267\u884c\u65f6\u95f4\u8fdb\u884c\u76f8\u5e94\u7684\u4fee\u6539\u3002<\/p>\n<pre class=\"post-pre\"><code># TIMEOUT VALUES\r\n# These options control how much time Nagios will allow various\r\n# types of commands to execute before killing them off.  Options\r\n# are available for controlling maximum time allotted for\r\n# service checks, host checks, event handlers, notifications, the\r\n# ocsp command, and performance data commands.  All values are in\r\n# seconds.\r\n\r\nservice_check_timeout=600\r\nhost_check_timeout=30\r\nevent_handler_timeout=30\r\nnotification_timeout=300\r\nocsp_timeout=5\r\nochp_timeout=5\r\nperfdata_timeout=5\r\n<\/code><\/pre>\n<p>\u5728\u66f4\u6539\u5b8c\u8fd9\u4e2a\u5730\u65b9\u540e\uff0c\u522b\u5fd8\u4e86\u4f7f\u7528 $ sudo systemctl restart nagios.service \u6765\u91cd\u65b0\u542f\u52a8\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5728\u8f93\u51fa\u9519\u8bef\u65f6\uff0c\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u4e8b\u9879\u3002<br \/>\n\u9996\u5148\uff0c\u5c06\u7a0b\u5e8f\u7684\u9000\u51fa\u72b6\u6001\u8bbe\u7f6e\u4e3a Nagios \u63d2\u4ef6\u5316\u7684\u65b9\u5f0f\u3002Nagios \u76d1\u63a7\u6709\u56db\u79cd\u72b6\u6001\uff1aOK\u3001WARNING\u3001CRITICAL\u3001UNKNOWN\uff0c\u5b83\u4eec\u5206\u522b\u5bf9\u5e94 Nagios \u63d2\u4ef6\u7684\u9000\u51fa\u72b6\u6001\uff0c\u53730\u30011\u30012\u30013\u3002<br \/>\n\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u5c06 Python \u811a\u672c\u7684\u9000\u51fa\u72b6\u6001\u4e0e\u4e4b\u5bf9\u5e94\u3002<\/p>\n<div>\n<div class=\"post-table\">\u30b9\u30c6\u30fc\u30bf\u30b9\u306e\u30e9\u30d9\u30ebEXIT STATUS \u306e\u5024OK0WARNING1CRITICAL2UNKNOWN3<\/div>\n<\/div>\n<p>\u63a5\u4e0b\u6765\uff0c\u5e94\u5c06\u9519\u8bef\u6d88\u606f\u5199\u5165\u6807\u51c6\u8f93\u51fa\u3002<br \/>\n\u5728 Nagios \u7684 WebUI \u670d\u52a1\u5217\u8868\u4e2d\uff0c\u7c7b\u4f3c\u4e8e Services \u7684\u76d1\u63a7\u9879\u76ee\u603b\u7ed3\uff0c\u72b6\u6001\u4fe1\u606f\u4f1a\u663e\u793a\u5728&#8221;Status Information&#8221;\u5904\uff0c\u8fd9\u91cc\u4f1a\u663e\u793a Nagios \u63d2\u4ef6\u5199\u5165\u6807\u51c6\u8f93\u51fa\u7684\u7b2c\u4e00\u884c\u3002\u7136\u540e\uff0c\u6253\u5f00\u8be5\u76d1\u63a7\u9879\u76ee\u7684\u8be6\u7ec6\u4fe1\u606f\u540e\uff0c\u4f1a\u663e\u793a\u7b2c\u4e8c\u884c\u53ca\u4e4b\u540e\u7684\u5185\u5bb9\u3002<br \/>\n\u56e0\u6b64\uff0c\u4e3a\u4e86\u4f20\u8fbe\u4e0e\u76d1\u63a7\u7ed3\u679c\u72b6\u6001\u76f8\u7ed3\u5408\u7684\u4fe1\u606f\uff0c\u9996\u5148\u5728\u7b2c\u4e00\u884c\u5199\u5165\u91cd\u8981\u4e8b\u9879\uff0c\u7136\u540e\u5728\u7b2c\u4e8c\u884c\u53ca\u4e4b\u540e\u5199\u5165\u66f4\u8be6\u7ec6\u7684\u5185\u5bb9\u3002<\/p>\n<h2>1.2 \u5c06Nagios\u7684\u8b66\u62a5\u901a\u77e5\u53d1\u9001\u5230Slack\u4e0a<\/h2>\n<p>\u8fd9\u5f88\u7b80\u5355\u3002\u56e0\u4e3a Slack \u6709\u5b98\u65b9\u7684 Nagios Integration\uff0c\u53ea\u9700\u4f7f\u7528\u5b83\u5373\u53ef\u3002\uff08\u8bf7\u6ce8\u610f\uff0c\u7531\u4e8e\u64cd\u4f5c\u624b\u518c\u8fc7\u65f6\uff0c\u67d0\u4e9b\u90e8\u5206\u53ef\u80fd\u65e0\u6cd5\u4f7f\u7528\u3002\uff09<\/p>\n<p>\u9996\u5148\uff0c\u8fdb\u5165Slack\u7684\u7ba1\u7406\u754c\u9762\u3002\u5728\u70b9\u51fb\u6dfb\u52a0\u5e94\u7528\u6309\u94ae\u4e4b\u540e\uff0c\u4ece\u641c\u7d22\u4e2d\u627e\u5230Nagios\u5e76\u6dfb\u52a0\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d556e37434c4406cd647e\/99-0.png\" alt=\"slack_kanri.png\" \/><\/div>\n<p>\u5f53\u60a8\u8fdb\u884c\u8ffd\u52a0\u65f6\uff0c\u4f1a\u663e\u793a\u8bbe\u7f6e\u6b65\u9aa4\uff0c\u8bf7\u6309\u7167\u8fd9\u4e9b\u6b65\u9aa4\u4e00\u4e00\u8fdb\u884c\u3002(\u7531\u4e8e\u6587\u4ef6\u7ed3\u6784\u4e0d\u540c\uff0c\u5982\u679c\u4e0d\u6309\u7167\u8fd9\u4e9b\u6b65\u9aa4\u8fdb\u884c\uff0c\u65e0\u6cd5\u6210\u529f\u8fdb\u884c)<\/p>\n<p>\u9996\u5148\uff0c\u5b89\u88c5Slack\u7684Nagios\u63d2\u4ef6\uff0c\u5e76\u5c06\u5176\u79fb\u81f3\u6267\u884c\u73af\u5883\uff0c\u7136\u540e\u66f4\u6539\u6743\u9650\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cd <\/span>downloads\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>apt-get <span class=\"nb\">install <\/span>libwww-perl libcrypt-ssleay-perl\r\n<span class=\"nv\">$ <\/span>wget https:\/\/raw.github.com\/tinyspeck\/services-examples\/master\/nagios.pl\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cp <\/span>nagios.pl \/usr\/local\/nagios\/libexec\/slack_nagios.pl\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">chmod <\/span>755 \/usr\/local\/nagios\/libexec\/slack_nagios.pl\r\n<\/code><\/pre>\n<p>\u8bf7\u7f16\u8f91\/usr\/local\/nagios\/libexec\/slack_nagios.pl\uff0c\u6839\u636e\u901a\u77e5\u76ee\u6807\u7684 Slack \u8bbe\u7f6e\\$opt_domain\u548c\\$opt_token\u53d8\u91cf\u3002<\/p>\n<pre class=\"post-pre\"><code>$opt_domain = \"YourDomain.slack.com\"; # \u30c1\u30fc\u30e0\u30c9\u30e1\u30a4\u30f3\r\n$opt_token = \"NagiosServiceToken\"; # Nagios \u30b5\u30fc\u30d3\u30b9\u30da\u30fc\u30b8\u306e\u30c8\u30fc\u30af\u30f3\r\n<\/code><\/pre>\n<p>\u53d1\u5e03\u4e00\u7bc7\u6d4b\u8bd5\u6587\u7ae0\uff0c\u786e\u8ba4\u662f\u5426\u80fd\u901a\u8fc7\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>\/usr\/local\/nagios\/libexec\/slack_nagios.pl <span class=\"nt\">-field<\/span> <span class=\"nv\">slack_channel<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"#nagios\"<\/span> <span class=\"nt\">-field<\/span> <span class=\"nv\">HOSTALIAS<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"HOSTNAME\"<\/span> <span class=\"nt\">-field<\/span> <span class=\"nv\">SERVICEDESC<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"SERVICEDESC\"<\/span> <span class=\"nt\">-field<\/span> <span class=\"nv\">SERVICESTATE<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"SERVICESTATE\"<\/span> <span class=\"nt\">-field<\/span> <span class=\"nv\">SERVICEOUTPUT<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"SERVICEOUTPUT\"<\/span> <span class=\"nt\">-field<\/span> <span class=\"nv\">NOTIFICATIONTYPE<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"NOTIFICATIONTYPE\"<\/span>\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d556e37434c4406cd647e\/107-0.png\" alt=\"\u901a\u77e5\u7d50\u679c.png\" \/><\/div>\n<p>\u5982\u679c\u662f\u8fd9\u79cd\u611f\u89c9\u51fa\u73b0\u7684\u8bdd\uff0c\u6682\u65f6\u53ef\u4ee5\u8ba4\u53ef\uff01<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5728Nagios\u7684\u6bcf\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0Slack\u7684\u8bbe\u7f6e\u3002\u9996\u5148\uff0c\u5728\u901a\u77e5\u63a5\u6536\u8005\u7684\u914d\u7f6e\u6587\u4ef6usr\/local\/nagios\/etc\/objects\/contacts.cfg\u4e2d\u6dfb\u52a0Slack\u7684\u8bbe\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code>define contact {\r\n      contact_name                             slack\r\n      alias                                    Slack\r\n      service_notification_period              24x7\r\n      host_notification_period                 24x7\r\n      service_notification_options             w,u,c,r\r\n      host_notification_options                d,r\r\n      service_notification_commands            notify-service-by-slack\r\n      host_notification_commands               notify-host-by-slack\r\n}\r\n\r\ndefine contactgroup {\r\n  contactgroup_name admins\r\n  alias             Nagios Administrators\r\n  members           nagiosadmin, slack\r\n}\r\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728\u547d\u4ee4\u8bbe\u7f6e\u6587\u4ef6\/usr\/local\/nagios\/etc\/objects\/commands.cfg\u4e2d\u6dfb\u52a0\u901a\u77e5\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>define command { \r\n    command_name        notify-service-by-slack \r\n    command_line        \/usr\/local\/bin\/slack_nagios.pl -field slack_channel=\"#nagios\" -field HOSTALIAS=\"$HOSTNAME$\" -field SERVICEDESC=\"$SERVICEDESC$\" -field SERVICESTATE=\"$SERVICESTATE$\" -field SERVICEOUTPUT=\"$SERVICEOUTPUT$\" -field NOTIFICATIONTYPE=\"$NOTIFICATIONTYPE$\"\r\n}\r\n\r\ndefine command { \r\n    command_name        notify-host-by-slack \r\n    command_line        \/usr\/local\/bin\/slack_nagios.pl -field slack_channel=\"#nagios\" -field HOSTALIAS=\"$HOSTNAME$\" -field HOSTSTATE=\"$HOSTSTATE$\" -field HOSTOUTPUT=\"$HOSTOUTPUT$\" -field NOTIFICATIONTYPE=\"$NOTIFICATIONTYPE$\"\r\n}\r\n<\/code><\/pre>\n<p>\u6211\u4f1a\u9a8c\u8bc1\u8bbe\u7f6e\u662f\u5426\u6709\u9519\u8bef\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo<\/span> \/usr\/local\/nagios\/bin\/nagios <span class=\"nt\">-v<\/span> \/usr\/local\/nagios\/etc\/nagios.cfg\r\n<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u95ee\u9898\uff0c\u91cd\u65b0\u542f\u52a8Nagios\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>systemctl restart nagios.service\r\n<\/code><\/pre>\n<p>\u8ba9\u6211\u4eec\u5b9e\u9645\u64cd\u4f5c\u4e00\u4e0b\uff0c\u5c1d\u8bd5\u53d1\u9001\u8b66\u62a5\u3002\u6839\u636e\u901a\u77e5\u7c7b\u578b\uff0c\u5b83\u4f1a\u5728Slack\u4e0a\u4ee5\u4e0d\u540c\u989c\u8272\u8fdb\u884c\u901a\u77e5\u3002<\/p>\n<p>\u5173\u4e8e2\uff0c\u7531\u4e8e\u76ee\u524d\u7684\u8bbe\u7f6e\u57fa\u672c\u5b8c\u6210\uff0c\u5c31\u6682\u65f6\u7ed3\u675f\u5427\uff01\uff08\u597d\u7d2f\u554a\u3002\u3002\u3002\u3002\uff09<\/p>\n<p>\u7531\u4e8e\u6211\u8fd8\u662f\u4e2a\u65b0\u624b\uff0c\u5728\u63a2\u7d22\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u51fa\u73b0\u9519\u8bef\u6216\u8005\u524d\u7f6e\u6761\u4ef6\u4e0d\u51c6\u786e\u7684\u60c5\u51b5\uff0c\u8bf7\u63d0\u4f9b\u610f\u89c1\u548c\u8bc4\u8bbam(_ _)m<\/p>\n<h2>\u8bf7\u5728\u4e0b\u5217\u9009\u9879\u4e2d\u9009\u62e9\u4e00\u4e2a\u9002\u5408\u7684\u7b54\u6848<\/h2>\n<p>Nagios Core \u5b98\u65b9\u7248\u672c<\/p>\n<p>\u8bf7\u63d0\u4f9b\u6709\u5173Nagios Core\/Plugin\u5b89\u88c5\u7684\u5e2e\u52a9\u3002<\/p>\n<p>Nagios\u7684\u6bcf\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u53d8\u91cf\u540d\u89e3\u91ca\u3002<\/p>\n<p>Nagios\u7684\u65f6\u95f4\u5b9a\u4e49<\/p>\n<p>\u5728Nagios\u4e2d\u5982\u4f55\u89e3\u51b3\u670d\u52a1\u68c0\u67e5\u8d85\u65f6\u95ee\u9898\u3002<\/p>\n<p>Nagios \u548c Slack \u7684\u6574\u5408<\/p>\n<p>\u4e0eZabbix\u8fdb\u884c\u5bf9\u6bd4<\/p>\n<p>Zabbix\u548cPrometheus\u7684\u5bf9\u6bd4<\/p>\n<h2>\u6dfb\u52a0\u9644\u6ce8<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5f37\u5236\u4fdd\u5b58\uff1a:w !sudo tee %(\u3088\u304f\u306a\u3044\u3051\u3069\u610f\u5916\u3068\u4f7f\u3063\u305f)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u4f4d\u7f6e\uff1a\/usr\/local\/nagios\/var\/nagios.log<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">(\/usr\/local\/nagios\/etc\/nagios.cfg\u3067\u5909\u66f4\u53ef\u80fd)<\/ul>\n<\/li>\n<\/ul>\n<p>version:<\/p>\n<p>Latest stable release 2019-07-29 Nagios Core(ver.4.4.4)<br \/>\nNagios-Plugin 2.2.1 \u304c\u6700\u65b0\u7248(2019-08-05\u6642\u70b9)<\/p>\n<p>\u672c\u8aad\u3093\u3060\u307b\u3046\u304c\u3044\u3044\u306e\u304b\u306a\u3041\u3002\u3067\u3082\u672c\u306f\u591a\u5206\u30d0\u30fc\u30b8\u30e7\u30f33\u3002\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u592a\u957f\u4e0d\u770b \u5728GCE\u4e0a\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u6279\u91cf\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff08Debian\uff09\uff0c\u6211\u60f3\u8981\u4f7f\u7528Nagios\u5b9a\u671f\u6267\u884cPython\u811a\u672c [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-43901","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406\" \/>\n<meta property=\"og:description\" content=\"\u592a\u957f\u4e0d\u770b \u5728GCE\u4e0a\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u6279\u91cf\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff08Debian\uff09\uff0c\u6211\u60f3\u8981\u4f7f\u7528Nagios\u5b9a\u671f\u6267\u884cPython\u811a\u672c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-17T00:52:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T17:29:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d556e37434c4406cd647e\/20-0.png\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/\",\"name\":\"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-11-17T00:52:45+00:00\",\"dateModified\":\"2024-04-29T17:29:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406","og_description":"\u592a\u957f\u4e0d\u770b \u5728GCE\u4e0a\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u6279\u91cf\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff08Debian\uff09\uff0c\u6211\u60f3\u8981\u4f7f\u7528Nagios\u5b9a\u671f\u6267\u884cPython\u811a\u672c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-11-17T00:52:45+00:00","article_modified_time":"2024-04-29T17:29:54+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d556e37434c4406cd647e\/20-0.png"}],"author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/","name":"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-11-17T00:52:45+00:00","dateModified":"2024-04-29T17:29:54+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728Nagios\u4e2d\u76d1\u63a7\u6279\u5904\u7406\u5904\u7406"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nagios%e4%b8%ad%e7%9b%91%e6%8e%a7%e6%89%b9%e5%a4%84%e7%90%86%e5%a4%84%e7%90%86\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/43901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=43901"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/43901\/revisions"}],"predecessor-version":[{"id":88859,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/43901\/revisions\/88859"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=43901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=43901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=43901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}