Hello!
When I’m using more than one CustomOID’s in LibreNMS, their data is stored to InfluxDB without any specific tags (like "id’ or ‘description’) - only device hostname.
It’s impossible to separate data from different Sensors of CustomOID type in InfluxDB.
Any idea how I can solve this?
==== how this problem is looks like in poller: (one of my customOID’s)
array (
‘customoid_id’ => 10,
‘device_id’ => 6,
‘customoid_descr’ => ‘Broadlink Power’,
‘customoid_deleted’ => 0,
‘customoid_current’ => 69.56,
‘customoid_prev’ => 69.24,
‘customoid_oid’ => ‘.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.115.112.51.95.112.111.119.101.114.1’,
‘customoid_datatype’ => ‘’,
‘customoid_unit’ => ‘W’,
‘customoid_divisor’ => 1,
‘customoid_multiplier’ => 1,
‘customoid_limit’ => 80.0,
‘customoid_limit_warn’ => NULL,
‘customoid_limit_low’ => 30.0,
‘customoid_limit_low_warn’ => NULL,
‘customoid_alert’ => 1,
‘customoid_passed’ => 1,
‘lastupdate’ => ‘2020-09-15 08:55:06’,
‘user_func’ => NULL,
)
SNMP[’/usr/bin/snmpget’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-Oqv’ ‘-M’ ‘/opt/librenms/mibs:/opt/librenms/mibs/supermicro - dell’ ‘udp:HOSTNAME:161’ ‘.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.115.112.51.95.112.111.119.101.114.1’]
69.36
Custom OID Broadlink Power: 69.36 W
InfluxDB data: {“measurement”:“customoid”,“tags”:{“hostname”:“hive”},“fields”:{“oid_value”:69.36}}
SQL[UPDATE customoids
set customoid_current
=?,lastupdate
=NOW(),customoid_prev
=? WHERE customoid_id
= ? [69.36,69.56,10] 7.82ms]
====== another ‘good’ working sensor example:
SQL[SELECT sensor_class
FROM sensors
WHERE device_id
= ? GROUP BY sensor_class
[6] 0.59ms]
SQL[SELECT * FROM sensors
WHERE sensor_class
= ? AND device_id
= ? [“fanspeed”,6] 0.69ms]
SNMP[’/usr/bin/snmpget’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-OUQnte’ ‘-M’ ‘/opt/librenms/mibs:/opt/librenms/mibs/supermicro - dell’ ‘udp:HOSTNAME:161’ ‘.1.3.6.1.4.1.2021.13.16.3.1.3.17’]
..4.1.2.1.3.17 = 1070
Checking (snmp) fanspeed fan2…
1070
InfluxDB data: {“measurement”:“sensor”,“tags”:{“hostname”:“hive”,“sensor_class”:“fanspeed”,“sensor_type”:“lmsensors”,“sensor_descr”:“fan2”,“sensor_index”:“17”},“fields”:{“sensor”:1070.0}}
SQL[UPDATE sensors
set sensor_current
=?,sensor_prev
=?,lastupdate
=NOW() WHERE sensor_class
= ? AND sensor_id
= ? [1070,1055,“Fanspeed”,120] 7.65ms]
(here I can use sensor_descr or sensor_index to get fn2 speed value)