Page 2 of 2
Re: Notifications - modify %host% output
Posted: Wed Jan 18, 2017 2:57 am
by jacek
But the instruction contains an variable called %hostalias%.
Wouldn't this be what I need?
Re: Notifications - modify %host% output
Posted: Wed Jan 18, 2017 10:12 am
by lmiltchev
As administrator, you could change your nagios xi users' notification messages from this (using %host% macro):
example01.PNG
to this (using %hostalias% macro):
example02.PNG
In the first case, you will see the hostname:
example03.PNG
In the second case, you will see the alias:
example04.PNG
Here's the host definition:
Code: Select all
define host {
host_name London-Server-SERVER01
alias SERVER01
...
}
Is this what you are trying to accomplish?
Re: Notifications - modify %host% output
Posted: Wed Jan 18, 2017 11:05 am
by jacek
Yes, this is exactly what I meant.
I will need to figure out how to set the aliases in an simple way.
Its ~500 hosts

Re: Notifications - modify %host% output
Posted: Wed Jan 18, 2017 12:37 pm
by SteveBeauchemin
If you start now using copy and paste, you'll be done by Friday...
Sometimes, there is no need to be fancy, just get it done...
Re: Notifications - modify %host% output
Posted: Wed Jan 18, 2017 12:57 pm
by jacek
Maybe You are right?

I started this thread hoping that the notifications template (from the Admin panel) can have some php/script in the text or so, to simply cut out the unneeded text.
Now I will need to decide if I want to take care of both the host names and aliases or simply drop the idea.
Will let know the outcome for sure!
Re: Notifications - modify %host% output
Posted: Wed Jan 18, 2017 3:35 pm
by lmiltchev
You could use the
Bulk Renaming Tool to add/modify aliases in bulk. Do it in batches, i.e. 50 or so. Copy/paste the last part of the host's name to the alias field, and click on Next to modify aliases with "one go".
It shouldn't take very long. See examples below:
example01.PNG
example02.PNG
example03.PNG
Hope this helps.