1/* Command objects */ 2 3/* Notification Commands 4 * 5 * Please check the documentation for all required and 6 * optional parameters. 7 */ 8 9object NotificationCommand "mail-host-notification" { 10 command = [ ConfigDir + "/scripts/mail-host-notification.sh" ] 11 12 arguments += { 13 "-4" = "$notification_address$" 14 "-6" = "$notification_address6$" 15 "-b" = "$notification_author$" 16 "-c" = "$notification_comment$" 17 "-d" = { 18 required = true 19 value = "$notification_date$" 20 } 21 "-f" = { 22 value = "$notification_from$" 23 description = "Set from address. Requires GNU mailutils (Debian/Ubuntu) or mailx (RHEL/SUSE)" 24 } 25 "-i" = "$notification_icingaweb2url$" 26 "-l" = { 27 required = true 28 value = "$notification_hostname$" 29 } 30 "-n" = { 31 required = true 32 value = "$notification_hostdisplayname$" 33 } 34 "-o" = { 35 required = true 36 value = "$notification_hostoutput$" 37 } 38 "-r" = { 39 required = true 40 value = "$notification_useremail$" 41 } 42 "-s" = { 43 required = true 44 value = "$notification_hoststate$" 45 } 46 "-t" = { 47 required = true 48 value = "$notification_type$" 49 } 50 "-v" = "$notification_logtosyslog$" 51 } 52 53 vars += { 54 notification_address = "$address$" 55 notification_address6 = "$address6$" 56 notification_author = "$notification.author$" 57 notification_comment = "$notification.comment$" 58 notification_type = "$notification.type$" 59 notification_date = "$icinga.long_date_time$" 60 notification_hostname = "$host.name$" 61 notification_hostdisplayname = "$host.display_name$" 62 notification_hostoutput = "$host.output$" 63 notification_hoststate = "$host.state$" 64 notification_useremail = "$user.email$" 65 } 66} 67 68object NotificationCommand "mail-service-notification" { 69 command = [ ConfigDir + "/scripts/mail-service-notification.sh" ] 70 71 arguments += { 72 "-4" = "$notification_address$" 73 "-6" = "$notification_address6$" 74 "-b" = "$notification_author$" 75 "-c" = "$notification_comment$" 76 "-d" = { 77 required = true 78 value = "$notification_date$" 79 } 80 "-e" = { 81 required = true 82 value = "$notification_servicename$" 83 } 84 "-f" = { 85 value = "$notification_from$" 86 description = "Set from address. Requires GNU mailutils (Debian/Ubuntu) or mailx (RHEL/SUSE)" 87 } 88 "-i" = "$notification_icingaweb2url$" 89 "-l" = { 90 required = true 91 value = "$notification_hostname$" 92 } 93 "-n" = { 94 required = true 95 value = "$notification_hostdisplayname$" 96 } 97 "-o" = { 98 required = true 99 value = "$notification_serviceoutput$" 100 } 101 "-r" = { 102 required = true 103 value = "$notification_useremail$" 104 } 105 "-s" = { 106 required = true 107 value = "$notification_servicestate$" 108 } 109 "-t" = { 110 required = true 111 value = "$notification_type$" 112 } 113 "-u" = { 114 required = true 115 value = "$notification_servicedisplayname$" 116 } 117 "-v" = "$notification_logtosyslog$" 118 } 119 120 vars += { 121 notification_address = "$address$" 122 notification_address6 = "$address6$" 123 notification_author = "$notification.author$" 124 notification_comment = "$notification.comment$" 125 notification_type = "$notification.type$" 126 notification_date = "$icinga.long_date_time$" 127 notification_hostname = "$host.name$" 128 notification_hostdisplayname = "$host.display_name$" 129 notification_servicename = "$service.name$" 130 notification_serviceoutput = "$service.output$" 131 notification_servicestate = "$service.state$" 132 notification_useremail = "$user.email$" 133 notification_servicedisplayname = "$service.display_name$" 134 } 135} 136 137/* 138 * If you prefer to use the notification scripts with environment 139 * variables instead of command line parameters, you can use 140 * the following commands. They have been updated from < 2.7 141 * to support the new notification scripts and should help 142 * with an upgrade. 143 * Remove the comment blocks and comment the notification commands above. 144 */ 145 146/* 147 148object NotificationCommand "mail-host-notification" { 149 command = [ ConfigDir + "/scripts/mail-host-notification.sh" ] 150 151 env = { 152 NOTIFICATIONTYPE = "$notification.type$" 153 HOSTDISPLAYNAME = "$host.display_name$" 154 HOSTNAME = "$host.name$" 155 HOSTADDRESS = "$address$" 156 HOSTSTATE = "$host.state$" 157 LONGDATETIME = "$icinga.long_date_time$" 158 HOSTOUTPUT = "$host.output$" 159 NOTIFICATIONAUTHORNAME = "$notification.author$" 160 NOTIFICATIONCOMMENT = "$notification.comment$" 161 HOSTDISPLAYNAME = "$host.display_name$" 162 USEREMAIL = "$user.email$" 163 } 164} 165 166object NotificationCommand "mail-service-notification" { 167 command = [ ConfigDir + "/scripts/mail-service-notification.sh" ] 168 169 env = { 170 NOTIFICATIONTYPE = "$notification.type$" 171 SERVICENAME = "$service.name$" 172 HOSTNAME = "$host.name$" 173 HOSTDISPLAYNAME = "$host.display_name$" 174 HOSTADDRESS = "$address$" 175 SERVICESTATE = "$service.state$" 176 LONGDATETIME = "$icinga.long_date_time$" 177 SERVICEOUTPUT = "$service.output$" 178 NOTIFICATIONAUTHORNAME = "$notification.author$" 179 NOTIFICATIONCOMMENT = "$notification.comment$" 180 HOSTDISPLAYNAME = "$host.display_name$" 181 SERVICEDISPLAYNAME = "$service.display_name$" 182 USEREMAIL = "$user.email$" 183 } 184} 185 186*/ 187 188