nagios: Added support for Pushover notifications
This commit is contained in:
parent
c8a2ff7436
commit
313d847e6a
2 changed files with 59 additions and 4 deletions
|
@ -341,16 +341,16 @@ define nagios::contact::prowl($group=["all"],
|
|||
|
||||
$contactgroups = inline_template('<%= group.join(",") -%>')
|
||||
|
||||
file { "${confdir}/contact_${name}.cfg":
|
||||
file { "${confdir}/contact_prowl_${name}.cfg":
|
||||
ensure => present,
|
||||
mode => "0640",
|
||||
owner => "root",
|
||||
group => "nagios",
|
||||
before => Nagios_Contact[$name],
|
||||
before => Nagios_Contact["prowl-${name}"],
|
||||
require => File["/etc/nagios/conf.d"],
|
||||
}
|
||||
nagios_contact { $name:
|
||||
target => "${confdir}/contact_${name}.cfg",
|
||||
nagios_contact { "prowl-${name}":
|
||||
target => "${confdir}/contact_prowl_${name}.cfg",
|
||||
contactgroups => $contactgroups,
|
||||
host_notification_commands => "notify-host-by-prowl",
|
||||
host_notification_options => "d,r",
|
||||
|
@ -365,6 +365,47 @@ define nagios::contact::prowl($group=["all"],
|
|||
}
|
||||
|
||||
|
||||
# Define nagios pushover contact.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# Pushover user key.
|
||||
# $token:
|
||||
# Pushover application token.
|
||||
# $group:
|
||||
# List of contact groups. Defaults to "all".
|
||||
#
|
||||
define nagios::contact::pushover($token, $group=["all"],
|
||||
$confdir=$nagios::common::confdir) {
|
||||
|
||||
$contactgroups = inline_template('<%= group.join(",") -%>')
|
||||
|
||||
file { "${confdir}/contact_pushover_${name}.cfg":
|
||||
ensure => present,
|
||||
mode => "0640",
|
||||
owner => "root",
|
||||
group => "nagios",
|
||||
before => Nagios_Contact["pushover-${name}"],
|
||||
require => File["/etc/nagios/conf.d"],
|
||||
}
|
||||
nagios_contact { "pushover-${name}":
|
||||
target => "${confdir}/contact_pushover_${name}.cfg",
|
||||
contactgroups => $contactgroups,
|
||||
host_notification_commands => "notify-host-by-pushover",
|
||||
host_notification_options => "d,r",
|
||||
host_notification_period => "24x7",
|
||||
service_notification_commands => "notify-service-by-pushover",
|
||||
service_notification_options => "w,u,c,r",
|
||||
service_notification_period => "24x7",
|
||||
address1 => $name,
|
||||
address2 => $token,
|
||||
notify => Service["nagios"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Define nagios target host.
|
||||
#
|
||||
# === Parameters
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue