Skip to content

Commit

Permalink
Merge pull request #27 from karolisc/master
Browse files Browse the repository at this point in the history
Add support for low level discovery(LLD) scripts
  • Loading branch information
Werner Dijkerman committed Dec 12, 2014
2 parents aad6a7f + 60c624d commit b0b3336
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ zabbix::userparameters { 'mysql':
}
```

Using an [LLD](https://www.zabbix.com/documentation/2.4/manual/discovery/low_level_discovery) 'script' file:

```ruby
zabbix::userparameters { 'lld_snort.sh':
script => 'puppet:///modules/zabbix/lld_snort.sh',
}
```

When you are using Hiera or The Foreman, you can use it like this:
```yaml
zabbix::userparameter::data:
Expand Down Expand Up @@ -213,6 +221,7 @@ There are some zabbix specific parameters, please check them by opening the mani

* `source`: File which holds several userparameter entries.
* `content`: When you have 1 userparameter entry which you want to install.
* `script`: Low level discovery (LLD) script.
* `template`: When you use exported resources (when manage_resources on other components is set to true) you'll can add the name of the template which correspondents with the 'content' or 'source' which you add. The template will be added to the host.

##limitations
Expand Down
14 changes: 14 additions & 0 deletions manifests/userparameters.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# [*content*]
# When you have 1 userparameter entry which you want to install.
#
# [*script*]
# Low level discovery (LLD) script.
#
# [*template*]
# When you use exported resources (when manage_resources is set to true on other components)
# you'll can add the name of the template which correspondents with the 'content' or
Expand Down Expand Up @@ -45,6 +48,7 @@
define zabbix::userparameters (
$source = '',
$content = '',
$script = '',
$template = '',
) {
$include_dir = $zabbix::agent::include_dir
Expand All @@ -69,6 +73,16 @@
}
}

if $script != '' {
file { "/usr/bin/${name}":
ensure => present,
owner => 'zabbix',
group => 'zabbix',
mode => '0755',
source => $script,
}
}

# If template is defined, it means we have an template in zabbix
# which needs to be loaded for this host. When exported resources is
# used/enabled, we do this automatically.
Expand Down

0 comments on commit b0b3336

Please sign in to comment.