Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
412 stars 201 forks source link

[dev.icinga.com #11849] Allow configuring environment variables "env" for (notification) commands #256

Open icinga-migration opened 8 years ago

icinga-migration commented 8 years ago

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:

icinga-migration commented 8 years ago

Updated by hashfunktion on 2016-07-12 13:45:06 +00:00

** That would be great

icinga-migration commented 8 years ago

Updated by sebastianplattner on 2016-08-18 07:17:58 +00:00

** I upvote this

icinga-migration commented 8 years ago

Updated by tgelf on 2016-08-24 14:18:23 +00:00

icinga-migration commented 8 years ago

Updated by radovitsa on 2016-09-07 09:39:38 +00:00

+1

icinga-migration commented 7 years ago

Updated by mfrosch on 2016-10-25 11:59:58 +00:00

icinga-migration commented 7 years ago

Updated by mfrosch on 2016-10-25 12:00:53 +00:00

icinga-migration commented 7 years ago

Updated by tgelf on 2016-10-25 12:01:55 +00:00

icinga-migration commented 7 years ago

Updated by tgelf on 2016-10-25 12:02:41 +00:00

icinga-migration commented 7 years ago

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.

icinga-migration commented 7 years ago

Updated by dannyh on 2017-01-17 05:16:11 +00:00

**+ would be greate to have it

cristian-ciobanu commented 7 years ago

yes this would be nice to have

hermann1514 commented 7 years ago

Please add ENV Support :-)

rodrigohdez1 commented 7 years ago

I believe this is still needed if you have to write custom notification scripts (which is my case). Please add ENV support :+1:

ktella commented 7 years ago

+1. I had to write to my own py scripts with arguments.

noudAndi commented 7 years ago

+1. This would be really helpful!

chas0rde commented 7 years ago

+1

maraev commented 6 years ago

+1

druchoo commented 6 years ago

+1

Spikelite commented 5 years ago

++

Alexvianet commented 5 years ago

need it asap(

alex1702 commented 5 years ago

+1

oakwhiz commented 5 years ago

This is required for setting NAGIOS_PLUGIN_STATE_DIRECTORY

pkalytta commented 5 years ago

+1

firatalkis commented 5 years ago

+1

inmediasit commented 5 years ago

+1

brando56894 commented 4 years ago

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.

Alexvianet commented 4 years ago

i just remove icinga and happily use Prometheus =)

пн, 11 нояб. 2019 г. в 07:42, brando56894 notifications@github.com:

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 .

slackluis commented 4 years ago

I also lacked that functionality. The check_memory command needed to be run with an environment variable. LC_ALL = "C".

majales commented 4 years ago

+1

c-holtermann commented 3 years ago

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.

elendis commented 8 months ago

As fas as I can tell this is still open. Any comments on if and when this will be adressed?