Snmp walker -> influxdb

Good morning all .
I just tested snmpwalker node, (very practical to retrieve all the information at once).
the result


is it possible in one operation, to insert in a measurement all the infos.

example.
database snmp.
measurement UPS
field1
field2
*
*

merci beaucoup

You can put them all in one measurement if you set the field names appropriately. The info panel for the influx node tells you how to set the field names

Or to summarise you need to make one message where the payload contains something like
{voltage: 7.6, capacity: 99, ...}
and that will be stored with the current time as the timestamp in the measurement specified in the node and the field names voltage, capacity etc.

thank you so much


there is only one inverter connected to work but twenty printers, this will be very useful to me.

Once again thank you

1 Like

Shouldn't the host name or something be a tag rather than a field? So you can query efficiently on individual devices.

for ups this is the only one i have to query, but for printers i will try to do what you say.
with snmpB it's easier to find the mib and also find the devices.

I'm really having trouble writing a function to write to influx.
what I'm trying to do:

msg.payload = [{
ChambreFroid: msg.payload.ChambreFroid,
Chambre210: msg.payload.Chambre210,
BankSang: msg.payload.BankSang,
RetourEcsChauferie: msg.payload.RetourEcsChauferie,
DoucheFace101: msg.payload.DoucheFace101,
DoucheFace126: msg.payload.DoucheFace126,
FrigoBloc: msg.payload.FrigoBloc,
EauFroidNBal: msg.payload.EauFroidNBal,
DoucheCh4: msg.payload.DoucheCh4,
DepartBalSousStation: msg.payload.DepartBalSousStation,
FrigoPharma: msg.payload.FrigoPharma,
DepEcsChauferie: msg.payload.DepEcsChauferie,
RetourEcsSousStation: msg.payload.RetourEcsSousStation,
EcsBoucleVestiaire: msg.payload.EcsBoucleVestiaire,
LocalInfoRdc: msg.payload.LocalInfoRdc
  
},
{
    Device:msg.device,
    Voie:msg.topic
}];
return msg;



if with "joint" I return the 15 messages, without the tag_voie it works.
with the tag_voie it always returns the last one.

should we write a function for each chanel? or can we do it in one function?

Sorry, I don't understand what any of that means.

sorry.I will try to explain myself better.


I try with a single function to insert in a base influx, tag 1 tag2 and the value
[{xx: value}, {tag1, tag2}]
i don't know if this is much clearer

You have told it to send the two messages to different outputs of the function node, if you want them both to go to the same output you need
return [[msg1,msg2]]

my output node join

and as soon as I test to add {tag1, tag2}
I get more or less
Capture du 2020-06-06 15-38-30

When posting functions please copy/paste it here, it is difficult to read screenshots. Thanks.

Did you see my previous post? You are now trying to send the fifteen messages to fifteen different outputs rather than sending them one after another to the same output.
See Writing Functions for how to do it (and lots of other good stuff).

Edit, but why are you sending mulitple messages anyway? It would be more efficient to do all in one message as you posted earlier

msg.payload = [{
ChambreFroid: msg.payload.ChambreFroid,
Chambre210: msg.payload.Chambre210,
BankSang: msg.payload.BankSang,
RetourEcsChauferie: msg.payload.RetourEcsChauferie,
DoucheFace101: msg.payload.DoucheFace101,
DoucheFace126: msg.payload.DoucheFace126,
FrigoBloc: msg.payload.FrigoBloc,
EauFroidNBal: msg.payload.EauFroidNBal,
DoucheCh4: msg.payload.DoucheCh4,
DepartBalSousStation: msg.payload.DepartBalSousStation,
FrigoPharma: msg.payload.FrigoPharma,
DepEcsChauferie: msg.payload.DepEcsChauferie,
RetourEcsSousStation: msg.payload.RetourEcsSousStation,
EcsBoucleVestiaire: msg.payload.EcsBoucleVestiaire,
LocalInfoRdc: msg.payload.LocalInfoRdc
  
},
{
    Device:msg.device,
    Voie:msg.topic
}];
return msg;