{"id":4216,"date":"2018-07-16T20:36:00","date_gmt":"2018-07-16T11:36:00","guid":{"rendered":"http:\/\/tsaitoh.net\/wp\/?p=4216"},"modified":"2018-09-14T19:47:06","modified_gmt":"2018-09-14T10:47:06","slug":"icinga-notify-google-home-notifier","status":"publish","type":"post","link":"https:\/\/tsaitoh.net\/wp\/2018\/07\/16\/icinga-notify-google-home-notifier\/","title":{"rendered":"icinga\u304b\u3089google-home-notifier\u3067\u8b66\u544a"},"content":{"rendered":"<p>\u3042\u307e\u308a\u306b\u3082\u6691\u3044\u65e5\u304c\u7d9a\u304f\u306a\u304b\u3001\u591c\u306f\u6dbc\u3057\u304f\u306a\u308b\u304b\u3068\u30a8\u30a2\u30b3\u30f3\u3092\u63a7\u3048\u3081\u306b\u3059\u308b\u3068\u3001\u6691\u3055\u3067\u76ee\u304c\u899a\u3081\u308b\u3053\u3068\u3082\u3042\u308b\u3002\u90e8\u5c4b\u306e\u6e29\u5ea6\u306f\u3001\u6e29\u5ea6\u30fb\u6e7f\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u6e2c\u3063\u3066\u3044\u308b\u3057\u3001google-home-notifier \u3092\u4f7f\u3063\u3066\u6691\u3055\u306e\u8b66\u544a\u3092\u3057\u3083\u3079\u3089\u305b\u3066\u307f\u308b\u3002\u5358\u7d14\u306b\u6e29\u5ea6\u304c\u8a2d\u5b9a\u6e29\u5ea6\u3092\u8d8a\u3048\u305f\u3089&#8230;\u306a\u3093\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3060\u3068\u3001\u983b\u7e41\u306b\u558b\u3089\u308c\u3066\u3082\u3046\u308b\u3055\u3044\u3057\u3001icinga \u304b\u3089\u547c\u3073\u51fa\u3055\u305b\u3066\u307f\u305f\u3002<\/p>\n<h3 class=\"my-header\">\u8b66\u544a\u6642\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8d77\u52d5<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">## \/etc\/icinga\/commands.cfg \u8ffd\u8a18 ##\r\n# 'notify-host-by-program' command definition\r\ndefine command{\r\n   command_name  notify-host-by-program\r\n   command_line  \/etc\/icinga\/commands-host.sh \\\r\n      \"$HOSTNAME$\" \"$NOTIFICATIONTYPE$\" \\\r\n      \"$HOSTSTATE$\" \"$HOSTOUTPUT$\"\r\n   }\r\n\r\n# 'notify-service-by-program' command definition\r\ndefine command{\r\n   command_name  notify-service-by-program\r\n   command_line  \/etc\/icinga\/commands-service.sh \\\r\n      \"$HOSTNAME$\" \"$SERVICESESC$\" \"$NOTIFICATIONTYPE$\" \\\r\n      \"$SERVICESTATE$\" \"$SERVICEOUTPUT$\"\r\n   }\r\n## \/etc\/icinga\/objects\/contacts_icinga.cfg \u8ffd\u8a18 ##\r\ndefine contact{\r\n   contact_name                    notifyProgram\r\n   alias                           NotifyProgram\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-program\r\n   host_notification_commands      notify-host-by-program\r\n   email                           foobar@example.com\r\n   }\r\ndefine contactgroup{\r\n   contactgroup_name       adminsProgram\r\n   alias                   Administrators and Notify Program\r\n   members                 root,notifyProgram\r\n   }\r\n<\/pre>\n<h3 class=\"my-header\">\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u306e\u8a2d\u5b9a<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">## \/etc\/icinga\/objects\/localhost_icinga.cfg ##\r\n# USBRH\r\ndefine service{\r\n   use                    generic-service\r\n   host_name              localhost\r\n   service_description    USBRH\r\n      check_command       check_usbrh2!32!35!81!85\r\n      contact_groups      adminsProgram\r\n   }\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\r\n## \/etc\/icinga\/commands-service.sh ##\r\n#!\/bin\/bash\r\n# icinga \u304b\u3089\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3088\u308a\u8b66\u544a\r\n#    ((commands.cfg \u3092\u53c2\u7167))\r\n#    \/etc\/icinga\/commands-service.sh\r\n#       \"$HOSTNAME$\" \"$SERVICESESC$\" \"$NOTIFICATIONTYPE$\"\r\n#       \"$SERVICESTATE$\" \"$SERVICEOUTPUT$\"\r\ncase \"$2-$3\" in\r\n  USBRH-PROBLEM )\r\n    case \"$4\" in\r\n      WARNING | CRITICAL )\r\n        if [ \"$4\" == \"CRITICAL\" ]; then\r\n          MESS=\"\u90e8\u5c4b\u306e\u6e29\u5ea6\u304c\u5371\u967a\u3067\u3059\u3002\"\r\n        else\r\n          MESS=\"\u90e8\u5c4b\u306e\u6e29\u5ea6\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\"\r\n        fi\r\n        \/usr\/bin\/printf \"%s %.1f \u5ea6 %.1f %%\" \"$MESS\" \\\r\n           `\u6e29\u5ea6\u3068\u6e7f\u5ea6\u3092\u53d6\u5f97\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8` \\\r\n           | \u6a19\u6e96\u5165\u529b\u3092google-home-notifier\u306b\u9001\u308b\u30b9\u30af\u30ea\u30d7\u30c8\r\n        ;;\r\n    esac\r\n    ;;\r\nesac\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u3042\u307e\u308a\u306b\u3082\u6691\u3044\u65e5\u304c\u7d9a\u304f\u306a\u304b\u3001\u591c\u306f\u6dbc\u3057\u304f\u306a\u308b\u304b\u3068\u30a8\u30a2\u30b3\u30f3\u3092\u63a7\u3048\u3081\u306b\u3059\u308b\u3068\u3001\u6691\u3055\u3067\u76ee\u304c\u899a\u3081\u308b\u3053\u3068\u3082\u3042\u308b\u3002\u90e8\u5c4b\u306e\u6e29\u5ea6\u306f\u3001\u6e29\u5ea6\u30fb\u6e7f\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u6e2c\u3063\u3066\u3044\u308b\u3057\u3001google-home-notifier \u3092\u4f7f\u3063\u3066\u6691\u3055\u306e\u8b66\u544a\u3092\u3057\u3083\u3079\u3089\u305b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,3,11],"tags":[71,153],"class_list":["post-4216","post","type-post","status-publish","format-standard","hentry","category-debian","category-t-saitoh","category-computer","tag-icinga","tag-153"],"_links":{"self":[{"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/posts\/4216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/comments?post=4216"}],"version-history":[{"count":0,"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/posts\/4216\/revisions"}],"wp:attachment":[{"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/media?parent=4216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/categories?post=4216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tsaitoh.net\/wp\/wp-json\/wp\/v2\/tags?post=4216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}