Added prowl contact define for nagios
This commit is contained in:
parent
0f4bbae2e9
commit
684c1c4474
2 changed files with 33 additions and 0 deletions
|
@ -245,3 +245,12 @@ define command{
|
|||
}
|
||||
|
||||
|
||||
define command{
|
||||
command_name notify-host-by-prowl
|
||||
command_line /usr/bin/curl -s -o /dev/null -F apikey="$CONTACTADDRESS1$" -F application="Nagios" -F event="Host Alert" -F description="$HOSTNAME$ $HOSTDESC$ '$HOSTOUTPUT$'" "https://prowl.weks.net/publicapi/add"
|
||||
}
|
||||
|
||||
define command{
|
||||
command_name notify-service-by-prowl
|
||||
command_line /usr/bin/curl -s -o /dev/null -F apikey="$CONTACTADDRESS1$" -F application="Nagios" -F event="Service Alert" -F description="$HOSTNAME$ $SERVICEDESC$ '$SERVICEOUTPUT$'" "https://prowl.weks.net/publicapi/add"
|
||||
}
|
||||
|
|
|
@ -243,6 +243,30 @@ define nagios::contact::email($confdir=$nagios::server::confdir) {
|
|||
}
|
||||
|
||||
|
||||
define nagios::contact::prowl($confdir=$nagios::server::confdir) {
|
||||
|
||||
file { "${confdir}/contact_${name}.cfg":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
before => Nagios_Contact[$name],
|
||||
}
|
||||
nagios_contact { $name:
|
||||
target => "${confdir}/contact_${name}.cfg",
|
||||
host_notification_commands => "notify-host-by-prowl",
|
||||
host_notification_options => "d,r",
|
||||
host_notification_period => "24x7",
|
||||
service_notification_commands => "notify-service-by-prowl",
|
||||
service_notification_options => "w,u,c,r",
|
||||
service_notification_period => "24x7",
|
||||
address1 => $name,
|
||||
notify => Service["nagios"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
define nagios::host($confdir, $operatingsystem) {
|
||||
|
||||
file { "${confdir}/host_${name}.cfg":
|
||||
|
|
Loading…
Add table
Reference in a new issue