News:

We really need your input in this questionnaire

Main Menu
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: 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

#2
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

#3
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.

#4
Hi Victor,

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

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

I've worked around the problem for now, so will wait and see if the patch fixes it.
#6
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)
#7
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.
#8
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);
#9
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 :)
#10
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.
#11
General Support / Re: Linux Agent
June 12, 2020, 03:28:19 PM
Looks like you struck the same issue with Mint that I did, where 'libssl1.0.2' isn't installed.

Assuming you are on an Intel/AMD 64-bit platform then you can download its Debian package from the command line using:

      wget http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb

then run:

      sudo apt-get install ./libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb
      sudo apt-get install netxms-agent

That should get the agent installed.
#12
General Support / Re: Linux Agent
June 11, 2020, 12:32:57 PM
I did an agent install on Mint 19.2 recently. Here are my notes - hope they help:


In '/etc/apt/sources.list.d' create new file 'netxms.list' and add the following line:

   deb http://packages.netxms.org/debian/ stretch main
   
Install NetXMS agent with:

   wget -q -O - http://packages.netxms.org/netxms.gpg | sudo apt-key add -
   apt-get update
   apt-get install netxms-agent

(In my case I got the following error:

      The following packages have unmet dependencies:
      netxms-agent : Depends: netxms-base (= 3.3.350-1) but it is not going to be installed
            Depends: netxms-dbdrv-sqlite3 (= 3.3.350-1) but it is not going to be installed
            Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
            Depends: libssl1.0.2 (>= 1.0.2d) but it is not installable

   ...so downloaded the libssl1.02 package from 'https://packages.debian.org/stretch/libssl1.0.2' and ran the following:

      apt install ./libssl1.0.2_1.0.2u-1_deb9u1_amd64.deb
      apt-get install libcurl3
      apt-get install netxms-agent
)

In '/etc/nxagentd.conf' uncomment the 'MasterServers' attribute and change its value to the NetXMS server DNS or IP address

Set the agent to start at boot, and then start it:

   systemctl enable nxagentd
   systemctl start nxagentd

Make sure it's running:

   service nxagentd status
   
Should now be able to register the agent on the server as per section 6.5.1 of the admin guide.
#13
Trying to do a transformation on a trap parameter. Have tried doing it this way:

oid = $1;
status = $2;
newStatus = "unknown";

switch (status)
{
   case "1"
      newStatus = "up";
      break;
   case "2":
      newStatus = "down";
      break;
}

return %(oid, newStatus);


It doesn't appear to work though, so how should I reference (and return) the parameter values?

Thanks.