{"id":2662,"date":"2018-06-28T10:21:33","date_gmt":"2018-06-28T15:21:33","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=2662"},"modified":"2018-06-28T10:21:33","modified_gmt":"2018-06-28T15:21:33","slug":"ntp-checks-with-icinga2","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2018\/06\/ntp-checks-with-icinga2\/","title":{"rendered":"NTP checks with icinga2"},"content":{"rendered":"<p>On my new Icinga2 monitoring host, I am slowly adding additional service checks to achieve parity with my existing Nagios monitoring. Next on my list, implementing NTP checks. The first step was to add a new service check to the Icinga2 configuration:<\/p>\n<p><strong><code>\/etc\/icinga2\/conf.d\/services.cfg:<\/code><\/strong><\/p>\n<pre><code>apply Service \"ntp_time\" {\r\n  import \"generic-service\"\r\n  check_command = \"ntp_time\"\r\n  assign where host.vars.os == \"Linux\"\r\n}<\/code><\/pre>\n<p>The service check produced an error, as seen in the icingaweb2 interface:<\/p>\n<pre><code>execvpe(\/usr\/lib64\/nagios\/plugins\/check_ntp_time) failed: No such file or directory<\/code><\/pre>\n<p>Oh! I don&#8217;t have the appropriate Nagios plugin installed on the Icinga2 host.<\/p>\n<pre><code>sudo yum install nagios-plugins-ntp<\/code><\/pre>\n<p>The NTP service check now reports OK on some hosts, but on other hosts I get a different error:<\/p>\n<pre><code>CRITICAL: No response from NTP server<\/code><\/pre>\n<p>The hosts that did not receive a response are all using chronyd. I edited <code>\/etc\/chrony.conf<\/code> and added:<\/p>\n<pre><code>allow 192.168.46.46<\/code><\/pre>\n<p>And restarted chronyd:<\/p>\n<pre><code>systemctl restart chronyd<\/code><\/pre>\n<p>Now all but one host reports OK. The last remaining host to show an error? The Icinga2 host itself!<\/p>\n<pre><code>allow 127.0.0.1<\/code><\/pre>\n<p>Another chronyd restart, and the NTP service on all hosts reports OK.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On my new Icinga2 monitoring host, I am slowly adding additional service checks to achieve parity with my existing Nagios monitoring. Next on my list, implementing NTP checks. The first step was to add a new service check to the Icinga2 configuration: \/etc\/icinga2\/conf.d\/services.cfg: apply Service &#8220;ntp_time&#8221; { import &#8220;generic-service&#8221; check_command = &#8220;ntp_time&#8221; assign where host.vars.os &hellip; <a href=\"https:\/\/osric.com\/chris\/accidental-developer\/2018\/06\/ntp-checks-with-icinga2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">NTP checks with icinga2<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[484],"tags":[495,348,416],"class_list":["post-2662","post","type-post","status-publish","format-standard","hentry","category-monitoring","tag-icinga2","tag-nagios","tag-nrpe"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=2662"}],"version-history":[{"count":5,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2662\/revisions"}],"predecessor-version":[{"id":2670,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2662\/revisions\/2670"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=2662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=2662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=2662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}