Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

$ADMINEMAIL$ not populated on notification command #484

Closed
angeleseros opened this issue Apr 14, 2021 · 8 comments
Closed

$ADMINEMAIL$ not populated on notification command #484

angeleseros opened this issue Apr 14, 2021 · 8 comments
Labels

Comments

@angeleseros
Copy link

We recently upgraded our centreon to v20.10 and I have a notification command as follows:

define command {
command_name host-notify-by-email-html-v2
command_line /bin/sh -c '/usr/lib/centreon/custom/bash/notification_via_sendmail_html Date="$DATE$" Time="$TIME$" NotificationType="$NOTIFICATIONTYPE$" Host="$HOSTNAME$" Alias="$HOSTALIAS$" Address="$HOSTADDRESS$" ID="$HOSTPROBLEMID$" PREVID="$LASTHOSTPROBLEMID$" State="$HOSTSTATE$" AdditionalInfo="$HOSTOUTPUT$
[$HOSTACKAUTHOR$]: $HOSTACKCOMMENT$" To="$CONTACTEMAIL$" From=" $ADMINEMAIL$" Subject="** Host $HOSTSTATE$ alert for $HOSTNAME$ **" LOGFILE="/var/log/centreon-engine/host_notification_via_sendmail.log"'
}

the /usr/lib/centreon/custom/bash/notification_via_sendmail_html is a custom script that formats the values to HTML.

the $ADMINEMAIL$ is no longer being passed down

is the $ADMINEMAIL$ been changed to other macro? Thanks

@omercier
Copy link
Contributor

omercier commented May 3, 2021

Hi @angeleseros,
Please can you tell me from which version of Centreon you upgraded to 20.10?
I will then try to investigate about it.
Thanks!

@angeleseros
Copy link
Author

From version 18.10

@angeleseros
Copy link
Author

Additional Info:

Alert Macros $HOSTACKAUTHOR$, $HOSTACKCOMMENT$, $SERVICEACKAUTHOR$, and $SERVICEACKCOMMENT$ seems to be empty as well when doing acknowledgements.

@angeleseros
Copy link
Author

I have tested on a newly installed centreon 20.10.7 with the following notification command:

/usr/bin/printf "%b" "***** centreon Notification ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATE$ Additional Info : $SERVICEOUTPUT$\nACK Author: $SERVICEACKAUTHOR$\nACK Comment: $SERVICEACKCOMMENT$\nAdmin Email Address: $ADMINPAGER$ <$ADMINEMAIL$>" | @mailer@ -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

and did an acknowledgement of a dummy service on critical and received the following:

***** centreon Notification *****

Notification Type: ACKNOWLEDGEMENT

Service: generic-dummy-service-custom
Host: generic-dummy-host
Address: 1.1.1.1
State: CRITICAL

Date/Time: 2021-05-17 Additional Info : CRITICAL: Dummy Service
ACK Author:
ACK Comment:
Admin Email Address: <>

@omercier
Copy link
Contributor

Hi @angeleseros,
Thanks for your feedback.
The bug is identified and reproduced.
We will fix it soon.
Internal reference: MON-11761

@omercier
Copy link
Contributor

omercier commented Nov 22, 2021

Regarding these macros

$HOSTACKAUTHOR$, $HOSTACKCOMMENT$, $SERVICEACKAUTHOR$, and $SERVICEACKCOMMENT$

They are deprecated.
Use the more generic $NOTIFICATIONAUTHOR$, $NOTIFICATIONAUTHORNAME$, $NOTIFICATIONAUTHORALIAS$ or $NOTIFICATIONCOMMENT$ macros instead. (cf. https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macrolist.html#note8)

@joschi99
Copy link

Hi @omercier,
we have still the same issue with empty marco $ADMINEMAIL$ on version 22.04.

Any information regarding this?

@omercier
Copy link
Contributor

Hi Jochen,
Sorry, this regression has been left aside for a while.
We have re-priorized the ticket in our backlog to fix it soon.
PS: for further issues, please use https://github.com/centreon/centreon-collect/

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

No branches or pull requests

3 participants