I have tried to install 1.2.17 on Windows but the install hangs when checking the netxms core service. I get a check mark by Installing service. It works correctly in 1.2.16. Any suggestions? Thank you for your assistance.
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);
}
}