Free Variables not displaying in service alert messages

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

Free Variables not displaying in service alert messages

Post by mbeebe »

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
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

Post by scottwilkerson »

Change this in the command from this

Code: Select all

$_SERVICEkblink$
to this

Code: Select all

$_SERVICEKBLINK$
from the doc
Custom variable names are converted to all uppercase before use
https://assets.nagios.com/downloads/nag ... tvars.html
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

Re: Free Variables not displaying in service alert messages

Post by mbeebe »

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
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

Post by scottwilkerson »

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
Noted!

Glad your issue is resolved!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked