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

Topics - rhodri

#1
hi guys and girls,
bit of a question I have about setting the display name based of another SNMP query the data is as follows 

1.3.6.1.4.1.14988.1.1.19.1.1.2.11 [STRING] = sfp11
1.3.6.1.4.1.14988.1.1.19.1.1.2.12 [STRING] = sfp12
1.3.6.1.4.1.14988.1.1.19.1.1.3.11 [INTEGER] = 0
1.3.6.1.4.1.14988.1.1.19.1.1.3.12 [INTEGER] = 1
1.3.6.1.4.1.14988.1.1.19.1.1.4.11 [INTEGER] = 0
1.3.6.1.4.1.14988.1.1.19.1.1.4.12 [INTEGER] = 0
1.3.6.1.4.1.14988.1.1.19.1.1.5.11 [GAUGE32] = 131000
1.3.6.1.4.1.14988.1.1.19.1.1.5.12 [GAUGE32] = 85000
1.3.6.1.4.1.14988.1.1.19.1.1.6.11 [GAUGE32] = 30
1.3.6.1.4.1.14988.1.1.19.1.1.6.12 [GAUGE32] = 41
1.3.6.1.4.1.14988.1.1.19.1.1.7.11 [GAUGE32] = 3290
1.3.6.1.4.1.14988.1.1.19.1.1.7.12 [GAUGE32] = 3256
1.3.6.1.4.1.14988.1.1.19.1.1.8.11 [GAUGE32] = 17
1.3.6.1.4.1.14988.1.1.19.1.1.8.12 [GAUGE32] = 4
1.3.6.1.4.1.14988.1.1.19.1.1.9.11 [INTEGER] = -5468
1.3.6.1.4.1.14988.1.1.19.1.1.9.12 [INTEGER] = -6800
1.3.6.1.4.1.14988.1.1.19.1.1.10.11 [INTEGER] = -1407
1.3.6.1.4.1.14988.1.1.19.1.1.10.12 [INTEGER] = 0

I have tried this to get something but all I get is an error: Minor netxms1 SYS_SCRIPT_ERROR Script (DCI::TheDevice::8963::InstanceFilter) execution error: Error 15 in line 1: Unknown object's attribute 
dd = $node.createSNMPTransport()?.getValue(".1.3.6.1.4.1.14988.1.1.19.1.1.2.".$1);
if(dd!=NULL) {
return [true, $1, dd];
}

return [true, $1, $1];

if I try getting the data via a seperate script and replace $node with the device it works any help would be great im new to Netxms and Scripting.

Thanks 
Rhodri

#2
General Support / Geo Location Scripting Issue
July 04, 2021, 03:09:05 AM
right very simple one for one of you scripting gods lol

firstly I'm using Mikrotik router boards and I have a a GPS fitted to a few of them and for a bit of a mess about was thinking on using them to track a few assets mainly out of interest. I saw a script which I guess would do the job but..


transport = CreateSNMPTransport($node);
if (transport == null) {
  return null;
}

lat = SNMPGetValue(transport, ".1.3.6.1.4.1.14988.1.1.12.3.0");
long = SNMPGetValue(transport, ".1.3.6.1.4.1.14988.1.1.12.2.0");

if (lat == null || long == null) {
  return null;
}
println lat;
println long;

geoLoc =new GeoLocation(lat, long, 1);
$node->setGeoLocation(geoLoc);
return 0;



but I get this as an error. which seems a little odd I suspect its the '' at the end so tried to use the replace function but that doesn't work and I get Function not found as a returned error


N 00 00' 0.000''
W 0 00' 0.000''
Error 4 in line 15: Bad arithmetic conversion


I also tried to strip the chars with no real effect.. oddly enough if I copy and paste the returned values (not including the '') into the geo location on the device properties it works fine but I really want to automate this process to be fair.

Thanks
Rhodri
#3
right a really odd issue, I have about 14 crs112 switches and a few ubnt radios in the the network plus a butt load of mikrotik routers and other kit ccr1009's no issue even the rb2011 add on fine but the CRS112, and UBNT radios just won't find the interfaces. I tried first by command line

nxsnmpwalk -v 1 -c public [ip] .1.3.6.1.2.1.2.2.1.2 and would get -> SNMP Error: Request timed out

on the same server using..

snmpwalk -v 1 -c public [ip] .1.3.6.1.2.1.2.2.1.2
iso.3.6.1.2.1.2.2.1.2.1 = STRING: "lo"
iso.3.6.1.2.1.2.2.1.2.2 = STRING: "eth0"
iso.3.6.1.2.1.2.2.1.2.3 = STRING: "eth1"
iso.3.6.1.2.1.2.2.1.2.4 = STRING: "wifi0"
iso.3.6.1.2.1.2.2.1.2.5 = STRING: "ath0"
iso.3.6.1.2.1.2.2.1.2.6 = STRING: "eth0.100"
iso.3.6.1.2.1.2.2.1.2.7 = STRING: "ath0.100"
iso.3.6.1.2.1.2.2.1.2.8 = STRING: "eth0.1000"
iso.3.6.1.2.1.2.2.1.2.9 = STRING: "ath0.1000"
iso.3.6.1.2.1.2.2.1.2.10 = STRING: "ath0.400"
iso.3.6.1.2.1.2.2.1.2.11 = STRING: "eth0.400"
iso.3.6.1.2.1.2.2.1.2.12 = STRING: "eth0.10"
iso.3.6.1.2.1.2.2.1.2.13 = STRING: "ath0.10"
iso.3.6.1.2.1.2.2.1.2.14 = STRING: "br0"
iso.3.6.1.2.1.2.2.1.2.15 = STRING: "br1"
iso.3.6.1.2.1.2.2.1.2.16 = STRING: "br2"
iso.3.6.1.2.1.2.2.1.2.17 = STRING: "br3"
iso.3.6.1.2.1.2.2.1.2.18 = STRING: "br4"

i suspect its a naming issue of some description but I have no real clue where to start?