|
83 | 83 | description: |
84 | 84 | - Whether to process performance data provided by this object. |
85 | 85 | type: "bool" |
| 86 | + event_command: |
| 87 | + description: |
| 88 | + - Event command for service which gets called on every check execution if one of these conditions matches |
| 89 | + - The service is in a soft state |
| 90 | + - The service state changes into a hard state |
| 91 | + - The service state recovers from a soft or hard state to OK/Up |
| 92 | + type: "str" |
86 | 93 | groups: |
87 | 94 | description: |
88 | 95 | - Service groups that should be directly assigned to this service. |
|
155 | 162 | procs_warning: '1:' |
156 | 163 | notes: "example note" |
157 | 164 | notes_url: "'http://url1' 'http://url2'" |
| 165 | +
|
| 166 | +- name: Create servicetemplate with event command |
| 167 | + t_systems_mms.icinga_director.icinga_service_template: |
| 168 | + state: present |
| 169 | + url: "{{ icinga_url }}" |
| 170 | + url_username: "{{ icinga_user }}" |
| 171 | + url_password: "{{ icinga_pass }}" |
| 172 | + object_name: apache_check_servicetemplate |
| 173 | + use_agent: false |
| 174 | + event_command: restart_httpd |
| 175 | + notes: "example note" |
| 176 | + notes_url: "'http://url1' 'http://url2'" |
158 | 177 | """ |
159 | 178 |
|
160 | 179 | RETURN = r""" # """ |
@@ -187,6 +206,7 @@ def main(): |
187 | 206 | enable_notifications=dict(type="bool", required=False), |
188 | 207 | enable_passive_checks=dict(type="bool", required=False), |
189 | 208 | enable_perfdata=dict(type="bool", required=False), |
| 209 | + event_command=dict(type="str", required=False), |
190 | 210 | groups=dict(type="list", elements="str", default=[], required=False), |
191 | 211 | imports=dict(type="list", elements="str", default=[], required=False), |
192 | 212 | max_check_attempts=dict(required=False), |
@@ -216,6 +236,7 @@ def main(): |
216 | 236 | "enable_notifications": module.params["enable_notifications"], |
217 | 237 | "enable_passive_checks": module.params["enable_passive_checks"], |
218 | 238 | "enable_perfdata": module.params["enable_perfdata"], |
| 239 | + "event_command": module.params["event_command"], |
219 | 240 | "groups": module.params["groups"], |
220 | 241 | "imports": module.params["imports"], |
221 | 242 | "max_check_attempts": module.params["max_check_attempts"], |
|
0 commit comments