b5b8ecadd3
Signed-off-by: Alexandre Beche <alexandre.beche@gmail.com>
71 lines
1.9 KiB
Text
71 lines
1.9 KiB
Text
/**
|
|
* WARNING: This Notification definition is automatically generated by Puppet.
|
|
* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN!
|
|
*/
|
|
|
|
/**
|
|
* A Notification definition. You can create your own configuration files
|
|
* in the conf.d directory (e.g. one per commnand). By default all *.conf
|
|
* files in this directory are included.
|
|
*
|
|
*/
|
|
|
|
object Notification "<%= @object_notificationname %>" {
|
|
<%#- If any of the @ parameters are undefined, don't print anything for them: -%>
|
|
<%- if @host_name -%>
|
|
|
|
host_name = "<%= @host_name -%>"
|
|
<%- end -%>
|
|
<%- if @service_name -%>
|
|
|
|
service_name = "<%= @service_name -%>"
|
|
<%- end -%>
|
|
<%- if @command -%>
|
|
|
|
command = "<%= @command -%>"
|
|
<%- end -%>
|
|
<%- if @vars.empty? != true -%>
|
|
|
|
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
|
<%= key %> = <% if value.class == String %><%= value %>
|
|
<%- else -%>{
|
|
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
|
<%= k %> = <%= v %>
|
|
<%- end -%>
|
|
}
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- if @users.empty? !=true -%>
|
|
|
|
users = [ <% @users.each_with_index do |usr, i| %>"<%= usr -%>"<%= ', ' if i < (@users.size - 1) %><% end %> ]
|
|
<%- end -%>
|
|
<%- if @user_groups.empty? !=true -%>
|
|
|
|
user_groups = [ <% @user_groups.each_with_index do |u_grp, i| %>"<%= u_grp -%>"<%= ', ' if i < (@user_groups.size - 1) %><% end %> ]
|
|
<%- end -%>
|
|
<%- if @times.empty? != true -%>
|
|
|
|
times = {
|
|
<%- @times.sort_by {|key, value| key}.each do |key, value| -%>
|
|
<%= key %> = <%= value %>
|
|
<%- end -%>
|
|
}
|
|
<%- end -%>
|
|
<%- if @interval -%>
|
|
|
|
interval = <%= @interval %>
|
|
<%- end -%>
|
|
<%- if @period -%>
|
|
|
|
period = <%= @period %>
|
|
<%- end -%>
|
|
<%- if @types.empty? !=true -%>
|
|
|
|
types = [ <% @types.each_with_index do |typ, i| %><%= typ -%><%= ', ' if i < (@types.size - 1) %><% end %> ]
|
|
<%- end -%>
|
|
<%- if @states.empty? !=true -%>
|
|
|
|
states = [ <% @states.each_with_index do |state, i| %><%= state -%><%= ', ' if i < (@states.size - 1) %><% end %> ]
|
|
<%- end -%>
|
|
}
|