Jinja templating with webhooks #17372
-
Anyone have any insights for advanced stuff, or know if we can do anything beyond basic templating? I've setup a test webhook, to send to Nagios in order to create a new host. The issue is that Netbox's I've seen some other discussions about Jinja templating in general, and tried a couple of things, but couldn't find anything specifically on webhooks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Do you mean, you just want the plain IP address without prefix length? nbshell is a good way to exercise that, because even though jinja2 is not Python, all the properties and methods of objects are available.
Hence The other way you could deal with this is by using jinja2 expressions, for example to chop the string on
|
Beta Was this translation helpful? Give feedback.
Do you mean, you just want the plain IP address without prefix length? nbshell is a good way to exercise that, because even though jinja2 is not Python, all the properties and methods of objects are available.
Hence
{{ foo.address.ip }}
is just a trick you have to know for Netbox IPAddress objects, e.g.{{ dev…