icingaweb2-module-director
icingaweb2-module-director copied to clipboard
[dev.icinga.com #11849] Allow configuring environment variables "env" for (notification) commands
This issue has been migrated from Redmine: https://dev.icinga.com/issues/11849
Created by tobiasvdk on 2016-05-26 10:20:00 +00:00
Assignee: (none) Status: New Target Version: (none) Last Update: 2017-01-17 05:16:11 +00:00 (in Redmine)
For notification commands you often need to configure the "env" attribute of a NotificationsCommand
Example:
object NotificationCommand "mail-service-notification" {
import "plugin-notification-command"
command = [
SysconfDir + "/icinga2/scripts/mail-notification.sh"
]
env = {
NOTIFICATIONTYPE = "$notification.type$"
SERVICEDESC = "$service.name$"
HOSTALIAS = "$host.display_name$"
HOSTADDRESS = "$address$"
SERVICESTATE = "$service.state$"
LONGDATETIME = "$icinga.long_date_time$"
SERVICEOUTPUT = "$service.output$"
NOTIFICATIONAUTHORNAME = "$notification.author$"
NOTIFICATIONCOMMENT = "$notification.comment$"
HOSTDISPLAYNAME = "$host.display_name$"
SERVICEDISPLAYNAME = "$service.display_name$"
USEREMAIL = "$user.email$"
}
}
Relations:
Updated by hashfunktion on 2016-07-12 13:45:06 +00:00
** That would be great
Updated by sebastianplattner on 2016-08-18 07:17:58 +00:00
** I upvote this
Updated by tgelf on 2016-08-24 14:18:23 +00:00
- Relates set to 11588
Updated by radovitsa on 2016-09-07 09:39:38 +00:00
+1
Updated by mfrosch on 2016-10-25 11:59:58 +00:00
- Subject changed from Make configuring the "env" attribute possible for notification commands to Allow configuraring environment variables "env" for (notification) commands
Updated by mfrosch on 2016-10-25 12:00:53 +00:00
- Subject changed from Allow configuraring environment variables "env" for (notification) commands to Allow configuring environment variables "env" for (notification) commands
Updated by tgelf on 2016-10-25 12:01:55 +00:00
- Relates set to 12028
Updated by tgelf on 2016-10-25 12:02:41 +00:00
- Blocked set to 12093
Updated by tgelf on 2016-10-25 12:06:26 +00:00
Guess once #12028 is implemented most people wouldn't even ask for this ;-) But sure, we need it. As it caused some extra-work in the GUI this depends on #12093, where the same tasks will be addressed.
Updated by dannyh on 2017-01-17 05:16:11 +00:00
**+ would be greate to have it
yes this would be nice to have
Please add ENV Support :-)
I believe this is still needed if you have to write custom notification scripts (which is my case). Please add ENV support :+1:
+1. I had to write to my own py scripts with arguments.
+1. This would be really helpful!
+1
+1
+1
++
need it asap(
+1
This is required for setting NAGIOS_PLUGIN_STATE_DIRECTORY
+1
+1
+1
I love how this has been open for 3 years and no response from the devs. I guess this is why I can't get pushbullet notifications to work with director.
i just remove icinga and happily use Prometheus =)
пн, 11 нояб. 2019 г. в 07:42, brando56894 [email protected]:
I love how this has been open for 3 years and no response from the devs. I guess this is why I can't get pushbullet notifications to work with director.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Icinga/icingaweb2-module-director/issues/256?email_source=notifications&email_token=AEFMORJ2YDSE2TRGNTKI4JLQTDWERA5CNFSM4C73L3JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDVXGAA#issuecomment-552301312, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFMORPT7QY7MX2MER4KN3LQTDWERANCNFSM4C73L3JA .
I also lacked that functionality. The check_memory command needed to be run with an environment variable. LC_ALL = "C".
+1
For check commands this has been implemented. It's described in the docs (https://icinga.com/docs/icinga-2/latest/doc/03-monitoring-basics/#environment-variables) and works. I haven't looked or tried it for notification commands. It may also work. As notification is in parentheses in the issues title it seems noteworthy to mention this working in check commands.