<?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[nxshell bulk, missing enable flags]]></title><description><![CDATA[<p dir="auto">I managed to set SNMP and NXCP to disable via nxshell bulk, but could not find a way to set flags to enable.<br />
<a href="https://www.netxms.org/documentation/javadoc/latest/org/netxms/client/objects/Node.html" rel="nofollow ugc">https://www.netxms.org/documentation/javadoc/latest/org/netxms/client/objects/Node.html</a></p>
<p dir="auto">And does a new discovered node get all flags enabled by default?<br />
Wouldnt it be better if NetXMS disable SNMP/NetXMS poll if node does not reply to this when Network Discover finds it?<br />
Ie trying x times and if no reply set flag to disable when creating the node.</p>
]]></description><link>https://forum.netxms.org/topic/3023/nxshell-bulk-missing-enable-flags</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 14:25:53 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/3023.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Mar 2014 20:55:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to nxshell bulk, missing enable flags on Mon, 31 Mar 2014 12:24:44 GMT]]></title><description><![CDATA[<p dir="auto">Ok, managed to understand how it works.</p>
<p dir="auto">Wrote my own function to archieve this as i could not get your example to work(?):</p>
<pre><code>def changeFlags(getFlags, flag, status):
  if flag == "snmp":
    bit=24
  elif flag == "nxcp":
    bit=25
  else:
    return "ERROR, flag missing or not found"

  if status == "on":
    getFlags &amp;= ~(1 &lt;&lt; bit);
  else:
    getFlags |= (1 &lt;&lt; bit);
  return getFlags
</code></pre>
<p dir="auto">Then changing with this:</p>
<pre><code>getFlags=node.getFlags()
getFlags = changeFlags(getFlags, "snmp", "on")
getFlags = changeFlags(getFlags, "nxcp", "off")
md = NXCObjectModificationData(node.getObjectId())
md.setObjectFlags(getFlags)
session.modifyObject(md)
</code></pre>
]]></description><link>https://forum.netxms.org/post/13377</link><guid isPermaLink="true">https://forum.netxms.org/post/13377</guid><dc:creator><![CDATA[Borgso]]></dc:creator><pubDate>Mon, 31 Mar 2014 12:24:44 GMT</pubDate></item><item><title><![CDATA[Reply to nxshell bulk, missing enable flags on Mon, 31 Mar 2014 08:36:27 GMT]]></title><description><![CDATA[<p dir="auto">Then to clear flag you can use the following construct:</p>
<pre><code>  newFlags = node.getFlags() &amp; ~Node.NF_DISABLE_NXCP
  #newFlags = node.getFlags() &amp; ~(Node.NF_DISABLE_NXCP | Node.NF_DISABLE_SNMP)
  md = NXCObjectModificationData(node.getObjectId())
  md.setObjectFlags(newFlags)
  session.modifyObject(md)
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/13363</link><guid isPermaLink="true">https://forum.netxms.org/post/13363</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 31 Mar 2014 08:36:27 GMT</pubDate></item><item><title><![CDATA[Reply to nxshell bulk, missing enable flags on Fri, 28 Mar 2014 06:26:56 GMT]]></title><description><![CDATA[<p dir="auto">Snipcode of the script. the rest is not important to netxms as it just filteres the nodes by name.</p>
<pre><code>import org.netxms.client.NXCObjectModificationData
from org.netxms.client.objects import Node

for node in [o for o in s.getAllObjects() if isinstance(o, objects.Node)]:
  name=node.getObjectName()

  #newFlags = node.getFlags() | Node.NF_DISABLE_SNMP | Node.NF_DISABLE_NXCP
  #newFlags = node.getFlags() | Node.NF_DISABLE_SNMP

  newFlags = node.getFlags() | Node.NF_DISABLE_NXCP
  md = NXCObjectModificationData(node.getObjectId())
  md.setObjectFlags(newFlags)
  session.modifyObject(md)
</code></pre>
]]></description><link>https://forum.netxms.org/post/13334</link><guid isPermaLink="true">https://forum.netxms.org/post/13334</guid><dc:creator><![CDATA[Borgso]]></dc:creator><pubDate>Fri, 28 Mar 2014 06:26:56 GMT</pubDate></item><item><title><![CDATA[Reply to nxshell bulk, missing enable flags on Thu, 27 Mar 2014 13:46:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">If you can disable SNMP (by setting appropriate bit flag), then you can enable it back by clearing same bit flag. If you show me the code I probably will be able to suggest how to change it so it will work.</p>
<p dir="auto">Newly discovered nodes comes with all communication channels enabled. They are checked on each configuration poll to detect any changes. System cannot predict why SNMP is not responding for example - vecause it is not enabled and never will, or because of misconfiguration, or it will e enabled next day.</p>
<p dir="auto">With latest patches (that will be part of 1.2.14 release) it is also possible to disable let say SNMP for each new discovered node using NXSL script called on SYS_NODE_ADDED event.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/13328</link><guid isPermaLink="true">https://forum.netxms.org/post/13328</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 27 Mar 2014 13:46:29 GMT</pubDate></item></channel></rss>