This is actually a Windows XP machine. I have tried the suggestions and stopping the services but the install still hangs.
We really need your input in this questionnaire
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuif (($node->snmpSysName != null) && ($node->snmpSysName != ""))
{
RenameObject($node, $node->snmpSysName);
}
//rename node after configuration poll to snmp sysLocation
//if sysLocation is null then rename to node ip address
//also 3 custom attributes will be setted
// you can use this attributes in events with %{attribute_name} macros
//uncomment trace line and run netxmsd with -D1 param for logging
sub main()
{
if ($1->isSNMP)
{
//trace(1,"hook executed for ".$1->ipAddr);
transport = CreateSNMPTransport($1);
if (transport == null)
{
//trace(1,"snmp transport error on ".$1->ipAddr);
return -1;
}
location = SNMPGetValue(transport, ".1.3.6.1.2.1.1.6.0"); // sysLocation
sysname = SNMPGetValue(transport, ".1.3.6.1.2.1.1.5.0"); // sysname
uptime = SNMPGetValue(transport, ".1.3.6.1.2.1.1.3.0"); // uptime
//trace(1,"[".location."], [".sysname."], [".uptime."]");
if (location != null && location !="" && location!=" ")
{
//trace(1,"attr location changed to ".location);
RenameObject($1, location);
}
else
{
//trace(1,"error in location block");
RenameObject($1, $1->ipAddr); //change name to node ip address
}
if (sysname != null && sysname !="" && sysname !=" ")
{
SetCustomAttribute($1, "sysname", sysname); //set custom attribute for node snmp sysName
//trace(1,"attr sysname changed to ".location);
}
else
{
//trace(1,"error in sysname block");
}
if (uptime != null)
{
SetCustomAttribute($1, "uptime", SecondsToUptime(uptime/100)); //set custom attribute uptime for node
//trace(1,"attr uptime changed to ".SecondsToUptime(uptime/100));
}
else
{
//trace(1,"error in uptime block");
}
//trace(1,"end execution");
SetCustomAttribute($1, "last_update",localtime(time())->mday.".".localtime(time())->mon.".".localtime(time())->year.", ".localtime(time())->hour.":".localtime(time())->min.":".localtime(time())->sec);
}
}
Quote from: Victor Kirhenshtein on July 18, 2014, 01:06:30 PM
This message could popup if you try to call SNMP walk on non-node object (for example, template or cluster).
Best regards,
Victor
Quote from: Victor Kirhenshtein on July 07, 2014, 01:06:24 PM
Hi!
You have two options, and both requires script creation. One is to use nxshell script - there is an example of how to disable SNMP polling: http://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations#Disable_SNMP_polling_for_node. Other option is to use NXSL script on server - you can use node enumeration example: http://wiki.netxms.org/wiki/Script_Example:_Enumerate_All_Nodes and add calls to methods enableAgent, enableConfigurationPolling, enableIcmp, enableSnmp, enableStatusPolling, enableTopologyPolling on node objects as needed. Each of these methods accepts true or false as parameter. For example, to disable agent for node you can call
n->enableAgent(false);
assuming that you have reference to node object in a variable n.
Best regards,
Victor
Quote from: Victor Kirhenshtein on June 15, 2014, 12:07:59 PM
Hi!
You don't have to use instance discovery to monitor single item. All you have to do is to put .1.3.6.1.4.1.11369.10.3.2.1.0 as "parameter" on general page. Make sure that instance discovery is off.
Best regards,
Victor
Quote from: andrey--k on June 14, 2014, 11:19:26 AM
See indentation example on wiki:Quote
http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Indentation
Quote from: andrey--k on June 13, 2014, 04:22:24 PM
Sorry, but am running linux-only versions.
Quote from: andrey--k on June 13, 2014, 08:20:55 AM
I have ready script for similar purpose.from org.netxms.client.objects import GenericObject, Node, Template
rootObject = session.findObjectByName("FromFile")
#print rootObject
#print "\n"
if rootObject:
for nodeIP in open("discover.txt").readlines():
test = s.findObjectByName(nodeIP.strip())
if test:
print "Object exists\n"
else:
name = "IP%s" % nodeIP.strip()
newNode = NXCObjectCreationData(objects.GenericObject.OBJECT_NODE, name, rootObject.getObjectId());
newNode.setPrimaryName(nodeIP.strip())
try:
nodeId = session.createObject(newNode)
except:
print "exception create node\n"
pass
else:
if nodeId:
try:
s.pollNode(nodeId,2,None)
except:
print "exception make pool\n"
pass
Create file with ip list, delimited by newline (without whitespaces).
rename it to discover.txt
put all in one folder. (/home/nxuser/nxShell/)
Create folder "FromFile" via nxmc. New objects will be added there.
Run
java -Djava.io.tmpdir=/tmp/ -Dnetxms.server=127.0.0.1 -Dnetxms.login=admin -Dnetxms.password=netxms -jar /home/nxuser/nxShell/nxshell-1.2.14.jar nodesRemoveSoftwareScan.py
Script work slowly. For 600 ip it will take 3-5 hours but all nodes will be polled.
If you want to do it faster - comment or delete next lines from script:
if nodeId:
try:
s.pollNode(nodeId,2,None)
except:
print "exception make pool\n"
pass