Page MenuHomeSoftware Heritage

agent_checks: Install check_systemd plugin and command
ClosedPublic

Authored by ardumont on Aug 24 2021, 10:43 AM.

Details

Summary

Install only the command, not the alert yet.

Related to T3497

Test Plan

octo-diff:

$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging pergamon
Found host pergamon.softwareheritage.org
...
*******************************************
+ Concat::Fragment[icinga2::object::CheckCommand::check_systemd] =>
   parameters =>
      "order": 15
      "target": "/etc/icinga2/conf.d/swh-plugins.conf"
      "content": >>>

object CheckCommand "check_systemd" {
  import "plugin-check-command"

  command = "/usr/lib/nagios/plugins/check_systemd"
  arguments = {
    "--unit" = {
      value = "$check_systemd_unit$"
      description = "Name of the systemd unit that is being tested."
    }
  }
}
<<<
*******************************************
+ Concat_fragment[icinga2::object::CheckCommand::check_systemd] =>
   parameters =>
      "order": 15
      "tag": "_etc_icinga2_conf.d_swh-plugins.conf"
      "target": "/etc/icinga2/conf.d/swh-plugins.conf"
      "content": >>>

object CheckCommand "check_systemd" {
  import "plugin-check-command"

  command = "/usr/lib/nagios/plugins/check_systemd"
  arguments = {
    "--unit" = {
      value = "$check_systemd_unit$"
      description = "Name of the systemd unit that is being tested."
    }
  }
}
<<<
...
+ Icinga2::Object::Checkcommand[check_systemd] =>
   parameters =>
      "arguments": {"--unit"=>{"value"=>"$check_systemd_unit$", "description"=>"Name of the systemd unit that is being tested."}}
      "checkcommand_name": "check_systemd"
      "command": "/usr/lib/nagios/plugins/check_systemd"
      "ensure": "present"
      "import": ["plugin-check-command"]
      "order": 15
      "target": "/etc/icinga2/conf.d/swh-plugins.conf"
      "template": false
*******************************************
+ Icinga2::Object[icinga2::object::CheckCommand::check_systemd] =>
   parameters =>
      "apply": false
      "assign": []
      "attrs": {"command"=>"/usr/lib/nagios/plugins/check_systemd", "arguments"=>{"--unit"=>{"value"=>"$check_systemd_unit$", "description"=>"Name of the systemd unit that is being tested."}}}
      "attrs_list": ["command", "env", "timeout", "arguments", "vars", "Acknowledgement", "ApiBindHost", "ApiBindPort", "ApiEnvironment", "ApplicationType", "AttachDebugger", "BuildCompilerName", "BuildCompilerVersion", "BuildHostName", "Concurrency", "Critical", "Custom", "Deprecated", "Down", "DowntimeEnd", "DowntimeRemoved", "DowntimeStart", "Environment", "FlappingEnd", "FlappingStart", "HostDown", "HostUp", "IncludeConfDir", "Internal", "Json", "LocalStateDir", "LogCritical", "LogDebug", "LogInformation", "LogNotice", "LogWarning", "Math", "MaxConcurrentChecks", "ModAttrPath", "NodeName", "OK", "ObjectsPath", "PidPath", "PkgDataDir", "PlatformArchitecture", "PlatformKernel", "PlatformKernelVersion", "PlatformName", "PlatformVersion", "PrefixDir", "Problem", "Recovery", "RunAsGroup", "RunAsUser", "RunDir", "ServiceCritical", "ServiceOK", "ServiceUnknown", "ServiceWarning", "StatePath", "SysconfDir", "System", "Types", "Unknown", "Up", "UseVfork", "VarsPath", "Warning", "ZonesDir", "NodeName", "ZoneName", "TicketSalt", "PluginDir", "PluginContribDir", "ManubulonPluginDir", "name", "NodeName", "ZoneName", "TicketSalt", "PluginDir", "PluginContribDir", "ManubulonPluginDir", "name"]
      "ensure": "present"
      "ignore": []
      "import": ["plugin-check-command"]
      "object_name": "check_systemd"
      "object_type": "CheckCommand"
      "order": 15
      "prefix": false
      "target": "/etc/icinga2/conf.d/swh-plugins.conf"
      "template": false
*******************************************
+ Package[monitoring-plugins-systemd] =>
   parameters =>
      "ensure": "present"
*******************************************
*** End octocatalog-diff on pergamon.softwareheritage.org

Diff Detail

Repository
rSPSITE puppet-swh-site
Branch
staging
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23131
Build 36078: arc lint + arc unit

Event Timeline

ardumont created this revision.
ardumont retitled this revision from agent_checks: Install check_systemd plugin to agent_checks: Install check_systemd plugin and command.Aug 24 2021, 10:45 AM
vsellier added subscribers: olasd, vsellier.

LGTM (double checked with @olasd ;) )

This revision is now accepted and ready to land.Aug 24 2021, 10:58 AM

Fix $command must be an array of strings and not a plain string.

Landed through ad85a394 (forgot to update the diff apparently).