Skip to content

Instantly share code, notes, and snippets.

@sts
Created December 2, 2013 18:55
Show Gist options
  • Select an option

  • Save sts/7754883 to your computer and use it in GitHub Desktop.

Select an option

Save sts/7754883 to your computer and use it in GitHub Desktop.
checkmk::plugin
# Definition: checkmk::plugin
#
# Install a check_mk agent plugin on machine into the directroy:
# /usr/lib/check-mk-agent/plugins/
#
# Usage:
#
# The following will source the check-mk-agent plugin called 'puppet' from the
# puppet module puppet: puppet:///modules/puppet/checkmk/agent.plugin
#
# class puppet::server {
# checkmk::plugin { "agent": }
# }
#
# Here is a more complex example, with a manually specified plugin source.
#
# checkmk::plugin { "memcachedng":
# source => "pupppet:///modules/memcached/memcachedng.sh"
# }
#
define checkmk::plugin($source = "puppet:///modules/${caller_module_name}/checkmk/${name}.plugin", $ensure = 'present') {
$plugin = "/usr/lib/check_mk_agent/plugins/${name}"
file { $plugin:
ensure => $ensure,
owner => 'root',
group => 'root',
mode => '0755',
source => $source,
require => Class["checkmk::agent"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment