Specify "Sender Name" in xi_host_notification_handler?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by perric »

Hello,

Thanks for your reply. I am using "notify-host-by-email", but it is easy enough for me to switch to xi_host_notification_handler and xi_service_notification_handler.

I will give this a try. So, the emailtype variable would be accessible between PHP scripts.

David
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by jolson »

Let us know if ssax's solution works for you. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by perric »

Ssax,

I like the solution. Thanks. However, it will be an issue for us if I modify a script that could overwritten each time we do an upgrade.

I have come up with another possible approach. Can I use the $CONTACTEMAIL$ variable to add any address that I need, when calling the xi_host_notification_handler (provided my e-mail system will accept it)? I can setup an e-mail for each e-mail address in my e-mail system.

I need this to override the "Send Mail From" field under Mail Settings. Will it override that field or will I need to leave that field blank?

David
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by ssax »

I assumed xi_host_notification_handler because it was in the topic :)

That won't work because the email processing code will replace it when sending with what you have set under Admin > Manage Email Settings, you would still need code modifications that would get replaced during an upgrade.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by ssax »

I should clarify that the xi_host/service_notification handler really just sends it to the command subsystem to be put into the DB, then the emails get processed from the DB and it uses what you have set under Admin > Manage Email Settings.
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by perric »

Ssax,

Does that mean that "--emailtype="$_SERVICEEMAILTYPE$" " won't work either?

David
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by ssax »

It will only work if you make the code changes that I've specified as well.
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Specify "Sender Name" in xi_host_notification_handler?

Post by perric »

Hi All,

Thanks for all answers. I would like to close this post.

David
Locked