[Solved] MikroTik templating-problem with voltage an wireless clients DCIs

Started by iwannabe.r00t, December 09, 2016, 11:34:09 AM

Previous topic - Next topic

iwannabe.r00t

Hello, I'm sorry for asking simple question again.
Ive done MikroTik template(in attachment) with following apply rule:
return $node->driver  == "MIKROTIK";

Almost everything working. But when template was applied on rb without voltage sensor(OID: .1.3.6.1.4.1.14988.1.1.3.8.0) NetXMS generate alarm. Ive tried to use instance discovery in template and script, but Im doing something wrong and cant skip applying this particular DCI for host without sensor.

SNMP Out for hosts with and witout sensor:
snmpwalk -v2c -c maincommunity 192.168.x.x .1.3.6.1.4.1.14988.1.1.3.8
iso.3.6.1.4.1.14988.1.1.3.8.0 = INTEGER: 257

snmpwalk -v2c -c maincommunity 192.168.x.x .1.3.6.1.4.1.14988.1.1.3.8
iso.3.6.1.4.1.14988.1.1.3.8 = No Such Object available on this agent at this OID

I know that isn't NetXMS, but main lack of knowlege about NXSL. I ask that you kindly provide a single example of filter that stops of creating DCI on node without voltage sensor.

Second problem is about MT's oid for number of wireless client's conected( .1.3.6.1.4.1.14988.1.1.1.4). When I do MIB walk value is correct, but when I create DCI(in template or direct on host) is always "UNSUPPORTED".

Than You in advance.


iwannabe.r00t

New post only for refresh purpose.
Ive tried instance discovery with following code:
transport = CreateSNMPTransport($node);
if (transport == null)
{
    return false;
}

value = SNMPGetValue(transport, ".1.3.6.1.4.1.14988.1.1.3.8.0");
if (value == null)
{
    return false;
}
else
{
   return true;
}

Type : Script
Parameter: .1.3.6.1.4.1.14988.1.1.3.8

No results

Victor Kirhenshtein

Hi,

simplest way is to define instance discovery DCI with SNMP based discovery:

1. use parameter name .1.3.6.1.4.1.14988.1.1.3.8.{instance}
2. set origin to SNMP
3. set instance discovery method to "SNMP Walk - OIDs"
4. set base SNMP OID to .1.3.6.1.4.1.14988.1.1.3.8
5. leave filter script empty

Such instance discovery DCI will create single instance .1.3.6.1.4.1.14988.1.1.3.8.0 when it is supported and will not create anything when it is not supported.

As for .1.3.6.1.4.1.14988.1.1.1.4 - you should use .1.3.6.1.4.1.14988.1.1.1.4.0 as parameter name (you can see full OID in walk result).

Best regards,
Victor

iwannabe.r00t

Thak You Sir.
It is working. Before answer Ive resolved problem other way(file without 001 ending i attachments).
Ive attached my MikroTik templates(file with 001 is corrected as Mr Victor suggested to deal with that voltage OID) for everyone.

Template's DCI's:
-CPU usage
-MEM Usage
-Voltage
-Count of Wireless Clients
-Speed/Packets of all interfaces(interfaces with "vl" and "br" in names are not included)
-RouterOS and Firmware version
-Board Name
-Ping