Hi,
i was wondering if there is any possibility to use the macros _HOSTxxx ore _SERVICExxx
in the Actions Component in regards to an URL?
sample below
Action Type: URL
URL / Command: teamviewer8://remotecontrol?connectcc=%_HOSTTVID%
Target: _blank
Action Text: Teamviewer
but it seams that %_HOSTTVID% is not getting replaced by the value of the _TVID variable of the host.
use of Custom Variable/macro i Actions component
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: use of Custom Variable/macro i Actions component
I'm not sure I understand how you're expecting the _TVID to suppliment the _HOSTXXXX bit.
These macros are immutable, you cannot macro in a macro so to speak. Is that what you're trying to do?
These macros are immutable, you cannot macro in a macro so to speak. Is that what you're trying to do?
Re: use of Custom Variable/macro i Actions component
Hi,
my understanding was, and maybe i'm totally wrong here, that if i setup a variable _TVID for one host in:
'Misc Settings' -> 'Manage Variable Definitions' that i would be able to use it later with the macro _HOSTxxx, or in this case _HOSTTVID
The question then is if the same could be used in the Actions Component for an URL.
if not would there be any other option? i already tried to use the action_url in the'Misc Settings' but that would be only available in Nagios core.
my understanding was, and maybe i'm totally wrong here, that if i setup a variable _TVID for one host in:
'Misc Settings' -> 'Manage Variable Definitions' that i would be able to use it later with the macro _HOSTxxx, or in this case _HOSTTVID
The question then is if the same could be used in the Actions Component for an URL.
if not would there be any other option? i already tried to use the action_url in the'Misc Settings' but that would be only available in Nagios core.
jdalrymple wrote:I'm not sure I understand how you're expecting the _TVID to suppliment the _HOSTXXXX bit.
These macros are immutable, you cannot macro in a macro so to speak. Is that what you're trying to do?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: use of Custom Variable/macro i Actions component
Sorry, I misunderstood and you are right about how custom macros work. Unfortunately custom macros aren't part of the available list for the command/URL field of the actions component. Reference the bottom of this document for what is available:
http://assets.nagios.com/downloads/nagi ... ponent.pdf
http://assets.nagios.com/downloads/nagi ... ponent.pdf
Re: use of Custom Variable/macro i Actions component
thats what i was afraid of. do you see any other possibility to achieve this.
I was already searching of a possibility to get the action_url icon back in Nagios XI but it seems to be only available in Nagios Core, and switching to it every time seems not to be the solution.
I was already searching of a possibility to get the action_url icon back in Nagios XI but it seems to be only available in Nagios Core, and switching to it every time seems not to be the solution.
Re: use of Custom Variable/macro i Actions component
Alright, this is round about, but may work. You could perform a query to the json api to fetch/parse the custom variables and then use them in your custom actions script. Take a go through the json query generator at:
http://<server ip>/nagios/jsonquery.html
http://<server ip>/nagios/jsonquery.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: use of Custom Variable/macro i Actions component
Hi Abrist,
thanks for the tip. will look into this and see if i can get it to work that way
thanks for the tip. will look into this and see if i can get it to work that way
abrist wrote:Alright, this is round about, but may work. You could perform a query to the json api to fetch/parse the custom variables and then use them in your custom actions script. Take a go through the json query generator at:
http://<server ip>/nagios/jsonquery.html
Re: use of Custom Variable/macro i Actions component
Do you want us to keep this topic open?thanks for the tip. will look into this and see if i can get it to work that way
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: use of Custom Variable/macro i Actions component
you can close it, thanks.
lmiltchev wrote:Do you want us to keep this topic open?thanks for the tip. will look into this and see if i can get it to work that way