Notifications - modify %host% output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Notifications - modify %host% output

Post by jacek »

But the instruction contains an variable called %hostalias%.
Wouldn't this be what I need?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Notifications - modify %host% output

Post 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?
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Notifications - modify %host% output

Post 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 :P
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Notifications - modify %host% output

Post 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...
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Notifications - modify %host% output

Post 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!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Notifications - modify %host% output

Post 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.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked