Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
icinga-migration opened this issue May 26, 2016 · 31 comments

Comments

@icinga-migration
Copy link

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
Copy link
Author

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

** That would be great

@icinga-migration
Copy link
Author

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

** I upvote this

@icinga-migration
Copy link
Author

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

  • Relates set to 11588

@icinga-migration
Copy link
Author

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

+1

@icinga-migration
Copy link
Author

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

@icinga-migration
Copy link
Author

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

@icinga-migration
Copy link
Author

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

  • Relates set to 12028

@icinga-migration
Copy link
Author

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

  • Blocked set to 12093

@icinga-migration
Copy link
Author

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
Copy link
Author

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

**+ would be greate to have it

@cristian-ciobanu
Copy link

yes this would be nice to have

@hermann1514
Copy link

Please add ENV Support :-)

@rodrigohdez1
Copy link

rodrigohdez1 commented Mar 22, 2017

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

@ktella
Copy link

ktella commented Mar 22, 2017

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

@noudAndi
Copy link

+1. This would be really helpful!

@chas0rde
Copy link

+1

2 similar comments
@maraev
Copy link

maraev commented Oct 6, 2017

+1

@druchoo
Copy link

druchoo commented Dec 9, 2017

+1

@Spikelite
Copy link

++

@Alexvianet
Copy link

need it asap(

@alex1702
Copy link

+1

@oakwhiz
Copy link

oakwhiz commented Mar 11, 2019

This is required for setting NAGIOS_PLUGIN_STATE_DIRECTORY

@pkalytta
Copy link

+1

2 similar comments
@firatalkis
Copy link

+1

@inmediasit
Copy link

+1

@brando56894
Copy link

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
Copy link

Alexvianet commented Nov 11, 2019 via email

@slackluis
Copy link

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

@majales
Copy link

majales commented Jun 19, 2020

+1

@c-holtermann
Copy link

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
Copy link

elendis commented Jan 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests