{"id":4331,"date":"2015-05-04T15:07:50","date_gmt":"2015-05-04T07:07:50","guid":{"rendered":"https:\/\/www.hmouse.tk\/?p=4331"},"modified":"2015-05-04T15:09:01","modified_gmt":"2015-05-04T07:09:01","slug":"nagios%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/www.hmouse.cn\/?p=4331","title":{"rendered":"nagios\u5b89\u88c5"},"content":{"rendered":"<p>\u53c2\u8003\u6587\u6863\uff1a<a title=\"http:\/\/www.haiyun.me\/category\/nagios\/\" href=\"http:\/\/www.haiyun.me\/category\/nagios\/\">http:\/\/www.haiyun.me\/category\/nagios\/<\/a><\/p>\n<h4><a href=\"http:\/\/www.haiyun.me\/archives\/nagiosql-install.html\">Nagios\u4e4bweb\u754c\u9762\u7ba1\u7406\u5de5\u5177Nagiosql\u5b89\u88c5<\/a><\/h4>\n<p>\u53d1\u5e03\u65f6\u95f4\uff1aJune 4, 2012 \/\/ \u5206\u7c7b\uff1a<a href=\"http:\/\/www.haiyun.me\/category\/nagios\/\">Nagios<\/a> \/\/ <a href=\"http:\/\/www.haiyun.me\/archives\/nagiosql-install.html#comments\">No Comments<\/a> <\/p>\n<p><a href=\"http:\/\/www.haiyun.me\/tag\/nagiosql\">NagiosQL<\/a>\u662f\u4e00\u4e2a\u57fa\u4e8eWeb\u754c\u9762\u7684<a href=\"http:\/\/www.haiyun.me\/tag\/nagios\">Nagios<\/a>\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\uff0c\u6781\u5927\u65b9\u4fbfNagios\u7684\u4f7f\u7528\u3001\u7ba1\u7406\u3002<br \/>\u4e0b\u8f7d\u5b89\u88c5Nagiosql\uff1a <\/p>\n<p><code>cd<\/code> <code>\/var\/www\/html\/<\/code> <\/p>\n<p><code>wget http:<\/code><code>\/\/nchc<\/code><code>.dl.sourceforge.net<\/code><code>\/project\/nagiosql\/nagiosql\/NagiosQL<\/code><code>%203.2.0<\/code><code>\/nagiosql_320<\/code><code>.<\/code><code>tar<\/code><code>.gz<\/code> <\/p>\n<p><code>tar<\/code> <code>zxvf nagiosql_320.<\/code><code>tar<\/code><code>.gz <\/code> <\/p>\n<p><code>mv<\/code> <code>nagiosql32\/ nagiosql<\/code> <\/p>\n<p><code>chmod<\/code> <code>-R 777 <\/code><code>\/var\/www\/html\/nagiosql\/config\/<\/code> <\/p>\n<p>\u76ee\u5f55\u6743\u9650\u914d\u7f6e\uff1a <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/backup\/hosts<\/code> <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/backup\/services<\/code> <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/hosts<\/code> <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/services<\/code> <\/p>\n<p><code>chown<\/code> <code>-R nagios:apache <\/code><code>\/etc\/nagiosql\/<\/code> <\/p>\n<p><code>chown<\/code> <code>-R nagios:apache <\/code><code>\/usr\/local\/nagios\/etc\/<\/code> <\/p>\n<p><code>chown<\/code> <code>nagios:apache <\/code><code>\/usr\/local\/nagios\/bin\/nagios<\/code> <\/p>\n<p><code>chown<\/code> <code>nagios:apache <\/code><code>\/usr\/local\/nagios\/var\/rw\/nagios<\/code><code>.cmd<\/code> <\/p>\n<p><code>chown<\/code> <code>-R nagios:apache <\/code><code>\/usr\/local\/nagios\/var\/spool\/checkresults<\/code> <\/p>\n<p>\u7f16\u8f91nagios\u914d\u7f6e\u6587\u4ef6\uff0c\u6ce8\u91ca\u4ee5cfg\u5f00\u5934\u7684\u914d\u7f6e\uff0c\u5e76\u6dfb\u52a0\uff1a <\/p>\n<p><code>vim \/usr\/local\/nagios\/etc\/nagios.cfg<\/code> <\/p>\n<p><code>## Timeperiods<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/timeperiods.cfg<\/code> <\/p>\n<p><code>## Commands<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/commands.cfg<\/code> <\/p>\n<p><code>## Contacts<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/contacts.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/contactgroups.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/contacttemplates.cfg<\/code> <\/p>\n<p><code>## Hosts<\/code> <\/p>\n<p><code>cfg_dir=\/etc\/nagiosql\/hosts<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hosttemplates.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostgroups.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostextinfo.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostescalations.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostdependencies.cfg<\/code> <\/p>\n<p><code>## Services<\/code> <\/p>\n<p><code>cfg_dir=\/etc\/nagiosql\/services<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/servicetemplates.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/servicegroups.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/serviceextinfo.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/serviceescalations.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/servicedependencies.cfg<\/code> <\/p>\n<p>\u8bbf\u95eehttp:\/\/server\/nagiosql\/install\u8fdb\u5165\u5b89\u88c5\u754c\u9762\uff0c\u53ef\u9009\u4e2d\u6587\u8bed\u8a00\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/352\/\"><img decoding=\"async\" alt=\"nagiosql\u5b89\u88c5.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/3083397793.png\"><\/a><br \/>\u5f53\u524d\u73af\u5883\u68c0\u6d4b\uff0c\u5168\u7eff\u4e3a\u901a\u8fc7\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/353\/\"><img decoding=\"async\" alt=\"nagiosql\u5b89\u88c5\u73af\u5883\u68c0\u6d4b.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/242164212.png\"><\/a><br \/>\u586b\u5199\u914d\u7f6e\u4fe1\u606f\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/354\/\"><img decoding=\"async\" alt=\"nagiosql\u5b89\u88c5\u6570\u636e\u5e93\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/4041534189.png\"><\/a><br \/>\u4e0d\u51fa\u610f\u5916\u4f1a\u63d0\u793a\u5b89\u88c5\u6210\u529f\uff0c\u5220\u9664\u5b89\u88c5\u6587\u4ef6\uff0c\u8fdb\u5165\u767b\u5f55\u754c\u9762\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/355\/\"><img decoding=\"async\" alt=\"nagiosql\u767b\u5f55\u754c\u9762.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/3659581264.png\"><\/a><br \/>\u914d\u7f6enagios\u76f8\u5173\u76ee\u5f55\uff0c\u754c\u9762\u2014\u2014\u7ba1\u7406\u2014\u2014Config targets\u2014\u2014localhost\u2014\u2014\u7f16\u8f91\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/356\/\"><img decoding=\"async\" alt=\"nagiosql\u76ee\u6807\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/964615580.png\"><\/a><br \/>\u5bfc\u5165nagios\u914d\u7f6e\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/357\/\"><img decoding=\"async\" alt=\"nagiosql\u5bfc\u5165\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/961519620.png\"><\/a><br \/>\u5199\u5165\u6570\u636e\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/358\/\"><img decoding=\"async\" alt=\"nagiosql\u5199\u5165\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/1042409092.png\"><\/a> <\/p>\n<h4><a href=\"http:\/\/www.haiyun.me\/archives\/nagios-pnp4nagios-graphs.html\">Nagios\u914d\u7f6epnp4nagios\u652f\u6301\u56fe\u8868\u663e\u793a<\/a><\/h4>\n<p>\u53d1\u5e03\u65f6\u95f4\uff1aJune 3, 2012 \/\/ \u5206\u7c7b\uff1a<a href=\"http:\/\/www.haiyun.me\/category\/nagios\/\">Nagios<\/a> \/\/ <a href=\"http:\/\/www.haiyun.me\/archives\/nagios-pnp4nagios-graphs.html#comments\">No Comments<\/a> <\/p>\n<p><a href=\"http:\/\/www.haiyun.me\/tag\/nagios\">Nagios<\/a>\u914d\u5408<a href=\"http:\/\/www.haiyun.me\/tag\/pnp4nagios\">pnp4nagios<\/a>\u53ef\u5b9e\u73b0\u7c7b\u4f3c<a href=\"http:\/\/www.haiyun.me\/tag\/cacti\">Cacti<\/a>\u7684\u56fe\u8868\u663e\u793a\uff0c\u4fbf\u4e8e\u7ba1\u7406\u548c\u5206\u6790\u670d\u52a1\u5668\u8fd0\u884c\u72b6\u51b5\u3002<br \/>Nagios\u5b89\u88c5\u8bf7\u53c2\u8003\uff1a<a href=\"http:\/\/www.haiyun.me\/archives\/centos-install-nagios.html\">http:\/\/www.haiyun.me\/archives\/centos-install-nagios.html<\/a><br \/>\u5b89\u88c5rrdtool\uff0c\u9700<a href=\"http:\/\/www.haiyun.me\/archives\/centos-yum-epel.html\">\u5b89\u88c5epel\u6e90<\/a>\uff1a <\/p>\n<p><code>#http:\/\/www.haiyun.me<\/code> <\/p>\n<p><code>yum <\/code><code>install<\/code> <code>rrdtools perl-rrdtool perl-Time-HiRes<\/code> <\/p>\n<p>\u5b89\u88c5php4nagios\uff1a <\/p>\n<p><code>wget http:<\/code><code>\/\/nchc<\/code><code>.dl.sourceforge.net<\/code><code>\/project\/pnp4nagios\/PNP-0<\/code><code>.6<\/code><code>\/pnp4nagios-0<\/code><code>.6.17.<\/code><code>tar<\/code><code>.gz<\/code> <\/p>\n<p><code>tar<\/code> <code>zxvf pnp4nagios-0.6.17.<\/code><code>tar<\/code><code>.gz <\/code> <\/p>\n<p><code>cd<\/code> <code>pnp4nagios-0.6.17<\/code> <\/p>\n<p><code>.<\/code><code>\/configure<\/code> <code>--with-nagios-user=nagios --with-nagios-group=nagios<\/code> <\/p>\n<p><code>make<\/code> <code>all<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code><code>-webconf<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code><code>-config<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code><code>-init<\/code> <\/p>\n<p><code>#make fullinstall #\u76f8\u5f53\u4e8e\u4e0a\u97623\u4e2a\u6307\u4ee4<\/code> <\/p>\n<p>\u914d\u7f6ephp4nagios\uff1a <\/p>\n<p><code>#http:\/\/www.haiyun.me<\/code> <\/p>\n<p><code>cd<\/code> <code>\/usr\/local\/pnp4nagios\/etc\/<\/code> <\/p>\n<p><code>mv<\/code> <code>misccommands.cfg-sample misccommands.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>rra.cfg-sample rra.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>nagios.cfg-sample nagios.cfg<\/code> <\/p>\n<p><code>cd<\/code> <code>pages\/<\/code> <\/p>\n<p><code>mv<\/code> <code>web_traffic.cfg-sample web_traffic.cfg<\/code> <\/p>\n<p><code>cd<\/code> <code>..<\/code><code>\/check_commands\/<\/code> <\/p>\n<p><code>mv<\/code> <code>check_all_local_disks.cfg-sample check_all_local_disks.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>check_nrpe.cfg-sample check_nrpe.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>check_nwstat.cfg-sample check_nwstat.cfg<\/code> <\/p>\n<p><code>\/etc\/init<\/code><code>.d<\/code><code>\/npcd<\/code> <code>start<\/code> <\/p>\n<p><code>chkconfig npcd on<\/code> <\/p>\n<p>\u914d\u7f6eNagios\u6570\u636e\u8f93\u51fa\u63a5\u53e3\uff1a <\/p>\n<p><code>vim \/usr\/local\/nagios\/etc\/nagios.cfg <\/code> <\/p>\n<p><code>process_performance_data=1 #\u9ed8\u8ba4\u4e3a0\uff0c\u4fee\u6539\u4e3a1<\/code> <\/p>\n<p><code>host_perfdata_command=process-host-perfdata #\u6ce8\u91ca\u5f00\u5934#\u53f7<\/code> <\/p>\n<p><code>service_perfdata_command=process-service-perfdata #\u6ce8\u91ca\u5f00\u5934#\u53f7<\/code> <\/p>\n<p>\u66ff\u6362commands.cfg\u547d\u4ee4process-service-perfdata\u4e3a\u4ee5\u4e0b\u5185\u5bb9\uff1a <\/p>\n<p><code>vim \/usr\/local\/nagios\/etc\/objects\/commands.cfg <\/code> <\/p>\n<p><code># 'process-host-perfdata' command definition<\/code> <\/p>\n<p><code>define command{<\/code> <\/p>\n<p><code><\/code><code>command_name&nbsp;&nbsp;&nbsp; process-host-perfdata<\/code> <\/p>\n<p><code><\/code><code>command_line&nbsp;&nbsp;&nbsp; \/usr\/local\/pnp4nagios\/libexec\/process_perfdata.pl -d HOSTPERFDATA <\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p><code># 'process-service-perfdata' command definition<\/code> <\/p>\n<p><code>define command{<\/code> <\/p>\n<p><code><\/code><code>command_name&nbsp;&nbsp;&nbsp; process-service-perfdata<\/code> <\/p>\n<p><code><\/code><code>command_line&nbsp;&nbsp;&nbsp; \/usr\/local\/pnp4nagios\/libexec\/process_perfdata.pl<\/code> <\/p>\n<p><code><\/code><code>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code> <\/p>\n<p>\u5728\u6a21\u677f\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u56fe\u8868\u56fe\u6807\u6a21\u677f\uff1a <\/p>\n<p><code>#http:\/\/www.haiyun.me<\/code> <\/p>\n<p><code><\/code><code>vim \/usr\/local\/nagios\/etc\/objects\/templates.cfg <\/code> <\/p>\n<p><code>define host {<\/code> <\/p>\n<p><code>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; host-pnp<\/code> <\/p>\n<p><code>action_url&nbsp;&nbsp;&nbsp; \/pnp4nagios\/index.php\/graph?host=$HOSTNAME$&amp;srv=_HOST_' class='tips' rel='\/pnp4nagios\/index.php\/popup?host=$HOSTNAME$&amp;srv=_HOST_<\/code> <\/p>\n<p><code>register&nbsp;&nbsp; 0<\/code> <\/p>\n<p><code>}<\/code> <\/p>\n<p><code>define service {<\/code> <\/p>\n<p><code>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service-pnp<\/code> <\/p>\n<p><code>action_url&nbsp;&nbsp; \/pnp4nagios\/index.php\/graph?host=$HOSTNAME$&amp;srv=$SERVICEDESC$' class='tips' rel='\/pnp4nagios\/index.php\/popup?host=$HOSTNAME$&amp;srv=$SERVICEDESC$<\/code> <\/p>\n<p><code>register&nbsp;&nbsp; 0<\/code> <\/p>\n<p><code>}<\/code> <\/p>\n<p>\u590d\u5236\u9f20\u6807\u60ac\u505c\u56fe\u6807\u663e\u793a\u6587\u4ef6\uff1a <\/p>\n<p><code>cp<\/code> <code>\/usr\/local\/pnp4nagios\/contrib\/ssi\/<\/code><code>* <\/code><code>\/usr\/local\/nagios\/share\/ssi\/<\/code> <\/p>\n<p>\u5728\u76d1\u63a7\u4e3b\u673a\u6216\u670d\u52a1\u4e2d\u8c03\u7528\u56fe\u8868\u6a21\u677f\uff1a <\/p>\n<p><code>define host{<\/code> <\/p>\n<p><code><\/code><code>use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; linux-server,host-pnp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code> <\/p>\n<p><code><\/code><code>host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 127.0.0.1<\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p><code>define service{<\/code> <\/p>\n<p><code><\/code><code>use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local-service,service-pnp<\/code> <\/p>\n<p><code><\/code><code>host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PING<\/code> <\/p>\n<p><code><\/code><code>check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_ping!100.0,20%!500.0,60%<\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p><code>define service{<\/code> <\/p>\n<p><code><\/code><code>use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local-service,service-pnp<\/code> <\/p>\n<p><code><\/code><code>host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Root Partition<\/code> <\/p>\n<p><code><\/code><code>check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_local_disk!20%!10%!\/<\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p>\u91cd\u542fnagios\uff0c\u8bbf\u95eenagios\u754c\u9762\u5373\u53ef\u770b\u5230\u56fe\u8868\u5c0f\u56fe\u6807\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/347\/\"><img decoding=\"async\" alt=\"nagios\u56fe\u8868\u56fe\u6807.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/1368176475.png\"><\/a><br \/>\u70b9\u51fb\u56fe\u6807\u4f1a\u663e\u793apnp4nagios\u6d4b\u8bd5\u9875\u9762\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/348\/\"><img decoding=\"async\" alt=\"pnp4nagios\u6d4b\u8bd5\u9875\u9762.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/1904187785.png\"><\/a><br \/>\u5168\u662f\u7eff\u8272\u4ee3\u8868\u914d\u7f6e\u6b63\u5e38\uff0c\u7136\u540e\u79fb\u9664\u6216\u4fee\u6539install.php\u6587\u4ef6\uff1a <\/p>\n<p>1 <\/p>\n<p><code>rm<\/code> <code>-rf <\/code><code>\/usr\/local\/pnp4nagios\/share\/install<\/code><code>.php<\/code> <\/p>\n<p>\u518d\u6b21\u70b9\u51fb\u56fe\u6807\u5c31\u4f1a\u663e\u793a\u5f53\u524d\u76d1\u63a7\u670d\u52a1\u7531pnp4nagios\u751f\u6210\u7684\u56fe\u8868\u4e86\uff1a <\/p>\n<p><strong><font color=\"#ff0000\">\u6ce8\u610f \uff1a \u5176\u5b9e\u4e0a\u9762\u6d4b\u8bd5\u662f\u6ca1\u6570\u636e\u7684 \u800c\u4e14\u8fd8\u4f1a\u4e00\u76f4\u62a5\u9519<\/font><\/strong><\/p>\n<p>May&nbsp; 3 23:39:29 localhost nagios: wproc: SERVICE PERFDATA job 0 from worker Core Worker 102132 is a non-check helper but exited with return code 2<br \/>May&nbsp; 3 23:39:29 localhost nagios: wproc:&nbsp;&nbsp; early_timeout=0; exited_ok=1; wait_status=512; error_code=0;<br \/>May&nbsp; 3 23:39:29 localhost nagios: Worker 102132: Unknown jobtype: 10<br \/>May&nbsp; 3 23:39:29 localhost nagios: wproc: Unknown job type: 10<br \/>May&nbsp; 3 23:39:31 localhost nagios: wproc: SERVICE PERFDATA job 0 from worker Core Worker 102131 is a non-check helper but exited with return code 2<br \/>May&nbsp; 3 23:39:31 localhost nagios: wproc:&nbsp;&nbsp; early_timeout=0; exited_ok=1; wait_status=512; error_code=0;<br \/>May&nbsp; 3 23:39:31 localhost nagios: Worker 102131: Unknown jobtype: 10<br \/>May&nbsp; 3 23:39:31 localhost nagios: wproc: Unknown job type: 10 <\/p>\n<p>&nbsp;<\/p>\n<p>\u540e\u6765\u53d1\u73b0\u662f\u6a21\u5f0f\u7684\u95ee\u9898\u3002\u81f3\u4e8e\u539f\u6765\u7684\u6a21\u5f0f\u4e3a\u5565\u6709\u95ee\u9898\uff0c\u7f51\u4e0a\u5f88\u591a\u4eba\u53cd\u6620\u662f\u7248\u672c\u7684\u95ee\u9898\u3002\u540e\u6765\u6211\u628a\u6a21\u5f0f\u6362\u6210<\/p>\n<p><strong>.Bulk Mode with NPCD<\/strong> \u5c31\u597d\u4e86\uff0c\u800c\u4e14\u5b98\u7f51\u6587\u6863\u4e5f\u662f\u63a8\u8350\u8fd9\u79cd\u7684\u3002<\/p>\n<p><a href=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2015\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2015\/05\/image_thumb.png\" width=\"244\" height=\"87\"><\/a> <\/p>\n<p>\u53c2\u8003\u6587\u6863\uff1a<a title=\"http:\/\/www.kar-chan.com\/?p=2267\" href=\"http:\/\/www.kar-chan.com\/?p=2267\">http:\/\/www.kar-chan.com\/?p=2267<\/a><\/p>\n<p><strong>3.Bulk Mode with NPCD<\/strong> <\/p>\n<ul>\n<li>\n<p><strong>\u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u4ece\u540d\u5b57\u4e0a\u53ef\u4ee5\u770b\u51fa\uff0c\u8fd9\u79cd\u6a21\u5f0f\u548cBulk\u662f\u5dee\u4e0d\u591a\u7684\uff0c\u53ea\u662f\u591a\u4e86\u4e00\u6b65\u5c06\u6027\u80fd\u6570\u636e\u52a0\u4e0a\u65f6\u95f4\u6233\u79fb\u5230spool\u76ee\u5f55\u4e2d\u7b49\u5f85\u5904\u7406\uff0cnpcd\u670d\u52a1\u8c03\u7528process_perfdata.pl\u5bf9\u6570\u636e\u8fdb\u884c\u5904\u7406 <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.kar-chan.com\/wp-content\/uploads\/2014\/09\/92401411751361.png\"> <\/p>\n<ul>\n<li>\n<p><strong>\u914d\u7f6e\u53c2\u8003<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u7f16\u8f91nagios.cfg,\u52a0\u5165\u6216\u4fee\u6539\u5982\u4e0b\u9009\u9879 <\/p>\n<p>process_performance_data=1<br \/># service performance data<br \/>#<br \/>service_perfdata_file=\/usr\/local\/pnp4nagios\/var\/service-perfdata<br \/>service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\\tTIMET::$TIMET$\\tHOSTNAME::$HOSTNAME$\\tSERVICEDESC::$SERVICEDESC$\\tSERVICEPERFDATA::$SERVICEPERFDATA$\\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\\tHOSTSTATE::$HOSTSTATE$\\tHOSTSTATETYPE::$HOSTSTATETYPE$\\tSERVICESTATE::$SERVICESTATE$\\tSERVICESTATETYPE::$SERVICESTATETYPE$<br \/>service_perfdata_file_mode=a<br \/>service_perfdata_file_processing_interval=15<br \/>service_perfdata_file_processing_command=process-service-perfdata-file<br \/># host performance data starting with Nagios 3.0<br \/># <br \/>host_perfdata_file=\/usr\/local\/pnp4nagios\/var\/host-perfdata<br \/>host_perfdata_file_template=DATATYPE::HOSTPERFDATA\\tTIMET::$TIMET$\\tHOSTNAME::$HOSTNAME$\\tHOSTPERFDATA::$HOSTPERFDATA$\\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\\tHOSTSTATE::$HOSTSTATE$\\tHOSTSTATETYPE::$HOSTSTATETYPE$<br \/>host_perfdata_file_mode=a<br \/>host_perfdata_file_processing_interval=15<br \/>host_perfdata_file_processing_command=process-host-perfdata-file <\/p>\n<p>\u7f16\u8f91commands.cfg,\u52a0\u5165\u6216\u4fee\u6539\u5982\u4e0b\u9009\u9879<\/p>\n<pre>define command{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_name&nbsp;&nbsp;&nbsp; process-service-perfdata-file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_line&nbsp;&nbsp;&nbsp; \/bin\/mv \/usr\/local\/pnp4nagios\/var\/service-perfdata \/usr\/local\/pnp4nagios\/var\/spool\/service-perfdata.$TIMET$\n}\ndefine command{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_name&nbsp;&nbsp;&nbsp; process-host-perfdata-file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_line&nbsp;&nbsp;&nbsp; \/bin\/mv \/usr\/local\/pnp4nagios\/var\/host-perfdata \/usr\/local\/pnp4nagios\/var\/spool\/host-perfdata.$TIMET$\n}<\/pre>\n<p>\u8fd9\u6b21\u91cd\u88c5\u8ba9\u6211\u66f4\u719f\u6089nagios\uff0c\u5f88\u591a\u90fd\u5fd8\u4e86\uff0c\u6240\u4ee5\u8fd8\u641e\u4e86\u4e00\u5929\uff01\u60ed\u6127\uff01<\/p>\n<p>\u8b6c\u5982\u68c0\u6d4b\u5b58\u6d3b\u7684 check_alive<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u6587\u6863\uff1a<a title=\"http:\/\/www.haiyun.me\/category\/nagios\/\" href=\"http:\/\/www.haiyun.me\/category\/nagios\/\">http:\/\/www.haiyun.me\/category\/nagios\/<\/a><\/p>\n<h4><a href=\"http:\/\/www.haiyun.me\/archives\/nagiosql-install.html\">Nagios\u4e4bweb\u754c\u9762\u7ba1\u7406\u5de5\u5177Nagiosql\u5b89\u88c5<\/a><\/h4>\n<p>\u53d1\u5e03\u65f6\u95f4\uff1aJune 4, 2012 \/\/ \u5206\u7c7b\uff1a<a href=\"http:\/\/www.haiyun.me\/category\/nagios\/\">Nagios<\/a> \/\/ <a href=\"http:\/\/www.haiyun.me\/archives\/nagiosql-install.html#comments\">No Comments<\/a> <\/p>\n<p><a href=\"http:\/\/www.haiyun.me\/tag\/nagiosql\">NagiosQL<\/a>\u662f\u4e00\u4e2a\u57fa\u4e8eWeb\u754c\u9762\u7684<a href=\"http:\/\/www.haiyun.me\/tag\/nagios\">Nagios<\/a>\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\uff0c\u6781\u5927\u65b9\u4fbfNagios\u7684\u4f7f\u7528\u3001\u7ba1\u7406\u3002<br \/>\u4e0b\u8f7d\u5b89\u88c5Nagiosql\uff1a <\/p>\n<p><code>cd<\/code> <code>\/var\/www\/html\/<\/code> <\/p>\n<p><code>wget http:<\/code><code>\/\/nchc<\/code><code>.dl.sourceforge.net<\/code><code>\/project\/nagiosql\/nagiosql\/NagiosQL<\/code><code>%203.2.0<\/code><code>\/nagiosql_320<\/code><code>.<\/code><code>tar<\/code><code>.gz<\/code> <\/p>\n<p><code>tar<\/code> <code>zxvf nagiosql_320.<\/code><code>tar<\/code><code>.gz <\/code> <\/p>\n<p><code>mv<\/code> <code>nagiosql32\/ nagiosql<\/code> <\/p>\n<p><code>chmod<\/code> <code>-R 777 <\/code><code>\/var\/www\/html\/nagiosql\/config\/<\/code> <\/p>\n<p>\u76ee\u5f55\u6743\u9650\u914d\u7f6e\uff1a <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/backup\/hosts<\/code> <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/backup\/services<\/code> <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/hosts<\/code> <\/p>\n<p><code>mkdir<\/code> <code>-p <\/code><code>\/etc\/nagiosql\/services<\/code> <\/p>\n<p><code>chown<\/code> <code>-R nagios:apache <\/code><code>\/etc\/nagiosql\/<\/code> <\/p>\n<p><code>chown<\/code> <code>-R nagios:apache <\/code><code>\/usr\/local\/nagios\/etc\/<\/code> <\/p>\n<p><code>chown<\/code> <code>nagios:apache <\/code><code>\/usr\/local\/nagios\/bin\/nagios<\/code> <\/p>\n<p><code>chown<\/code> <code>nagios:apache <\/code><code>\/usr\/local\/nagios\/var\/rw\/nagios<\/code><code>.cmd<\/code> <\/p>\n<p><code>chown<\/code> <code>-R nagios:apache <\/code><code>\/usr\/local\/nagios\/var\/spool\/checkresults<\/code> <\/p>\n<p>\u7f16\u8f91nagios\u914d\u7f6e\u6587\u4ef6\uff0c\u6ce8\u91ca\u4ee5cfg\u5f00\u5934\u7684\u914d\u7f6e\uff0c\u5e76\u6dfb\u52a0\uff1a <\/p>\n<p><code>vim \/usr\/local\/nagios\/etc\/nagios.cfg<\/code> <\/p>\n<p><code>## Timeperiods<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/timeperiods.cfg<\/code> <\/p>\n<p><code>## Commands<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/commands.cfg<\/code> <\/p>\n<p><code>## Contacts<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/contacts.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/contactgroups.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/contacttemplates.cfg<\/code> <\/p>\n<p><code>## Hosts<\/code> <\/p>\n<p><code>cfg_dir=\/etc\/nagiosql\/hosts<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hosttemplates.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostgroups.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostextinfo.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostescalations.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/hostdependencies.cfg<\/code> <\/p>\n<p><code>## Services<\/code> <\/p>\n<p><code>cfg_dir=\/etc\/nagiosql\/services<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/servicetemplates.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/servicegroups.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/serviceextinfo.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/serviceescalations.cfg<\/code> <\/p>\n<p><code>cfg_file=\/etc\/nagiosql\/servicedependencies.cfg<\/code> <\/p>\n<p>\u8bbf\u95eehttp:\/\/server\/nagiosql\/install\u8fdb\u5165\u5b89\u88c5\u754c\u9762\uff0c\u53ef\u9009\u4e2d\u6587\u8bed\u8a00\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/352\/\"><img decoding=\"async\" alt=\"nagiosql\u5b89\u88c5.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/3083397793.png\"><\/a><br \/>\u5f53\u524d\u73af\u5883\u68c0\u6d4b\uff0c\u5168\u7eff\u4e3a\u901a\u8fc7\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/353\/\"><img decoding=\"async\" alt=\"nagiosql\u5b89\u88c5\u73af\u5883\u68c0\u6d4b.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/242164212.png\"><\/a><br \/>\u586b\u5199\u914d\u7f6e\u4fe1\u606f\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/354\/\"><img decoding=\"async\" alt=\"nagiosql\u5b89\u88c5\u6570\u636e\u5e93\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/4041534189.png\"><\/a><br \/>\u4e0d\u51fa\u610f\u5916\u4f1a\u63d0\u793a\u5b89\u88c5\u6210\u529f\uff0c\u5220\u9664\u5b89\u88c5\u6587\u4ef6\uff0c\u8fdb\u5165\u767b\u5f55\u754c\u9762\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/355\/\"><img decoding=\"async\" alt=\"nagiosql\u767b\u5f55\u754c\u9762.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/3659581264.png\"><\/a><br \/>\u914d\u7f6enagios\u76f8\u5173\u76ee\u5f55\uff0c\u754c\u9762\u2014\u2014\u7ba1\u7406\u2014\u2014Config targets\u2014\u2014localhost\u2014\u2014\u7f16\u8f91\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/356\/\"><img decoding=\"async\" alt=\"nagiosql\u76ee\u6807\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/964615580.png\"><\/a><br \/>\u5bfc\u5165nagios\u914d\u7f6e\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/357\/\"><img decoding=\"async\" alt=\"nagiosql\u5bfc\u5165\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/961519620.png\"><\/a><br \/>\u5199\u5165\u6570\u636e\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/358\/\"><img decoding=\"async\" alt=\"nagiosql\u5199\u5165\u914d\u7f6e.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/1042409092.png\"><\/a> <\/p>\n<h4><a href=\"http:\/\/www.haiyun.me\/archives\/nagios-pnp4nagios-graphs.html\">Nagios\u914d\u7f6epnp4nagios\u652f\u6301\u56fe\u8868\u663e\u793a<\/a><\/h4>\n<p>\u53d1\u5e03\u65f6\u95f4\uff1aJune 3, 2012 \/\/ \u5206\u7c7b\uff1a<a href=\"http:\/\/www.haiyun.me\/category\/nagios\/\">Nagios<\/a> \/\/ <a href=\"http:\/\/www.haiyun.me\/archives\/nagios-pnp4nagios-graphs.html#comments\">No Comments<\/a> <\/p>\n<p><a href=\"http:\/\/www.haiyun.me\/tag\/nagios\">Nagios<\/a>\u914d\u5408<a href=\"http:\/\/www.haiyun.me\/tag\/pnp4nagios\">pnp4nagios<\/a>\u53ef\u5b9e\u73b0\u7c7b\u4f3c<a href=\"http:\/\/www.haiyun.me\/tag\/cacti\">Cacti<\/a>\u7684\u56fe\u8868\u663e\u793a\uff0c\u4fbf\u4e8e\u7ba1\u7406\u548c\u5206\u6790\u670d\u52a1\u5668\u8fd0\u884c\u72b6\u51b5\u3002<br \/>Nagios\u5b89\u88c5\u8bf7\u53c2\u8003\uff1a<a href=\"http:\/\/www.haiyun.me\/archives\/centos-install-nagios.html\">http:\/\/www.haiyun.me\/archives\/centos-install-nagios.html<\/a><br \/>\u5b89\u88c5rrdtool\uff0c\u9700<a href=\"http:\/\/www.haiyun.me\/archives\/centos-yum-epel.html\">\u5b89\u88c5epel\u6e90<\/a>\uff1a <\/p>\n<p><code>#http:\/\/www.haiyun.me<\/code> <\/p>\n<p><code>yum <\/code><code>install<\/code> <code>rrdtools perl-rrdtool perl-Time-HiRes<\/code> <\/p>\n<p>\u5b89\u88c5php4nagios\uff1a <\/p>\n<p><code>wget http:<\/code><code>\/\/nchc<\/code><code>.dl.sourceforge.net<\/code><code>\/project\/pnp4nagios\/PNP-0<\/code><code>.6<\/code><code>\/pnp4nagios-0<\/code><code>.6.17.<\/code><code>tar<\/code><code>.gz<\/code> <\/p>\n<p><code>tar<\/code> <code>zxvf pnp4nagios-0.6.17.<\/code><code>tar<\/code><code>.gz <\/code> <\/p>\n<p><code>cd<\/code> <code>pnp4nagios-0.6.17<\/code> <\/p>\n<p><code>.<\/code><code>\/configure<\/code> <code>--with-nagios-user=nagios --with-nagios-group=nagios<\/code> <\/p>\n<p><code>make<\/code> <code>all<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code><code>-webconf<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code><code>-config<\/code> <\/p>\n<p><code>make<\/code> <code>install<\/code><code>-init<\/code> <\/p>\n<p><code>#make fullinstall #\u76f8\u5f53\u4e8e\u4e0a\u97623\u4e2a\u6307\u4ee4<\/code> <\/p>\n<p>\u914d\u7f6ephp4nagios\uff1a <\/p>\n<p><code>#http:\/\/www.haiyun.me<\/code> <\/p>\n<p><code>cd<\/code> <code>\/usr\/local\/pnp4nagios\/etc\/<\/code> <\/p>\n<p><code>mv<\/code> <code>misccommands.cfg-sample misccommands.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>rra.cfg-sample rra.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>nagios.cfg-sample nagios.cfg<\/code> <\/p>\n<p><code>cd<\/code> <code>pages\/<\/code> <\/p>\n<p><code>mv<\/code> <code>web_traffic.cfg-sample web_traffic.cfg<\/code> <\/p>\n<p><code>cd<\/code> <code>..<\/code><code>\/check_commands\/<\/code> <\/p>\n<p><code>mv<\/code> <code>check_all_local_disks.cfg-sample check_all_local_disks.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>check_nrpe.cfg-sample check_nrpe.cfg<\/code> <\/p>\n<p><code>mv<\/code> <code>check_nwstat.cfg-sample check_nwstat.cfg<\/code> <\/p>\n<p><code>\/etc\/init<\/code><code>.d<\/code><code>\/npcd<\/code> <code>start<\/code> <\/p>\n<p><code>chkconfig npcd on<\/code> <\/p>\n<p>\u914d\u7f6eNagios\u6570\u636e\u8f93\u51fa\u63a5\u53e3\uff1a <\/p>\n<p><code>vim \/usr\/local\/nagios\/etc\/nagios.cfg <\/code> <\/p>\n<p><code>process_performance_data=1 #\u9ed8\u8ba4\u4e3a0\uff0c\u4fee\u6539\u4e3a1<\/code> <\/p>\n<p><code>host_perfdata_command=process-host-perfdata #\u6ce8\u91ca\u5f00\u5934#\u53f7<\/code> <\/p>\n<p><code>service_perfdata_command=process-service-perfdata #\u6ce8\u91ca\u5f00\u5934#\u53f7<\/code> <\/p>\n<p>\u66ff\u6362commands.cfg\u547d\u4ee4process-service-perfdata\u4e3a\u4ee5\u4e0b\u5185\u5bb9\uff1a <\/p>\n<p><code>vim \/usr\/local\/nagios\/etc\/objects\/commands.cfg <\/code> <\/p>\n<p><code># 'process-host-perfdata' command definition<\/code> <\/p>\n<p><code>define command{<\/code> <\/p>\n<p><code><\/code><code>command_name&nbsp;&nbsp;&nbsp; process-host-perfdata<\/code> <\/p>\n<p><code><\/code><code>command_line&nbsp;&nbsp;&nbsp; \/usr\/local\/pnp4nagios\/libexec\/process_perfdata.pl -d HOSTPERFDATA <\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p><code># 'process-service-perfdata' command definition<\/code> <\/p>\n<p><code>define command{<\/code> <\/p>\n<p><code><\/code><code>command_name&nbsp;&nbsp;&nbsp; process-service-perfdata<\/code> <\/p>\n<p><code><\/code><code>command_line&nbsp;&nbsp;&nbsp; \/usr\/local\/pnp4nagios\/libexec\/process_perfdata.pl<\/code> <\/p>\n<p><code><\/code><code>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code> <\/p>\n<p>\u5728\u6a21\u677f\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u56fe\u8868\u56fe\u6807\u6a21\u677f\uff1a <\/p>\n<p><code>#http:\/\/www.haiyun.me<\/code> <\/p>\n<p><code><\/code><code>vim \/usr\/local\/nagios\/etc\/objects\/templates.cfg <\/code> <\/p>\n<p><code>define host {<\/code> <\/p>\n<p><code>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; host-pnp<\/code> <\/p>\n<p><code>action_url&nbsp;&nbsp;&nbsp; \/pnp4nagios\/index.php\/graph?host=$HOSTNAME$&amp;srv=_HOST_' class='tips' rel='\/pnp4nagios\/index.php\/popup?host=$HOSTNAME$&amp;srv=_HOST_<\/code> <\/p>\n<p><code>register&nbsp;&nbsp; 0<\/code> <\/p>\n<p><code>}<\/code> <\/p>\n<p><code>define service {<\/code> <\/p>\n<p><code>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service-pnp<\/code> <\/p>\n<p><code>action_url&nbsp;&nbsp; \/pnp4nagios\/index.php\/graph?host=$HOSTNAME$&amp;srv=$SERVICEDESC$' class='tips' rel='\/pnp4nagios\/index.php\/popup?host=$HOSTNAME$&amp;srv=$SERVICEDESC$<\/code> <\/p>\n<p><code>register&nbsp;&nbsp; 0<\/code> <\/p>\n<p><code>}<\/code> <\/p>\n<p>\u590d\u5236\u9f20\u6807\u60ac\u505c\u56fe\u6807\u663e\u793a\u6587\u4ef6\uff1a <\/p>\n<p><code>cp<\/code> <code>\/usr\/local\/pnp4nagios\/contrib\/ssi\/<\/code><code>* <\/code><code>\/usr\/local\/nagios\/share\/ssi\/<\/code> <\/p>\n<p>\u5728\u76d1\u63a7\u4e3b\u673a\u6216\u670d\u52a1\u4e2d\u8c03\u7528\u56fe\u8868\u6a21\u677f\uff1a <\/p>\n<p><code>define host{<\/code> <\/p>\n<p><code><\/code><code>use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; linux-server,host-pnp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code> <\/p>\n<p><code><\/code><code>host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 127.0.0.1<\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p><code>define service{<\/code> <\/p>\n<p><code><\/code><code>use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local-service,service-pnp<\/code> <\/p>\n<p><code><\/code><code>host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PING<\/code> <\/p>\n<p><code><\/code><code>check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_ping!100.0,20%!500.0,60%<\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p><code>define service{<\/code> <\/p>\n<p><code><\/code><code>use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local-service,service-pnp<\/code> <\/p>\n<p><code><\/code><code>host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<\/code> <\/p>\n<p><code><\/code><code>service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Root Partition<\/code> <\/p>\n<p><code><\/code><code>check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_local_disk!20%!10%!\/<\/code> <\/p>\n<p><code><\/code><code>}<\/code> <\/p>\n<p>\u91cd\u542fnagios\uff0c\u8bbf\u95eenagios\u754c\u9762\u5373\u53ef\u770b\u5230\u56fe\u8868\u5c0f\u56fe\u6807\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/347\/\"><img decoding=\"async\" alt=\"nagios\u56fe\u8868\u56fe\u6807.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/1368176475.png\"><\/a><br \/>\u70b9\u51fb\u56fe\u6807\u4f1a\u663e\u793apnp4nagios\u6d4b\u8bd5\u9875\u9762\uff1a<br \/><a href=\"http:\/\/www.haiyun.me\/attachment\/348\/\"><img decoding=\"async\" alt=\"pnp4nagios\u6d4b\u8bd5\u9875\u9762.png\" src=\"http:\/\/www.haiyun.me\/usr\/uploads\/2012\/06\/1904187785.png\"><\/a><br \/>\u5168\u662f\u7eff\u8272\u4ee3\u8868\u914d\u7f6e\u6b63\u5e38\uff0c\u7136\u540e\u79fb\u9664\u6216\u4fee\u6539install.php\u6587\u4ef6\uff1a <\/p>\n<p>1 <\/p>\n<p><code>rm<\/code> <code>-rf <\/code><code>\/usr\/local\/pnp4nagios\/share\/install<\/code><code>.php<\/code> <\/p>\n<p>\u518d\u6b21\u70b9\u51fb\u56fe\u6807\u5c31\u4f1a\u663e\u793a\u5f53\u524d\u76d1\u63a7\u670d\u52a1\u7531pnp4nagios\u751f\u6210\u7684\u56fe\u8868\u4e86\uff1a <\/p>\n<p><strong><font color=\"#ff0000\">\u6ce8\u610f \uff1a \u5176\u5b9e\u4e0a\u9762\u6d4b\u8bd5\u662f\u6ca1\u6570\u636e\u7684 \u800c\u4e14\u8fd8\u4f1a\u4e00\u76f4\u62a5\u9519<\/font><\/strong><\/p>\n<p>May&nbsp; 3 23:39:29 localhost nagios: wproc: SERVICE PERFDATA job 0 from worker Core Worker 102132 is a non-check helper but exited with return code 2<br \/>May&nbsp; 3 23:39:29 localhost nagios: wproc:&nbsp;&nbsp; early_timeout=0; exited_ok=1; wait_status=512; error_code=0;<br \/>May&nbsp; 3 23:39:29 localhost nagios: Worker 102132: Unknown jobtype: 10<br \/>May&nbsp; 3 23:39:29 localhost nagios: wproc: Unknown job type: 10<br \/>May&nbsp; 3 23:39:31 localhost nagios: wproc: SERVICE PERFDATA job 0 from worker Core Worker 102131 is a non-check helper but exited with return code 2<br \/>May&nbsp; 3 23:39:31 localhost nagios: wproc:&nbsp;&nbsp; early_timeout=0; exited_ok=1; wait_status=512; error_code=0;<br \/>May&nbsp; 3 23:39:31 localhost nagios: Worker 102131: Unknown jobtype: 10<br \/>May&nbsp; 3 23:39:31 localhost nagios: wproc: Unknown job type: 10 <\/p>\n<p>&nbsp;<\/p>\n<p>\u540e\u6765\u53d1\u73b0\u662f\u6a21\u5f0f\u7684\u95ee\u9898\u3002\u81f3\u4e8e\u539f\u6765\u7684\u6a21\u5f0f\u4e3a\u5565\u6709\u95ee\u9898\uff0c\u7f51\u4e0a\u5f88\u591a\u4eba\u53cd\u6620\u662f\u7248\u672c\u7684\u95ee\u9898\u3002\u540e\u6765\u6211\u628a\u6a21\u5f0f\u6362\u6210<\/p>\n<p><strong>.Bulk Mode with NPCD<\/strong> \u5c31\u597d\u4e86\uff0c\u800c\u4e14\u5b98\u7f51\u6587\u6863\u4e5f\u662f\u63a8\u8350\u8fd9\u79cd\u7684\u3002<\/p>\n<p><a href=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2015\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2015\/05\/image_thumb.png\" width=\"244\" height=\"87\"><\/a> <\/p>\n<p>\u53c2\u8003\u6587\u6863\uff1a<a title=\"http:\/\/www.kar-chan.com\/?p=2267\" href=\"http:\/\/www.kar-chan.com\/?p=2267\">http:\/\/www.kar-chan.com\/?p=2267<\/a><\/p>\n<p><strong>3.Bulk Mode with NPCD<\/strong> <\/p>\n<ul>\n<li>\n<p><strong>\u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u4ece\u540d\u5b57\u4e0a\u53ef\u4ee5\u770b\u51fa\uff0c\u8fd9\u79cd\u6a21\u5f0f\u548cBulk\u662f\u5dee\u4e0d\u591a\u7684\uff0c\u53ea\u662f\u591a\u4e86\u4e00\u6b65\u5c06\u6027\u80fd\u6570\u636e\u52a0\u4e0a\u65f6\u95f4\u6233\u79fb\u5230spool\u76ee\u5f55\u4e2d\u7b49\u5f85\u5904\u7406\uff0cnpcd\u670d\u52a1\u8c03\u7528process_perfdata.pl\u5bf9\u6570\u636e\u8fdb\u884c\u5904\u7406 <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.kar-chan.com\/wp-content\/uploads\/2014\/09\/92401411751361.png\"> <\/p>\n<ul>\n<li>\n<p><strong>\u914d\u7f6e\u53c2\u8003<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u7f16\u8f91nagios.cfg,\u52a0\u5165\u6216\u4fee\u6539\u5982\u4e0b\u9009\u9879 <\/p>\n<p>process_performance_data=1<br \/># service performance data<br \/>#<br \/>service_perfdata_file=\/usr\/local\/pnp4nagios\/var\/service-perfdata<br \/>service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\\tTIMET::$TIMET$\\tHOSTNAME::$HOSTNAME$\\tSERVICEDESC::$SERVICEDESC$\\tSERVICEPERFDATA::$SERVICEPERFDATA$\\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\\tHOSTSTATE::$HOSTSTATE$\\tHOSTSTATETYPE::$HOSTSTATETYPE$\\tSERVICESTATE::$SERVICESTATE$\\tSERVICESTATETYPE::$SERVICESTATETYPE$<br \/>service_perfdata_file_mode=a<br \/>service_perfdata_file_processing_interval=15<br \/>service_perfdata_file_processing_command=process-service-perfdata-file<br \/># host performance data starting with Nagios 3.0<br \/># <br \/>host_perfdata_file=\/usr\/local\/pnp4nagios\/var\/host-perfdata<br \/>host_perfdata_file_template=DATATYPE::HOSTPERFDATA\\tTIMET::$TIMET$\\tHOSTNAME::$HOSTNAME$\\tHOSTPERFDATA::$HOSTPERFDATA$\\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\\tHOSTSTATE::$HOSTSTATE$\\tHOSTSTATETYPE::$HOSTSTATETYPE$<br \/>host_perfdata_file_mode=a<br \/>host_perfdata_file_processing_interval=15<br \/>host_perfdata_file_processing_command=process-host-perfdata-file <\/p>\n<p>\u7f16\u8f91commands.cfg,\u52a0\u5165\u6216\u4fee\u6539\u5982\u4e0b\u9009\u9879<\/p>\n<pre>define command{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_name&nbsp;&nbsp;&nbsp; process-service-perfdata-file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_line&nbsp;&nbsp;&nbsp; \/bin\/mv \/usr\/local\/pnp4nagios\/var\/service-perfdata \/usr\/local\/pnp4nagios\/var\/spool\/service-perfdata.$TIMET$\n}\ndefine command{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_name&nbsp;&nbsp;&nbsp; process-host-perfdata-file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_line&nbsp;&nbsp;&nbsp; \/bin\/mv \/usr\/local\/pnp4nagios\/var\/host-perfdata \/usr\/local\/pnp4nagios\/var\/spool\/host-perfdata.$TIMET$\n}<\/pre>\n<p>\u8fd9\u6b21\u91cd\u88c5\u8ba9\u6211\u66f4\u719f\u6089nagios\uff0c\u5f88\u591a\u90fd\u5fd8\u4e86\uff0c\u6240\u4ee5\u8fd8\u641e\u4e86\u4e00\u5929\uff01\u60ed\u6127\uff01<\/p>\n<p>\u8b6c\u5982\u68c0\u6d4b\u5b58\u6d3b\u7684 check_alive<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[86],"class_list":["post-4331","post","type-post","status-publish","format-standard","hentry","category-5","tag-nagios","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4331"}],"version-history":[{"count":2,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4331\/revisions"}],"predecessor-version":[{"id":4333,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4331\/revisions\/4333"}],"wp:attachment":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}