Difference between revisions of "Using nxshell to automate bulk operations"

Jump to navigation Jump to search
Line 256: Line 256:
   except:
   except:
     print "No package found"
     print "No package found"
</syntaxhighlight>
== Enter/Leave Maintenance for node ==
<syntaxhighlight lang="python">
from org.netxms.client.objects import Node
import org.netxms.client.NXCSession
NETXMS_NODE = "__NodeName__"
STATE = False or True
node = session.findObjectByName(NETXMS_NODE.strip())
if node:
  session.setObjectMaintenanceMode(node.getObjectId(), STATE)
</syntaxhighlight>
</syntaxhighlight>
14

edits

Navigation menu