以 ubuntu14.04 環境爲基礎的編譯配置html
<pre> git clone git://github.com/flackem/check_multi cd check_multi ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-checkresults_dir=/var/lib/nagios3/spool/checkresults/ --with-plugin_path=/usr/lib/nagios/plugins/ make all make install make install-config </pre>ios
<pre> #--- 定義要被動檢測命令 define command{ command_name check_dummy command_line $USER1$/check_dummy $ARG1$ $ARG2$ } #--- 定義要監控的主機服務 host1 define service { service_description system_disk host_name host1 passive_checks_enabled 1 active_checks_enabled 0 check_command check_dummy!0 "passive check" use generic-service } define service { service_description system_load host_name host1 passive_checks_enabled 1 active_checks_enabled 0 check_command check_dummy!0 "passive check" use generic-service } define service { service_description system_swap host_name host1 passive_checks_enabled 1 active_checks_enabled 0 check_command check_dummy!0 "passive check" use generic-service } define service { service_description proc_rsyslogd host_name host1 passive_checks_enabled 1 active_checks_enabled 0 check_command check_dummy!0 "passive check" use generic-service } </pre> git
feed_passive.cmdgithub
<pre> #--- feed_passive command file command [ system_disk ] = /usr/lib/nagios/plugins/check_disk -w 5% -c 2% -p / command [ system_load ] = /usr/lib/nagios/plugins/check_load -w 10,8,6 -c 20,18,16 command [ system_swap ] = /usr/lib/nagios/plugins/check_swap -w 90 -c 80 command [ proc_syslogd ] = /usr/lib/nagios/plugins/check_procs -c 1: -C syslogd #--- avoid redundant states state [ WARNING ] = IGNORE state [ CRITICAL ] = IGNORE state [ UNKNOWN ] = IGNORE </pre>ubuntu
這裏的例子是 使用send_multi 發送結果, 關於gearman相關配置參考 mod_gearman 配置插件
<pre> export PATH=$PATH:/usr/lib/nagios/plugins/ check_multi -f /etc/check_multi/feed_passive.cmd -r 256 | send_multi --server=10.2.0.119:4730 --encryption=yes key="l@bs&d156405189" --host="passive_1" </pre>server