Menu

Show posts

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 Menu

Messages - tolimanjo

#1
General Support / Re: v5.1.3 Android Client
September 30, 2025, 05:41:40 AM
I was getting the '500' error from the client when using HTTP, and a packet capture showed HTTPS style connection attempts to the server. Perhaps Android was trying to be helpful?
Anyway, putting an HTTPS-HTTP proxy in front of the server (and specifying https:// on the client) fixed the problem.
#2
General Support / Re: Port Negotiation Template
August 30, 2025, 04:41:51 AM
Not sure about the absent interface.name - possibly a version issue?

I've attached screenshots of an example similar to your approach. It worked for me on server version 5.2.x (Debian) against a 6-port MikroTik.
#3
General Support / Re: Port Negotiation Template
August 27, 2025, 01:34:17 AM
Could try using the interface type - RouterOS appears to use type 6 (ethernetCsmacd) exclusively for physical interfaces:

interface = $node?.getInterfaceByIndex($1);
if (interface != null) {
    if (interface.ifType == 6)
        return [true, $1, interface.name];
}
#4
General Support / Re: Cisco switch interface speed
April 21, 2025, 07:11:35 AM
Between OS versions 2.4.0.x and 2.5.5.x the 350 series would report ifSpeed via SNMP in Mbit/s - fixed in 2.5.7.85 and later versions to (correctly) report bit/s.
Note the 'Product version' reported in the NetXMS Node Overview/Inventory is the FW version, which was 2.5.x for the OS versions affected.
#5
General Support / Re: Mikrotik SFP Signal Monitoring
March 29, 2025, 02:13:27 AM
I've attached an export of the template DOM DCIs I use for MikroTiks. You should find the relevant Metric and Instance Discovery values in the XML.
#6
General Support / Re: Empty Value in Last Values
July 27, 2023, 03:30:50 AM
Ah, the blank result just means that your model doesn't report 'health' values. You should see something like the following (on most models) when checking 'resource' values:

[admin@router-01] > /system resource print oid
    used-memory: .1.3.6.1.2.1.25.2.3.1.6.65536
        uptime: .1.3.6.1.2.1.1.3.0
    build-time: .1.3.6.1.4.1.14988.1.1.7.6.0
  total-memory: .1.3.6.1.2.1.25.2.3.1.5.65536
  cpu-frequency: .1.3.6.1.4.1.14988.1.1.3.14.0

#7
General Support / Re: Empty Value in Last Values
July 26, 2023, 04:03:57 AM
Try adding '.0' to the end of the OID value. OID values for available parameters on a given MikroTik model can be found via the CLI, e.g.:
[admin@router-01] > /system health print oid
            voltage: .1.3.6.1.4.1.14988.1.1.3.8.0
            current: .1.3.6.1.4.1.14988.1.1.3.13.0
        temperature: .1.3.6.1.4.1.14988.1.1.3.10.0
    cpu-temperature: .1.3.6.1.4.1.14988.1.1.3.11.0
  power-consumption: .1.3.6.1.4.1.14988.1.1.3.12.0

#8
Here are the DCI settings that work for me.
I also include 'return format($1/10, 1, 1);' in the Transformation section, to convert the 1/10ths integer value.
Of course, you'll only get a result if the MikroTik model reports a 'temperature' value under '/system/health'.

Cheers.

#9
Hi Victor,

Upgrading to 4.3.4 did indeed fix the PushDCIData() segfault problem I was seeing.

Thanks for your help.
#10
Thanks for looking into that. 

I've worked around the problem for now, so will wait and see if the patch fixes it.
#11
Hi there,

I'm getting a segfault on server 4.3.3 (Debian) when using PushDCIData() in a transform script. If the DCI I'm pushing to has 'Save only changed values' enabled, then a segfault occurs.

I haven't been able to reproduce this behavior on a test platform, so can't rule out something else being the cause of the problem. Curiously, the fault only occurs after a restart of the server.

Thread 33 "$DATACOLL/WRK" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff04b0700 (LWP 8118)]
DCItem::processNewValue (this=0x7ffe2f3a7410, tmTimeStamp=tmTimeStamp@entry=1680668319, originalValue=originalValue@entry=0x7ffc8bcad844 L"20", updateStatus=0x7ffff04a9b97) at dcitem.cpp:698
698    dcitem.cpp: No such file or directory.
(gdb) bt
#0  DCItem::processNewValue (this=0x7ffe2f3a7410, tmTimeStamp=tmTimeStamp@entry=1680668319, originalValue=originalValue@entry=0x7ffc8bcad844 L"20", updateStatus=0x7ffff04a9b97) at dcitem.cpp:698
#1  0x00007ffff7c18dee in DataCollectionTarget::processNewDCValue (this=this@entry=0x7ffe2ef49010, dcObject=std::shared_ptr<DCObject> (use count 2, weak count 0) = {...}, currTime=currTime@entry=1680668319,
    itemValue=0x7ffc8bcad844 L"20", tableValue=std::shared_ptr<Table> (empty) = {...}) at /usr/include/c++/8/bits/shared_ptr_base.h:1018
#2  0x00007ffff7beb450 in F_PushDCIData (argc=<optimized out>, argv=0x7ffc8bc15400, ppResult=0x7ffff04a9c50, vm=0x7ffc8bc42000) at /usr/include/c++/8/bits/shared_ptr_base.h:614
#3  0x00007ffff7a20547 in NXSL_VM::callExternalFunction (stackItems=3, function=<optimized out>, this=0x7ffc8bc42000) at ../../include/nxsl_classes.h:201
#4  NXSL_VM::callExternalFunction (this=0x7ffc8bc42000, function=<optimized out>, stackItems=3) at vm.cpp:2675
#5  0x00007ffff7a24ea7 in NXSL_VM::execute (this=0x7ffc8bc42000) at vm.cpp:1411
#6  0x00007ffff7a297c8 in NXSL_VM::run (this=this@entry=0x7ffc8bc42000, args=..., globals=globals@entry=0x0, expressionVariables=expressionVariables@entry=0x0, constants=constants@entry=0x0, entryPoint=entryPoint@entry=0x0)
    at vm.cpp:391
#7  0x00007ffff7a29c42 in NXSL_VM::run (this=this@entry=0x7ffc8bc42000, argc=argc@entry=1, argv=argv@entry=0x7ffff04aa040, globals=globals@entry=0x0, expressionVariables=expressionVariables@entry=0x0, constants=constants@entry=0x0,
    entryPoint=0x0) at vm.cpp:321
#8  0x00007ffff7c10dca in DCTable::transform (this=this@entry=0x7ffe2f140610, value=std::shared_ptr<Table> (use count 2, weak count 0) = {...}) at ../../../include/nxsl_classes.h:1427
#9  0x00007ffff7c116e9 in DCTable::processNewValue (this=0x7ffe2f140610, timestamp=timestamp@entry=1680668319, value=std::shared_ptr<Table> (use count 2, weak count 0) = {...}, updateStatus=updateStatus@entry=0x7ffff04aa527)
    at dctable.cpp:357
#10 0x00007ffff7c18d9c in DataCollectionTarget::processNewDCValue (this=0x7ffe2ef49010, dcObject=std::shared_ptr<DCObject> (use count 2, weak count 0) = {...}, currTime=currTime@entry=1680668319,
    itemValue=itemValue@entry=0x7ffff04aad60 L"", tableValue=std::shared_ptr<Table> (use count 2, weak count 0) = {...}) at /usr/include/c++/8/bits/shared_ptr_base.h:1018
#11 0x00007ffff7be49c8 in DataCollector (dcObject=std::shared_ptr<DCObject> (use count 2, weak count 0) = {...}) at /usr/include/c++/8/bits/shared_ptr_base.h:762
#12 0x00007ffff7c22afa in __ThreadPoolExecute_SharedPtr_Wrapper<DCObject> (arg=0x7ffc8c000020) at ../../../include/nms_threads.h:990
#13 0x00007ffff794c21e in ProcessSerializedRequests (data=0x7ffc8c00b050) at tp.cpp:487
#14 0x00007ffff794c066 in WorkerThread (threadInfo=0x7fffeb5b15b0) at tp.cpp:199
#15 0x00007ffff794de4a in ThreadCreate_Wrapper_1<WorkerThreadInfo*> (context=0x7fffeb5b15c0) at ../../include/nms_threads.h:536
#16 0x00007ffff779ffa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#17 0x00007ffff6ec206f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)
#12
General Support / Re: Netonix MIB ?
July 15, 2021, 08:13:09 AM
Have attached a template I use on the Netonix WS-12-250-AC/DC and WS-24-400A models.
Probably has some stuff you're not interested in, but may be of help.
#13
Was stuck on this as well. The use of '.getThresholds().add()' solved it for me:

DataCollectionConfiguration objDcc = objNxcSession.openDataCollectionConfiguration(intTemplateId);
DataCollectionItem objDci = new DataCollectionItem(objDcc, 0);

Threshold objThreshold = new Threshold();

objThreshold.setFunction(Threshold.F_DIFF); // "Diff with previous value", for example
// define additional threshold parameters...

objDci.getThresholds().add(objThreshold);
objDcc.modifyObject(objDci);
#14
General Support / Re: SNMP Trap Parsing
September 23, 2020, 10:47:30 AM
I dealt with something similar recently, a single trap with a variable severity parameter. This is how I handled it (I'll frame it in terms of your trap name/parameters):

In the 'Transformation' section of the SNMP Trap configuration I convert the integer 'severity' to a string, and modify the event severity:

switch ($event->parameters[5])
{
case "1":
$event->setSeverity(4);
SetEventParameter($event, "4", "critical");
break;
case "2":
$event->setSeverity(3);
SetEventParameter($event, "4", "major");
break;
case "3":
$event->setSeverity(2);
SetEventParameter($event, "4", "minor");
break;
case "4":
$event->setSeverity(1);
SetEventParameter($event, "4", "warning");
break;
case "5":
$event->setSeverity(0);
SetEventParameter($event, "4", "cleared");
break;
case "6":
$event->setSeverity(0);
SetEventParameter($event, "4", "information");
break;
default:
$event->setSeverity(5);
SetEventParameter($event, "4", "unknown");
}
return;


The trap calls an event 'COMMSCOPE_ALERT' with Severity set to 'Normal', and the Message field set to something like 'Severity: %5, Reason: %3'.

I then have two Event Processing Policies:

Generate Commscope alarm
   Condition
      Events: COMMSCOPE_ALERT
      Severity Filter: all options ticked
   Filter Script
      // Adjust the severity of the current event to reflect the value passed from the trap
      // Drop events with severity != critical/major/minor/warning
      switch ($event->parameters[5])
      {
         case "critical":
            $event->setSeverity(4);
            return true;
         case "major":
            $event->setSeverity(3);   
            return true;
         case "minor":
            $event->setSeverity(2);   
            return true;
         case "warning":
            $event->setSeverity(1);
            return true;
         default:
            return false;
      }
   Action
      Alarm
         'Create new alarm'
         Message: %m
         Alarm key: %n:%N
         Alarm severity: From event
         
Terminate Commscope alarm
   Condition
      Events: COMMSCOPE_ALERT
      Severity Filter: only 'Normal' ticked
   Action
      Alarm
         'Terminate alarms'
         Terminate all alarms with key: %n:%N

Alarms should get created when a trap with critical/major/minor/warning severity arrives, and should get terminated when the same trap arrives with any other value.

And, of course, this is only one (and not necessarily the best) way of achieving this :)
#15
General Support / Re: Linux Agent
June 13, 2020, 02:52:22 AM
The key line in the output here is:

   [12.06.2020 17:33:14]    Cannot connect to NetXMS agent (Connect failed)

This means the server was not able to talk to the agent. Things to check:

   - does the server have connectivity to the agent, e.g. can it ping it
   - make sure you have 'MasterServers=<server_ip_address>' in the '/etc/nxagentd.conf' file
   - if the box the agent is running on has a firewall then make sure TCP port 4700 is open to the server

If the agent isn't directly addressable from the server (e.g. it's NATed), or if there's firewalling involved you can't change, then you would need to use the agent in the 'Agent to server connection' mode discussed in the Administrator Guide.