Nagios xi: Notification Messages - Varilables

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
jhobbins
Posts: 33
Joined: Fri Oct 05, 2012 8:24 pm

Nagios xi: Notification Messages - Varilables

Post by jhobbins »

G'day Guys,

Nagios xi 2012R1.1

Configure -> More Options -> My Account Settings -> Notification Messages -> Email

Where can I get a list of available variables to use? I'd like to use %hostgroup% but it doesn't work.

Is it easy to add variables under the hood of Nagios xi?

Regards,

John Hobbins
Australia
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios xi: Notification Messages - Varilables

Post by scottwilkerson »

These are setup in the commands xi_host_notification_handler & xi_service_notification_handler

If you go to Configure -> CCM -> Commands
In the search type notification_handler you will see all the items passed in, for example

Code: Select all

--lasthoststate=$LASTHOSTSTATE$ 
You can add more to the commands like

Code: Select all

--hostgroups=$HOSTGROUPNAMES$ 
With this, you would have a new item available %hostgroups%, the part left of the = becomes the macro name, you can use valid Nagios macros to be populated for the right portion, a list is available here
http://nagios.sourceforge.net/docs/3_0/macrolist.html
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jhobbins
Posts: 33
Joined: Fri Oct 05, 2012 8:24 pm

Re: Nagios xi: Notification Messages - Varilables

Post by jhobbins »

Thanks mate.

Works a treat for e-mail but not SMS. SMS works fine otherwise.

I've added the variable to the beginning of the "Host Alert Message" field. So it's not a length issue.

Strangely, when I add random text to the field it doesn't appear in the SMS on my phone. E.g.

Customer: %hostgroup% %host% %type% (%hoststate%) %hostoutput% Addr: %hostaddress% Time: %datetime% Nagios URL: %xiserverurl%

"Customer: %hostgroup%" doesn't come through. It's as if it's not reading any change to the field.

Hope I've made myself clear.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios xi: Notification Messages - Varilables

Post by scottwilkerson »

Did you make these changes on the "Mobile text" tab of Notification Messages?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jhobbins
Posts: 33
Joined: Fri Oct 05, 2012 8:24 pm

Re: Nagios xi: Notification Messages - Varilables

Post by jhobbins »

G'day Scott,

Made the changes under Notification Messages - SMS. See attached screenshot.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios xi: Notification Messages - Varilables

Post by scottwilkerson »

Do you have a Multi-Tech iSMS modem? if not the changes need to be made on the Mobile Text Tab
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jhobbins
Posts: 33
Joined: Fri Oct 05, 2012 8:24 pm

Re: Nagios xi: Notification Messages - Varilables

Post by jhobbins »

Yep. Got a Multi-tech modem.

SMS works with the default message. But I can't seem to customise it. Very odd.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios xi: Notification Messages - Varilables

Post by scottwilkerson »

Yep, you led me to a bug... Thanks.

Attached is a fixed component, you can re-install through Admin -> Manage Components
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jhobbins
Posts: 33
Joined: Fri Oct 05, 2012 8:24 pm

Re: Nagios xi: Notification Messages - Varilables

Post by jhobbins »

Thanks again mate.

FYI...

I did notice that Manage Updates -> Check for Updates

Status field for "Multi-Tech iSMS Integration" is blank.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios xi: Notification Messages - Varilables

Post by scottwilkerson »

jhobbins wrote:Status field for "Multi-Tech iSMS Integration" is blank.
This can happen if you have a version of the component before it had a version number added...

The newest version of the component can be found here
http://assets.nagios.com/downloads/nagi ... s/isms.zip
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart