Hello,
I'm trying to accomplish something very simple: in our emailed service alerts, I want to add a link to our knowledgebase.
I followed the instructions for setting up custom service macros in this document: https://assets.nagios.com/downloads/nag ... iables.pdf
I have the following definitions:
In the service itself, I have a Free Variable defined as _kblink
In the xi_service_notification_handler, I've added --kb_link="$_SERVICEkblink$"
Then, in the notification message for the user, I've added "KB link: %kb_link%"
I believe this is set up correctly. However, when the alert fires, in the email message, I see:
"KB Link:$" -- the dreaded missing variable!
Our version of Nagios XI is 5.5.4
Any suggestions on what I'm doing wrong?
-- Mike Beebe
Free Variables not displaying in service alert messages
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Free Variables not displaying in service alert messages
Change this in the command from this
to this
from the doc
Code: Select all
$_SERVICEkblink$Code: Select all
$_SERVICEKBLINK$https://assets.nagios.com/downloads/nag ... tvars.htmlCustom variable names are converted to all uppercase before use
Re: Free Variables not displaying in service alert messages
Hi Scott,
This absolutely, positively 100% fixed my issue.
As a nb, the information you provided me is not trivial and not well-worded. I would think better wording would be:
WARNING: you must use upper-case for service/host variable names unless you want to waste 6 hours of your life slamming your head against the desk while you try to figure out why the darned variable name never shows up in your email.
Just a suggestion.
Thank for your help!
-- Mike Beebe
This absolutely, positively 100% fixed my issue.
As a nb, the information you provided me is not trivial and not well-worded. I would think better wording would be:
WARNING: you must use upper-case for service/host variable names unless you want to waste 6 hours of your life slamming your head against the desk while you try to figure out why the darned variable name never shows up in your email.
Just a suggestion.
Thank for your help!
-- Mike Beebe
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Free Variables not displaying in service alert messages
Noted!mbeebe wrote:Hi Scott,
This absolutely, positively 100% fixed my issue.
As a nb, the information you provided me is not trivial and not well-worded. I would think better wording would be:
WARNING: you must use upper-case for service/host variable names unless you want to waste 6 hours of your life slamming your head against the desk while you try to figure out why the darned variable name never shows up in your email.
Just a suggestion.![]()
Thank for your help!
-- Mike Beebe
Glad your issue is resolved!
Locking thread