Puppet Class: zabbix::zapache

Inherits:
zabbix::params
Defined in:
manifests/zapache.pp

Overview

Check if apache_status is true, installs Zapache scripts. Defaults to false.

Parameters:

  • apache_status (Any) (defaults to: $zabbix::params::apache_status)


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'manifests/zapache.pp', line 46

class zabbix::zapache (
  $apache_status         = $zabbix::params::apache_status,
  ) inherits zabbix::params {
  # Check if apache_status is boolean
  validate_bool($apache_status)

  if $apache_status {
    file { [ '/var/lib/zabbixsrv/','/var/lib/zabbixsrv/externalscripts/']:
      ensure => directory,
      owner  => 'root',
      group  => 'root',
      mode   => '0755',
    }
    file { '/var/lib/zabbixsrv/externalscripts/zapache':
      ensure => present,
      source => 'puppet:///modules/zabbix/zapache/zapache',
      owner  => 'root',
      group  => 'root',
      mode   => '0755',
    }
    file { '/etc/zabbix/zabbix_agentd.d/userparameter_zapache.conf':
      ensure  => present,
      source  => 'puppet:///modules/zabbix/zapache/userparameter_zapache.conf.sample',
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      require => Package['zabbix-agent'],
      notify  => Service['zabbix-agent'],
    }
    file { '/etc/httpd/conf.d/httpd-server-status.conf':
      ensure  => present,
      source  => 'puppet:///modules/zabbix/zapache/httpd-server-status.conf.sample',
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      require => [ Package['zabbix-agent'],Package['httpd'] ],
      notify  => Service['httpd'],
    }
  }
}