cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

"Insert Variables" in Custom HTML Resources in Views

"Insert Variables" in Custom HTML Resources in Views

The ability to "insert variables" using a button to should all available into custom html resources, would make these resources a little more dynamic and even focused on the Node being viewed.

For Example:

<iframe src="http://${N=SwisEntity;M=Application.Node.IP_Address}/UPS/ups_alar.htm" width="430" height="300"></iframe>

${N=SwisEntity;M=Application.Node.IP_Address}  would parse dynamically into the IP address of the Node in the view. In this instance it would show a page on the UPS that lists events logged locally.


This could be used to also create some custom HTML resource based on Universal Poller values, that don't currently fit into existing built-in views.  Some more options for Custom HTML could be added to complement this feature. over all it would eliminate creating individual views for each device where this could be implemented.


This feature could lead to some highly dynamic and customizable views, that could further the community involvement in future NPM developments.



12 Comments
Level 17

this used to work if I remember correctly, back before SWQL/SWIS.  you could use ${ID} to get the app id of the currently viewed object, etc... or ${NodeID} for nodes...what happened

Level 12

Yeah I read comments that sounded like it should be working. There must have been some code changes that took this customization away from use, just like it broke a number of my alerts that relied on the old variables like location and URL. Not fun updating alerts.

Would really like to see this feature come back, not sure why it went away.

Level 9

Just tested this successfully using the Custom HTML.  <iframe src="http://${IP_Address}" width=800 height=500 frameborder=0></iframe>  IP_Address is the polling IP of the node though, so I'm not sure if that would work. in the context you want.

Level 12

Yeah that worked for my example. what other variables do we have access to in CustomHTML resources? maybe this feature just needs to make it easier to insert variables as needed.

Level 9

I agree, that would be a very nice addition.  Even making it similar to how the edit option for other resource would be nice, or allowing you to choose the tables that are relevant.  Many times, I find it confusing as the type of view you are in (summary, node details, application details) will impact how you reference the various tables and values within them. 

Level 9

I'm able to get links working for custom variables within a View using 'Custom HTML' however it doesn't parse them in Web reports for some reason.

Level 16

Bump, anyone get this working?

bobmarley​ This should have been working for a while. The screenshot below is just made up of a bunch of ${variableName} stuff...

pastedImage_0.png

EX:

<tr>

<tr style="background-color: #E3DEDE;" align="center">

  <td>Node:</td>

  <td>${Caption}</td>

</tr>

<tr>

<tr style="background-color: #E3DEDE;" align="center">

  <td>IP Address:</td>

  <td>${IP_Address}</td>

</tr>



Level 16

Thanks for the reply wluther Expert

I'm trying to add a Custom HTML resource on the Active Alert Detail page so that our NOC can review the instructions for an alert and then create a ticket by sending an email

to our 'MailEater' program in Service Desk.

pastedImage_0.png

The 'MailEater' program parses out specific info contained within the Body of the email and uses that info to create a ticket.

I have created Node Custom Properties for mail eater to use. What I need to know is how to get them to resolve into my HTML code.

When the NOC clicks Make Ticket, I need to fill in the required fields.

Here is what the email looks like with my code:

pastedImage_1.png

${N=SwisEntity;M=CustomProperties._TicketInfo} is the one I'm really trying to focus on.

If I could get the variables to resolve I could get this to work

The code I am using is this:

<HTML>

<HEAD>

<TITLE>UPS Instructions</TITLE>

</HEAD>

<BODY BGCOLOR="FFFFFF">

<CENTER><IMG SRC="https://solarwinds/orion/images/Solarwinds.logo.gif" ALIGN="BOTTOM"> </CENTER>

<HR>

<a href="https://solarwinds/docs/index.pdf">Alert Instructions</a>

Link to instructions for this alert:

<H1>NOC Instructions</H1>

<a href="mailto:MailEater@MyCompany.org?subject=AutoTicket Creation&body=${IP_Address}%0D${N=SwisEntity;M=CustomProperties._TicketInfo}%0D${Caption}">Make Ticket</a>

<HR>

</BODY>

</HTML>

So basically I'm just trying to allow the NOC to create a ticket by pressing a button and passing the needed info along for it.

There's probably a different approach?

If anyone has done this before and have any suggestions on how to do it they would be greatly appreciated!

bobmarley​ I think it has something to do with the variables you are calling, and where you are calling them from... If you copy paste you HTML to the Node Details page, it will work. Perhaps pull the variables from the alert point of view?

pastedImage_0.png

In regards to your "CustomProperties._TicketInfo" variable, try dropping everything except the "_TicketInfo".

Let me know if that works, or appears to work any better. Hopefully we can get that working for you.

-Thank you,

-Will