Recent posts

#61
General Support / Re: Dashboard Blanks Itself Af...
Last post by Filipp Sudanov - April 10, 2026, 01:20:08 PM
Thanks for the info, developers fixed a few resource leaks in maps, to that could have been it.
#62
General Support / Re: Dashboard Blanks Itself Af...
Last post by dneil - April 09, 2026, 01:57:44 PM
Hi Filipp,

We wiped Windows on that machine and installed Linux Mint, running Mint we've had no issues with the Dashboard blanking itself.  As such, I won't be able to get any values from Task Manager for you.

The Dashboard elements are a Geo Map, a Map, the alarm list and a bunch of traffic graphs.

Thanks!
#63
Цепочка может уходить весьма глубоко, можно например

for (i : $node.interfaces) {
  println(i.peerInterface.node.name);
}

Не обязательно писать цепочкой, можно раскапывать по одному шагу и сохранять в переменные:

for (i : $node.interfaces) {
  p = i.peerInterface;
  n = p.node;
  name = n.name;
  println(name);
}

но может оказаться, что в этой цепочке какой-то атрибут является null, а не объектом, и тогда все ломается в примере выше, если переменная p будет null, то в следующей строчке, где мы делаем p.node, то есть пытаемся получить атрибут node мы не можем этого сделать, потому что у null нет такого атрибута. Чтоб не ломалось, можно делать проверки в тех местах, которые могут оказаться null, например peerInterface:

for (i : $node.interfaces) {
  p = i.peerInterface;
  if (p != null) {
    println(p.node.name);
  }
}

Или использовать новый синтаксис, появившийся в версии 4.5, называется это safe dereference и если кто-то и окажется null, то попытка обратиться к его атрибуту не завершится ошибкой. Но .? должыть быть в цепочке начиная с первого места, которое может оказаться null и до конца цепочки:

for (i : $node.interfaces) {
  println(i.peerInterface?.node?.name);
}

Peer ноды определяются во время topology poll
#64
Работает, принт отдает нужную инфу.
Как функционируют цепочки параметров?
Вот это имеется ввиду iface.peerNode.name - на сколько глубоко оно может уходить? Пробовал так построить в другом скрипте, постоянно ошибки ловил

Вопрос 2
В какой момент происходит запись информации о peer ноде интерфейса? Я так понимаю в момент SYS_NODE_ADDED этой инфы не существует еще т.к. в обнаруженных нодах оно появляется не сразу, а сия конструкция не добавляет в ивент новых пунктов
peerInfo = [];
for(iface : $node.interfaces)
{
peerIface = iface.peerInterface;
if (peerIface != null)
{
peerIF.append(peerIface.name);
peerN.append(iface.peerNode.name);
$event.addParameter("PeerIface", peerIF.join(", "));
$event.addParameter("PeerNode", peerN.join(", "));
}

}
#65
А что-нибудь такое:

  for (iface : $node.interfaces)                                                                                                                 
  {                                                                                                                                              
      peerIface = iface.peerInterface;
      if (peerIface != null)                                                                                                                     
      {                                              
          println("Port " .. peerIface.name .. " on " .. iface.peerNode.name);
      }                                                                                                                                          
  }
#66
General Support / Re: Dashboard Blanks Itself Af...
Last post by Filipp Sudanov - April 07, 2026, 04:55:40 PM
Which exactly dashboard elements are used on that dashboard?

In Windows task manager in "Details" screen right-click on any header in the table, click "Select columns" and add "User objects" and "GDI objects". Check these values after a day, if they grow or stay stable.
#67
General Support / Re: ssh does not work
Last post by Filipp Sudanov - April 07, 2026, 04:27:08 PM
Note the %(username) macro in object tool's command line. This object tool has an input field configured, so when tool is executed a dialog with input field should appear. Username should be entered there. If username is not entered, then command line is formed incorrectly.

You can check actual command line by changing
cmd /c "ssh %(in:username)@%u || pause"
to
echo cmd /c "ssh %(in:username)@%u || pause"
it will just display the command line on the screen.

Also, you can use ssh username specified in node properties, in this cause use this command:
cmd /c "ssh %{ssh.login}@%u || pause"
and remove input field from the object tool.
#68
General Support / Re: Filtering MikroTik Devices...
Last post by Victor Kirhenshtein - April 07, 2026, 04:06:01 PM
And just for completeness, script above can be simplified to
return InetAddress("192.168.56.0", 24).contains($node.ipAddress);

#69
General Support / Re: Filtering MikroTik Devices...
Last post by Filipp Sudanov - April 07, 2026, 03:59:51 PM
First of all two first lines should end with ; char.
There is no isInSubnet() method on InetAddress class, but there is contains() method on subnet, so we should go opposite way and check it on the subnet, there's an example here: https://netxms.org/documentation/nxsl-latest/#_instance_methods_18
So, modifying your code:

subnetObject = InetAddress("192.168.56.0", 24);

if (subnetObject.contains($node.ipAddress)) {
    return 1;  // match
} else {
    return 0;  // no match
}
#70
General Support / Re: Port View is Blank
Last post by Filipp Sudanov - April 07, 2026, 02:50:00 PM
Port view works only for devices for which NetXMS has device drivers, so some of these drivers are capable of getting port information. Zyxel devices are not in priority for driver development due to limited resources.