Puppet Class: zabbix::resources::agent

Defined in:
manifests/resources/agent.pp

Summary

This will create resources into puppetdb for automatically configuring agent into zabbix front-end.

Overview

Parameters:

  • hostname (Any) (defaults to: undef)

    Hostname of the machine

  • ipaddress (Any) (defaults to: undef)

    The IP address of the machine running zabbix agent.

  • use_ip (Any) (defaults to: undef)

    Use ipadress instead of dns to connect.

  • port (Any) (defaults to: undef)

    The port that the zabbix agent is listening on.

  • group (Any) (defaults to: undef)

    Deprecated (see groups parameter) Name of the hostgroup.

  • groups (Array[String[1]]) (defaults to: undef)

    An array of groups the host belongs to.

  • group_create (Any) (defaults to: undef)

    Whether to create hostgroup if missing.

  • templates (Any) (defaults to: undef)

    List of templates which should be attached to this host.

  • macros (Any) (defaults to: undef)

    Array of hashes (macros) which should be attached to this host.

  • proxy (Any) (defaults to: undef)

    Whether it is monitored by an proxy or not.

  • interfacetype (Any) (defaults to: 1)

    Internally used identifier for the host interface.

  • interfacedetails (Variant[Array, Hash]) (defaults to: [])

    Hash with interface details for SNMP when interface type is 2.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'manifests/resources/agent.pp', line 14

class zabbix::resources::agent (
  $hostname                           = undef,
  $ipaddress                          = undef,
  $use_ip                             = undef,
  $port                               = undef,
  $group                              = undef,
  Array[String[1]] $groups            = undef,
  $group_create                       = undef,
  $templates                          = undef,
  $macros                             = undef,
  $proxy                              = undef,
  $interfacetype                      = 1,
  Variant[Array, Hash] $interfacedetails = [],
) {
  if $group and $groups {
    fail("Got group and groups. This isn't support! Please use groups only.")
  } else {
    if $group {
      warning('Passing group to zabbix::resources::agent is deprecated and will be removed. Use groups instead.')
      $_groups = Array($group)
    } else {
      $_groups = $groups
    }
  }

  @@zabbix_host { $hostname:
    ipaddress        => $ipaddress,
    use_ip           => $use_ip,
    port             => $port,
    groups           => $_groups,
    group_create     => $group_create,
    templates        => $templates,
    macros           => $macros,
    proxy            => $proxy,
    interfacetype    => $interfacetype,
    interfacedetails => $interfacedetails,
  }
}