<?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[Simple question - variable which holds result of icmp when doing status polls]]></title><description><![CDATA[<p dir="auto">I have my nodeUpDown custom variable auto binding and unbinding working - except for the last piece - updating this custom variable when status polling.</p>
<p dir="auto">I do NOT want to just use the event and do it via event processing - Event Policy processing can get behind so this way avoids waiting - it updates what we look at immediately.</p>
<p dir="auto">I want to add to the Status hook the setting of the nodeUpDown based on the ICMP ping response.<br />
If I can ping the device - set it to up. If I cannot ping it, set it to down.</p>
<p dir="auto">Something like this below added to the status polling hook script - once I know the variable that holds the ICMP response.</p>
<pre><code>if (($node-&gt;icmpresponse == "no")) {
   newstate = "Down";
   oldstate = GetCustomAttribute($node, "nodeUpDown");

         if (newstate != null)
            {
             if ((newstate imatch "Down"))
                 {
                  BindObject(FindObject("AllDown"), $node);
                  SetCustomAttribute($node, "nodeUpDown", newstate);
                 }
   }
if (($node-&gt;icmpresponse = "yes")) {
   newstate = "Up";
   oldstate = GetCustomAttribute($node, "nodeUpDown");

         if (newstate != null)
            {
             if ((newstate imatch "Up"))
                 {
                   SetCustomAttribute($node, "nodeUpDown", newstate);
                   UnbindObject(FindObject("AllDown"), $node);
         }
   }

}
</code></pre>
]]></description><link>https://forum.netxms.org/topic/6059/simple-question-variable-which-holds-result-of-icmp-when-doing-status-polls</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:20:26 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6059.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 Jul 2019 06:30:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Simple question - variable which holds result of icmp when doing status polls on Sun, 04 Aug 2019 04:27:17 GMT]]></title><description><![CDATA[<p dir="auto">Fantastic - thanks Victor.</p>
<p dir="auto">Coding style - mine is mostly a hack and slash approach to something else I have seen as an example or that I know works. Once it works, rather than go back and clean it up - more trial and error - I move onto the next highest priority task.</p>
<p dir="auto">The more I do with NetXMS, the better I will get.</p>
<p dir="auto">Between this and the runtime flag for unreachable - very, very happy person I am today <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.netxms.org/post/26231</link><guid isPermaLink="true">https://forum.netxms.org/post/26231</guid><dc:creator><![CDATA[paul]]></dc:creator><pubDate>Sun, 04 Aug 2019 04:27:17 GMT</pubDate></item><item><title><![CDATA[Reply to Simple question - variable which holds result of icmp when doing status polls on Fri, 02 Aug 2019 10:01:24 GMT]]></title><description><![CDATA[<p dir="auto">I recommend using runtimeFlags field to determine that node is completely unreachable, like this:</p>
<pre><code>if (($node-&gt;icmpresponse &amp; 4) != 0)
   // state is "down"
</code></pre>
<p dir="auto">Also few comments on script itself - purely style/clarity, not functionality:</p>
<ol>
<li>You may use direct comparison instead of regexp match if you are loking for exact match, i.e.</li>
</ol>
<p dir="auto">(newstate == "Down")</p>
<p dir="auto">instead of</p>
<p dir="auto">(newstate imatch "Down")</p>
<ol start="2">
<li>No need for checking status twice, just can just use else:</li>
</ol>
<pre><code>if ($node-&gt;icmpresponse == "no") {
}
else {
}
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/26225</link><guid isPermaLink="true">https://forum.netxms.org/post/26225</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 02 Aug 2019 10:01:24 GMT</pubDate></item></channel></rss>