Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved service definitions to site.pp

  • Loading branch information...
commit 2846327220b67d6b1a977c0d4d47271f834270ac 1 parent f2a53e7
@hsiponen hsiponen authored
Showing with 13 additions and 73 deletions.
  1. +13 −73 puppet/modules/nagios3/manifests/init.pp
View
86 puppet/modules/nagios3/manifests/init.pp
@@ -11,8 +11,8 @@
# $version = [ 'installed', 'latest' ]
# linuxhost (name,address)
# winhost (name,address)
-# myhost (name,group,address)
-# myservice (host,cmd,desc)
+# myhost (name,group,address,contactgr)
+# myservice (host,cmd,desc,contactgr)
# mygroup (group)
#
# === Examples
@@ -121,14 +121,6 @@
Nagios_hostgroup { require => Package['nagios3'], notify => Service['nagios3'], }
- nagios_hostgroup { 'linuxhosts':
- target => '/etc/nagios3/objects/nagios_hostgroup.cfg',
- }
-
- nagios_hostgroup { 'winhosts':
- target => '/etc/nagios3/objects/nagios_hostgroup.cfg',
- }
-
Nagios_service {
require => Package['nagios3'],
notify => Service['nagios3'],
@@ -136,60 +128,6 @@
use => 'generic-service'
}
- nagios_service { 'check_load':
- hostgroup_name => 'linuxhosts',
- check_command => 'check_nrpe_1arg!check_load',
- service_description => 'CPU Load',
- }
-
- nagios_service { 'check_users':
- hostgroup_name => 'linuxhosts',
- check_command => 'check_nrpe_1arg!check_users',
- service_description => 'Current Users',
- }
-
- nagios_service { 'check_total_procs':
- hostgroup_name => 'linuxhosts',
- check_command => "check_nrpe_1arg!check_total_procs",
- service_description => 'Total Processes',
- }
-
- nagios_service { 'check_hda1':
- hostgroup_name => 'linuxhosts',
- check_command => "check_nrpe_1arg!check_hda1",
- service_description => '/dev/hda1 Free Space',
- }
-
- nagios_service { 'check_zombie_procs':
- hostgroup_name => 'linuxhosts',
- check_command => "check_nrpe_1arg!check_zombie_procs",
- service_description => 'Zombie Processes',
- }
-
- nagios_service { 'check_win_up':
- hostgroup_name => 'winhosts',
- check_command => "check_nrpe!CheckUpTime!MaxWarn=3d MaxCrit=7d",
- service_description => 'Uptime',
- }
-
- nagios_service { 'check_disk_space':
- hostgroup_name => 'winhosts',
- check_command => "check_nt!USEDDISKSPACE!-l c -w 80 -c 90",
- service_description => 'C:\ Drive Space',
- }
-
- nagios_service { 'check_win_cpu':
- hostgroup_name => 'winhosts',
- check_command => "check_nrpe!CheckCPU!MaxWarn=80 MaxCrit=90 time=20m time=10s time=4",
- service_description => 'CPU load',
- }
-
- nagios_service { 'check_win_mem':
- hostgroup_name => 'winhosts',
- check_command => "check_nrpe!CheckMEM!MaxWarn=80% MaxCrit=90% ShowAll type=physical",
- service_description => 'Memory usage',
- }
-
file { '/etc/nagios3/conf.d/contacts_nagios2.cfg':
ensure => 'present',
source => 'puppet:///modules/nagios3/conf.d/contacts_nagios2.cfg',
@@ -227,20 +165,21 @@
}
}
-define myhost ($name,$group,$address) {
+define myhost ($name,$group,$address,$contactgr='admins') {
nagios_host { $title:
- target => '/etc/nagios3/objects/windows_hosts.cfg',
- use => 'windows-server',
- hostgroups => $group,
- alias => $name,
- address => $address,
- require => Package['nagios3'],
- notify => Service['nagios3'],
+ target => '/etc/nagios3/objects/windows_hosts.cfg',
+ use => 'windows-server',
+ hostgroups => $group,
+ alias => $name,
+ address => $address,
+ contact_groups => $contactgr,
+ require => Package['nagios3'],
+ notify => Service['nagios3'],
}
}
-define myservice ($host='',$group='',$cmd,$desc) {
+define myservice ($host='',$group='',$contactgr='admins',$cmd,$desc) {
nagios_service { $title:
target => '/etc/nagios3/objects/nagios_services.cfg',
@@ -249,6 +188,7 @@
hostgroup_name => $group,
check_command => $cmd,
service_description => $desc,
+ contact_groups => $contactgr,
require => Package['nagios3'],
notify => Service['nagios3'],
}
Please sign in to comment.
Something went wrong with that request. Please try again.