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
Nagios xi: Notification Messages - Varilables
-
- Posts: 33
- Joined: Fri Oct 05, 2012 8:24 pm
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Nagios xi: Notification Messages - Varilables
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
You can add more to the commands like
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
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$
Code: Select all
--hostgroups=$HOSTGROUPNAMES$
http://nagios.sourceforge.net/docs/3_0/macrolist.html
-
- Posts: 33
- Joined: Fri Oct 05, 2012 8:24 pm
Re: Nagios xi: Notification Messages - Varilables
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.
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Nagios xi: Notification Messages - Varilables
Did you make these changes on the "Mobile text" tab of Notification Messages?
-
- Posts: 33
- Joined: Fri Oct 05, 2012 8:24 pm
Re: Nagios xi: Notification Messages - Varilables
G'day Scott,
Made the changes under Notification Messages - SMS. See attached screenshot.
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Nagios xi: Notification Messages - Varilables
Do you have a Multi-Tech iSMS modem? if not the changes need to be made on the Mobile Text Tab
-
- Posts: 33
- Joined: Fri Oct 05, 2012 8:24 pm
Re: Nagios xi: Notification Messages - Varilables
Yep. Got a Multi-tech modem.
SMS works with the default message. But I can't seem to customise it. Very odd.
SMS works with the default message. But I can't seem to customise it. Very odd.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Nagios xi: Notification Messages - Varilables
Yep, you led me to a bug... Thanks.
Attached is a fixed component, you can re-install through Admin -> Manage Components
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.
-
- Posts: 33
- Joined: Fri Oct 05, 2012 8:24 pm
Re: Nagios xi: Notification Messages - Varilables
Thanks again mate.
FYI...
I did notice that Manage Updates -> Check for Updates
Status field for "Multi-Tech iSMS Integration" is blank.
FYI...
I did notice that Manage Updates -> Check for Updates
Status field for "Multi-Tech iSMS Integration" is blank.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Nagios xi: Notification Messages - Varilables
This can happen if you have a version of the component before it had a version number added...jhobbins wrote:Status field for "Multi-Tech iSMS Integration" is blank.
The newest version of the component can be found here
http://assets.nagios.com/downloads/nagi ... s/isms.zip