nagios: Added support for nagios::target::nrpe to OpenBSD.
This commit is contained in:
parent
87f9e8995d
commit
999d0e588f
2 changed files with 43 additions and 5 deletions
|
@ -33,6 +33,10 @@ class nagios::common {
|
||||||
$cgibin = "/usr/lib/cgi-bin/nagios3"
|
$cgibin = "/usr/lib/cgi-bin/nagios3"
|
||||||
$htdocs = "/usr/share/nagios3/htdocs"
|
$htdocs = "/usr/share/nagios3/htdocs"
|
||||||
}
|
}
|
||||||
|
"openbsd": {
|
||||||
|
# no params set as we don't support server on openbsd yet
|
||||||
|
$libdir = "/usr/local/libexec/nagios"
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Nagios not supported on ${::operatingsystem}")
|
fail("Nagios not supported on ${::operatingsystem}")
|
||||||
}
|
}
|
||||||
|
@ -67,6 +71,9 @@ class nagios::server::manual inherits nagios::common {
|
||||||
target => "/etc/nagios3/stylesheets",
|
target => "/etc/nagios3/stylesheets",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
fail("nagios::server not supported in ${::operatingsystem}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "usermod-nagios-httpsd":
|
exec { "usermod-nagios-httpsd":
|
||||||
|
|
|
@ -115,13 +115,32 @@ class nagios::target::nrpe inherits nagios::target {
|
||||||
before => [ File["/etc/nrpe.d"], Service["nrpe"] ],
|
before => [ File["/etc/nrpe.d"], Service["nrpe"] ],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"openbsd": {
|
||||||
|
$service = "nrpe"
|
||||||
|
$nrpedir = "/etc/nrpe.d"
|
||||||
|
package { "nrpe":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
exec { "add-nrpe-include-dir":
|
||||||
|
command => "echo 'include_dir=${nrpedir}/' >> /etc/nrpe.cfg",
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
user => "root",
|
||||||
|
unless => "egrep '^include_dir=/etc/${nrpedir}/' /etc/nrpe.cfg",
|
||||||
|
require => Package["nrpe"],
|
||||||
|
notify => Service[$service],
|
||||||
|
before => File[$nrpedir],
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/nrpe.d":
|
file { "/etc/nrpe.d":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
purge => true,
|
purge => true,
|
||||||
force => true,
|
force => true,
|
||||||
recurse => true,
|
recurse => true,
|
||||||
|
@ -138,7 +157,10 @@ class nagios::target::nrpe inherits nagios::target {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
content => "allowed_hosts=${nagios_allow}\n",
|
content => "allowed_hosts=${nagios_allow}\n",
|
||||||
require => File["/etc/nrpe.d"],
|
require => File["/etc/nrpe.d"],
|
||||||
notify => Service["nrpe"],
|
notify => Service["nrpe"],
|
||||||
|
@ -148,7 +170,10 @@ class nagios::target::nrpe inherits nagios::target {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
content => "command[check_disk]=${nagios::common::libdir}/check_disk -w 20% -c 10% -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"],
|
||||||
|
@ -162,7 +187,10 @@ class nagios::target::nrpe inherits nagios::target {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
content => "command[check_load]=${nagios::common::libdir}/check_load -r -w 3,2,1 -c 6,4,2\n",
|
content => "command[check_load]=${nagios::common::libdir}/check_load -r -w 3,2,1 -c 6,4,2\n",
|
||||||
require => File["/etc/nrpe.d"],
|
require => File["/etc/nrpe.d"],
|
||||||
notify => Service["nrpe"],
|
notify => Service["nrpe"],
|
||||||
|
@ -176,7 +204,10 @@ class nagios::target::nrpe inherits nagios::target {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
content => "command[check_swap]=${nagios::common::libdir}/check_swap -w 75% -c 50%\n",
|
content => "command[check_swap]=${nagios::common::libdir}/check_swap -w 75% -c 50%\n",
|
||||||
require => File["/etc/nrpe.d"],
|
require => File["/etc/nrpe.d"],
|
||||||
notify => Service["nrpe"],
|
notify => Service["nrpe"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue