{"id":19585,"date":"2017-06-06T06:05:14","date_gmt":"2017-06-05T22:05:14","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/06\/06\/%e5%9c%a8-centos-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-nagios-4-x-nginx\/"},"modified":"2021-03-18T17:25:03","modified_gmt":"2021-03-18T09:25:03","slug":"%e5%9c%a8-centos-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-nagios-4-x-nginx","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/06\/06\/%e5%9c%a8-centos-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-nagios-4-x-nginx\/","title":{"rendered":"\u5728 CentOS 7.x \u4e0a\u5b89\u88dd Nagios 4.x &#8211; Nginx"},"content":{"rendered":"<p>\u53c3\u8003\u7db2\u9801\uff1a <br \/><a href=\"http:\/\/linux.onlinedoc.tw\/2017\/01\/centos7rhel7-nginx-perl-cgi.html\" target=\"_blank\" rel=\"noopener noreferrer\">Linux \uff0e \u7121\u9650: \u5728 CentOS7\/RHEL7\u4e0a\uff0c\u70ba Nginx \u52a0\u4e0a Perl CGI \u6a21\u7d44<\/a> <\/p>\n<p>1. \u5b89\u88dd\u6240\u9700\u5957\u4ef6 <br \/># <span style=\"color: #ff0000\">yum install nagios nagios-plugins-all<\/span> <\/p>\n<p>2. \u8a2d\u5b9a\u958b\u6a5f\u6642\u555f\u52d5\u670d\u52d9 <br \/># <span style=\"color: #ff0000\">systemctl disable httpd.service<\/span> <br \/>#<span style=\"color: #ff0000\"> systemctl enable nagios.service<\/span> <br \/><span style=\"color: #0000ff\">Created symlink from \/etc\/systemd\/system\/multi-user.target.wants\/nagios.service to \/usr\/lib\/systemd\/system\/nagios.service.<\/span> <br \/># <span style=\"color: #ff0000\">systemctl stop httpd.service<\/span> <br \/># <span style=\"color: #ff0000\">systemctl start nagios.service<\/span> <\/p>\n<p>3. \u8a2d\u5b9a\u767b\u5165\u5e33\u865f\u53ca\u5bc6\u78bc <br \/># <span style=\"color: #ff0000\">\/usr\/bin\/htpasswd -c \/etc\/nagios\/passwd nagiosadmin<\/span> <br \/><span style=\"color: #0000ff\">New password:<\/span> <br \/><span style=\"color: #0000ff\">Re-type new password:<\/span> <br \/><span style=\"color: #0000ff\">Adding password for user nagiosadmin[@more@]<\/span><br \/>4. \u6aa2\u67e5\u8a2d\u5b9a\u662f\u5426\u6b63\u78ba <br \/># <span style=\"color: #ff0000\">\/usr\/sbin\/nagios -v \/etc\/nagios\/nagios.cfg<\/span> <br \/><span style=\"color: #0000ff\">Nagios Core 4.2.4<\/span> <br \/><span style=\"color: #0000ff\">Copyright (c) 2009-present Nagios Core Development Team and Community Contributors<\/span> <br \/><span style=\"color: #0000ff\">Copyright (c) 1999-2009 Ethan Galstad<\/span> <br \/><span style=\"color: #0000ff\">Last Modified: 12-07-2016<\/span> <br \/><span style=\"color: #0000ff\">License: GPL<\/span> <\/p>\n<p><span style=\"color: #0000ff\">Website: https:\/\/www.nagios.org<\/span> <br \/><span style=\"color: #0000ff\">Reading configuration data&#8230;<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0 Read main config file okay&#8230;<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0 Read object config files okay&#8230;<\/span> <\/p>\n<p><span style=\"color: #0000ff\">Running pre-flight check on configuration data&#8230;<\/span> <\/p>\n<p><span style=\"color: #0000ff\">Checking objects&#8230;<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 8 services.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 1 hosts.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 1 host groups.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 0 service groups.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 1 contacts.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 1 contact groups.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 24 commands.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 5 time periods.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 0 host escalations.<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 0 service escalations.<\/span> <br \/><span style=\"color: #0000ff\">Checking for circular paths&#8230;<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 1 hosts<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 0 service dependencies<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 0 host dependencies<\/span> <br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Checked 5 timeperiods<\/span> <br \/><span style=\"color: #0000ff\">Checking global event handlers&#8230;<\/span> <br \/><span style=\"color: #0000ff\">Checking obsessive compulsive processor commands&#8230;<\/span> <br \/><span style=\"color: #0000ff\">Checking misc settings&#8230;<\/span> <\/p>\n<p><span style=\"color: #0000ff\">Total Warnings: 0<\/span> <br \/><span style=\"color: #0000ff\">Total Errors:\u00a0\u00a0 0<\/span> <\/p>\n<p><span style=\"color: #0000ff\">Things look okay &#8211; No serious problems were detected during the pre-flight check<\/span> <\/p>\n<p>5. \u4e0b\u8f09\u5957\u4ef6\u5eab\u8a2d\u5b9a\u6a94<br \/># <span style=\"color: #ff0000\">wget https:\/\/copr.fedorainfracloud.org\/coprs\/jorti\/fcgiwrap\/repo\/epel-7\/jorti-fcgiwrap-epel-7.repo -P \/etc\/yum.repos.d -P \/etc\/yum.repos.d<\/span> <\/p>\n<p>6. \u66f4\u65b0\u5957\u4ef6\u5eab<br \/># <span style=\"color: #ff0000\">yum update<\/span> <\/p>\n<p>7. \u5b89\u88dd\u76f8\u95dc\u5957\u4ef6<br \/># <span style=\"color: #ff0000\">yum install fcgiwrap spawn-fcgi<\/span> <\/p>\n<p>8. \u4fee\u6539<span style=\"color: #0000ff\"> \/etc\/sysconfig\/spawn-fcgi<\/span> \u8a2d\u5b9a\u6a94<br \/># <span style=\"color: #ff0000\">vim \/etc\/sysconfig\/spawn-fcgi<\/span> <br \/><span style=\"color: #0000ff\">FCGI_SOCKET=\/var\/run\/fcgiwrap.socket <\/span><br \/><span style=\"color: #0000ff\">FCGI_PROGRAM=\/usr\/sbin\/fcgiwrap <\/span><br \/><span style=\"color: #0000ff\">FCGI_USER=nginx <\/span><br \/><span style=\"color: #0000ff\">FCGI_GROUP=nginx <\/span><br \/><span style=\"color: #0000ff\">FCGI_EXTRA_OPTIONS=&#8221;-M 0700&#8243; <\/span><br \/><span style=\"color: #0000ff\">OPTIONS=&#8221;-u $FCGI_USER -g $FCGI_GROUP -s $FCGI_SOCKET -S $FCGI_EXTRA_OPTIONS -F 1 -P \/var\/run\/spawn-fcgi.pid &#8212; $FCGI_PROGRAM&#8221;<\/span> <\/p>\n<p>9. \u555f\u52d5 spawn-cfgi \u670d\u52d9<br \/># <span style=\"color: #ff0000\">systemctl enable spawn-fcgi<\/span><br \/><span style=\"color: #0000ff\">spawn-fcgi.service is not a native service, redirecting to \/sbin\/chkconfig.<\/span><br \/><span style=\"color: #0000ff\">Executing \/sbin\/chkconfig spawn-fcgi on<\/span><br \/># <span style=\"color: #ff0000\">systemctl start spawn-fcgi<\/span><\/p>\n<p>10. \u958b\u555f\u700f\u89bd\u5668 <span style=\"color: #ff0000\">http:\/\/Server&#8217;IP\/nagios<\/span> <br \/>\u8f38\u5165\u8a2d\u5b9a\u7684\u5e33\u865f\u53ca\u5bc6\u78bc <br \/> <a id=\"res_3786504\" href=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/25793-3786504.png\"> <img decoding=\"async\" src=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/previews-med\/25793-3786504.png\" border=\"0\" alt=\"\" \/> <\/a> <\/p>\n<p>11. \u767b\u5165\u5f8c\u756b\u9762 <br \/> <a id=\"res_3786503\" href=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/25793-3786503.png\"> <img decoding=\"async\" src=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/previews-med\/25793-3786503.png\" border=\"0\" alt=\"\" \/> <\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c3\u8003\u7db2\u9801\uff1a Linux \uff0e \u7121\u9650: \u5728 CentOS7\/RHEL7\u4e0a\uff0c\u70ba Nginx \u52a0\u4e0a Perl CGI &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/06\/06\/%e5%9c%a8-centos-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-nagios-4-x-nginx\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u5728 CentOS 7.x \u4e0a\u5b89\u88dd Nagios 4.x &#8211; Nginx\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,131],"tags":[],"class_list":["post-19585","post","type-post","status-publish","format-standard","hentry","category-c-78462","category-c-78476"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["688418"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19585"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19585"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19585\/revisions"}],"predecessor-version":[{"id":21091,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19585\/revisions\/21091"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}