<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Event messages, possible to do text conversion or IP to DNS lookup?]]></title><description><![CDATA[<p dir="auto">At the moment i'm using the Syslog Parser to notify us via slack of certain syslog messages, such as OSPF neighbor state changes (if there's a better way i'm all ears)<br />
The process is Syslog Parser -&gt; Event template -&gt; Event processing policy -&gt; Slack message</p>
<p dir="auto">The Syslog Parser looks like this</p>
<pre><code>*OSPF State change* %1 from %2 to %3
</code></pre>
<p dir="auto"> -&gt; Generate Event</p>
<p dir="auto">The event template consists of this</p>
<pre><code>*OSPF State change* %1 from %2 to %3
</code></pre>
<p dir="auto">Event processing is<br />
Condition: Event<br />
Action: Server Action - SLACK</p>
<p dir="auto">SLACK alert is</p>
<pre><code>curl -d 'payload={"attachments": [{"color": "#8c8c8c","text": "%n - %m %M"}]}' -X PUT [URL HIDDEN]
</code></pre>
<p dir="auto">Net result is a Syslog message originated on the router starts off like this</p>
<blockquote>
<p dir="auto">route,ospf,info OSPFv2 neighbor 2.2.2.2: state change from Full to Down</p>
</blockquote>
<p dir="auto">and then in Slack it appears like this<br />
RouterA | 1.1.1.1 - <strong>OSPF State change</strong> 2.2.2.2 from Full to Down</p>
<p dir="auto">I have a script that runs and changes the hostname of all NetXMS hosts to their Syslog name and their IP address, so the first part of 'RouterA | 1.1.1.1' is very easy to read and show which device originated the SysLog message<br />
The second part of '2.2.2.2' is not so easy because nobody knows off the top of their head which router 2.2.2.2 is<br />
So I want to do some text replacement. Is it possible anywhere along this chain of events to take the text of %1 (which is 2.2.2.2 in this example) and then do a lookup, find the hostname of 2.2.2.2 and replace it with i.e. <strong>'RouterB | 2.2.2.2'</strong> so that its far more human readable?</p>
<p dir="auto">I'm thinking it might be possible to change the event processing policy to instead run a script, and then the script executes the server action<br />
However i'd need some help with that process as i'm not overly familiar with NetXMS scripting language and operations</p>
<p dir="auto">Alternatively is there an online service such as zapier that is well suited for parsing text and changing it, so that I can keep NetXMS as it is but instead of sending directly to Slack it sends to the interpreter service, then that sends the finalized message to Slack? I'm just not aware of a service specifically built for this</p>
]]></description><link>https://forum.netxms.org/topic/6747/event-messages-possible-to-do-text-conversion-or-ip-to-dns-lookup</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 20:43:37 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6747.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Oct 2020 05:57:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Event messages, possible to do text conversion or IP to DNS lookup? on Fri, 05 Feb 2021 04:28:20 GMT]]></title><description><![CDATA[<p dir="auto">edit: Nevermind, post removed</p>
<p dir="auto">I thought your syntax was incorrect, but I was using it wrong. I was trying to first test with 'Execute Server Script' and parsing a variable to it then using $1 instead of $event-&gt;parameters[1] and that worked in that context, but not in Event message</p>
<p dir="auto">Your syntax is correct and it works fine</p>
<p dir="auto">Thank You!</p>
]]></description><link>https://forum.netxms.org/post/29414</link><guid isPermaLink="true">https://forum.netxms.org/post/29414</guid><dc:creator><![CDATA[Millenium7]]></dc:creator><pubDate>Fri, 05 Feb 2021 04:28:20 GMT</pubDate></item><item><title><![CDATA[Reply to Event messages, possible to do text conversion or IP to DNS lookup? on Tue, 03 Nov 2020 13:45:50 GMT]]></title><description><![CDATA[<p dir="auto">Make a script in scrip library, e.g. GetNodeName:</p>
<pre><code>r = "";
for (n : GetAllNodes())
{
  if (n-&gt;ipAddr == $event-&gt;parameters[1])
  {
    r = n-&gt;name;
    break;
  }
}
return r;
</code></pre>
<p dir="auto">In event template call it like this:<br />
*OSPF State change* %[GetNodeName] %1 from %2 to %3</p>
<p dir="auto">The script will be called in the context of the event, so the first parameter of the event where you have the IP address will be available there.</p>
]]></description><link>https://forum.netxms.org/post/28790</link><guid isPermaLink="true">https://forum.netxms.org/post/28790</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 03 Nov 2020 13:45:50 GMT</pubDate></item></channel></rss>