Page 1 of 1

Nagios XI: Notification Messages - Varilables

Posted: Mon Nov 05, 2012 10:28 pm
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

Re: Nagios XI: Notification Messages - Varilables

Posted: Tue Nov 06, 2012 2:14 pm
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

Re: Nagios XI: Notification Messages - Varilables

Posted: Tue Nov 06, 2012 9:01 pm
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.

Re: Nagios XI: Notification Messages - Varilables

Posted: Wed Nov 07, 2012 4:09 pm
by scottwilkerson
Did you make these changes on the "Mobile text" tab of Notification Messages?

Re: Nagios XI: Notification Messages - Varilables

Posted: Wed Nov 07, 2012 4:58 pm
by jhobbins
G'day Scott,

Made the changes under Notification Messages - SMS. See attached screenshot.

Re: Nagios XI: Notification Messages - Varilables

Posted: Wed Nov 07, 2012 6:02 pm
by scottwilkerson
Do you have a Multi-Tech iSMS modem? if not the changes need to be made on the Mobile Text Tab

Re: Nagios XI: Notification Messages - Varilables

Posted: Wed Nov 07, 2012 7:43 pm
by jhobbins
Yep. Got a Multi-tech modem.

SMS works with the default message. But I can't seem to customise it. Very odd.

Re: Nagios XI: Notification Messages - Varilables

Posted: Thu Nov 08, 2012 11:35 am
by scottwilkerson
Yep, you led me to a bug... Thanks.

Attached is a fixed component, you can re-install through Admin -> Manage Components

Re: Nagios XI: Notification Messages - Varilables

Posted: Sat Nov 10, 2012 12:51 am
by jhobbins
Thanks again mate.

FYI...

I did notice that Manage Updates -> Check for Updates

Status field for "Multi-Tech iSMS Integration" is blank.

Re: Nagios XI: Notification Messages - Varilables

Posted: Mon Nov 12, 2012 11:38 am
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