Added default checks and thresholds for NRPE

These probably need further tuning.
This commit is contained in:
Ossi Salmi 2012-12-03 01:49:02 +02:00
parent 29c6eb5b4d
commit c370df8db2

View file

@ -87,9 +87,7 @@ class nagios::target::nrpe inherits nagios::target {
"nagios-plugins-procs", "nagios-plugins-procs",
"nagios-plugins-users", ]: "nagios-plugins-users", ]:
ensure => installed, ensure => installed,
before => [ File["/etc/nrpe.d"], before => [ File["/etc/nrpe.d"], Service["nrpe"] ],
Augeas["nrpe-allow"],
Service["nrpe"], ],
} }
} }
"ubuntu","debian": { "ubuntu","debian": {
@ -98,9 +96,7 @@ class nagios::target::nrpe inherits nagios::target {
package { [ "nagios-nrpe-server", package { [ "nagios-nrpe-server",
"nagios-plugins-basic", ]: "nagios-plugins-basic", ]:
ensure => installed, ensure => installed,
before => [ File["/etc/nrpe.d"], before => [ File["/etc/nrpe.d"], Service["nrpe"] ],
Augeas["nrpe-allow"],
Service["nrpe"], ],
} }
} }
} }
@ -122,9 +118,13 @@ class nagios::target::nrpe inherits nagios::target {
enable => true, enable => true,
} }
augeas { "nrpe-allow": file { "${nrpedir}/allowed_hosts.cfg":
context => "/files/etc/nagios/nrpe.cfg", ensure => present,
changes => "set allowed_hosts '${nagios_allow}'", mode => "0644",
owner => "root",
group => "root",
content => "allowed_hosts=${nagios_allow}\n",
require => File["/etc/nrpe.d"],
notify => Service["nrpe"], notify => Service["nrpe"],
} }
@ -133,7 +133,7 @@ class nagios::target::nrpe inherits nagios::target {
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => "root", group => "root",
content => "command[check_disk] = ${nagios::common::libdir}/check_disk -c 10% -w 20% -p /\n", content => "command[check_disk]=${nagios::common::libdir}/check_disk -w 20% -c 10% -p /\n",
require => File["/etc/nrpe.d"], require => File["/etc/nrpe.d"],
notify => Service["nrpe"], notify => Service["nrpe"],
} }
@ -142,19 +142,42 @@ class nagios::target::nrpe inherits nagios::target {
description => "Disk", description => "Disk",
} }
file { "${nrpedir}/check_load.cfg":
ensure => present,
mode => "0644",
owner => "root",
group => "root",
content => "command[check_load]=${nagios::common::libdir}/check_load -r -w 3,2,1 -c 6,4,2\n",
require => File["/etc/nrpe.d"],
notify => Service["nrpe"],
}
@@nagios::service { "${fqdn}_load": @@nagios::service { "${fqdn}_load":
command => "check_nrpe!check_load", command => "check_nrpe!check_load",
description => "Load", description => "Load",
} }
@@nagios::service { "${fqdn}_users": file { "${nrpedir}/check_swap.cfg":
command => "check_nrpe!check_users", ensure => present,
description => "Users", mode => "0644",
owner => "root",
group => "root",
content => "command[check_swap]=${nagios::common::libdir}/check_swap -w 75% -c 50%\n",
require => File["/etc/nrpe.d"],
notify => Service["nrpe"],
}
@@nagios::service { "${fqdn}_swap":
command => "check_nrpe!check_swap",
description => "Swap",
} }
@@nagios::service { "${fqdn}_procs": # @@nagios::service { "${fqdn}_users":
command => "check_nrpe!check_total_procs", # command => "check_nrpe!check_users",
description => "Processes", # description => "Users",
} # }
#
# @@nagios::service { "${fqdn}_procs":
# command => "check_nrpe!check_total_procs",
# description => "Processes",
# }
} }