diff --git a/data/hostname/logstash0.internal.softwareheritage.org.yaml b/data/hostname/logstash0.internal.softwareheritage.org.yaml new file mode 100644 --- /dev/null +++ b/data/hostname/logstash0.internal.softwareheritage.org.yaml @@ -0,0 +1,2 @@ +icinga2::host::local_plugins: + - check_logstash_errors.sh diff --git a/site-modules/profile/files/icinga2/plugins/check_logstash_errors.sh b/site-modules/profile/files/icinga2/plugins/check_logstash_errors.sh --- a/site-modules/profile/files/icinga2/plugins/check_logstash_errors.sh +++ b/site-modules/profile/files/icinga2/plugins/check_logstash_errors.sh @@ -1,5 +1,31 @@ #!/bin/bash +# +# File managed by puppet. All modifications will be lost. +# +# Check if logstash encountered errors when sending messages +# to its output. +# +# Copyright (c) 2017 The Software Heritage Developers +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + CODE_CRITICAL=2 CODE_OK=0 diff --git a/site-modules/profile/manifests/icinga2/objects/common_checks.pp b/site-modules/profile/manifests/icinga2/objects/common_checks.pp --- a/site-modules/profile/manifests/icinga2/objects/common_checks.pp +++ b/site-modules/profile/manifests/icinga2/objects/common_checks.pp @@ -114,7 +114,7 @@ apply => true, check_command => 'check_logstash_errors.sh', command_endpoint => 'host.name', - assign => ['"check_logstash_errors.sh" in host.vars.plugins'], + assign => ['check_logstash_errors.sh in host.vars.plugins'], ignore => ['host.vars.noagent'], target => '/etc/icinga2/zones.d/global-templates/services.conf', } diff --git a/site-modules/profile/manifests/icinga2/objects/logstash_checks.pp b/site-modules/profile/manifests/icinga2/objects/logstash_checks.pp --- a/site-modules/profile/manifests/icinga2/objects/logstash_checks.pp +++ b/site-modules/profile/manifests/icinga2/objects/logstash_checks.pp @@ -16,7 +16,6 @@ require => File[$swh_plugin_dir] } - ::icinga2::object::checkcommand {$check_command: import => ['plugin-check-command'], command => $check_command_path, diff --git a/site-modules/profile/manifests/icinga2/objects/static_checks.pp b/site-modules/profile/manifests/icinga2/objects/static_checks.pp --- a/site-modules/profile/manifests/icinga2/objects/static_checks.pp +++ b/site-modules/profile/manifests/icinga2/objects/static_checks.pp @@ -74,12 +74,6 @@ target => $checks_file, } - ::icinga2::object::checkcommand {'check_logstash_errors.sh': - import => ['plugin-check-command'], - command => '/usr/lib/nagios/plugins/icinga_check_logstash.sh', - target => $checks_file, - } - ::icinga2::object::host {'DNS resolvers': check_command => 'dummy', address => '127.0.0.1',