# Snmp walker -\> influxdb

**URL:** <https://discourse.nodered.org/t/snmp-walker-influxdb/27529>\
**Category:** General\
**Created:** [30 May 2020 15:00 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529 "2020-05-30T15:00:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![maccoa](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maccoa](https://discourse.nodered.org/u/maccoa)\
**Post date:** [30 May 2020 15:00 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/1 "2020-05-30T15:00:18Z")

</div>

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

 ![walker](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/5278420cbaa5f0c8f6d5e821da8c66f33cca589e.png)  
is it possible in one operation, to insert in a measurement all the infos.

example.  
database snmp.  
measurement UPS  
field1  
field2  
\*  
\*

- field 75  
currently I have 1 OID a measurement. ![subflow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3cd4e8dad523a425fe0a8fa5958186b7792fb88b.png)

merci beaucoup

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 May 2020 15:24 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/2 "2020-05-30T15:24:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 May 2020 15:54 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/3 "2020-05-30T15:54:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![maccoa](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maccoa](https://discourse.nodered.org/u/maccoa)\
**Post date:** [30 May 2020 18:22 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/4 "2020-05-30T18:22:49Z")

</div>

thank you so much

 ![influx](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/4/d43b1d735d8a910a97ff9a6a092dc44de2f82b1f.png)  
there is only one inverter connected to work but twenty printers, this will be very useful to me.

Once again thank you

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 May 2020 19:45 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/5 "2020-05-30T19:45:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maccoa](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maccoa](https://discourse.nodered.org/u/maccoa)\
**Post date:** [30 May 2020 22:15 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/6 "2020-05-30T22:15:28Z")

</div>

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.

 ![name](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/a/1a46f193b0a546a4a83d1b2fbfd30653a457c7d5.png)

---

<div class="post-metadata">

**Author:** ![maccoa](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maccoa](https://discourse.nodered.org/u/maccoa)\
**Post date:** [6 June 2020 09:11 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/7 "2020-06-06T09:11:17Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 June 2020 09:58 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/8 "2020-06-06T09:58:11Z")

</div>

> [@maccoa](#):
>
> if with "joint" I return the 15 messages, without the tag\_voie it works.  
> with the tag\_voie it always returns the last one.

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

---

<div class="post-metadata">

**Author:** ![maccoa](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maccoa](https://discourse.nodered.org/u/maccoa)\
**Post date:** [6 June 2020 10:42 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/9 "2020-06-06T10:42:32Z")

</div>

sorry.I will try to explain myself better.

 ![Capture du 2020-06-06 12-35-00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e8bbea8f0adbdf0d6f600bce526c089255cd4cd.png)  
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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 June 2020 10:46 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/10 "2020-06-06T10:46:04Z")

</div>

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]]`

---

<div class="post-metadata">

**Author:** ![maccoa](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maccoa](https://discourse.nodered.org/u/maccoa)\
**Post date:** [6 June 2020 13:41 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/11 "2020-06-06T13:41:31Z")

</div>

my output node join

 ![Capture du 2020-06-06 14-03-58](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d95ba99f1506d5c22ac6e9cf7276b92d5df39687.png)

and as soon as I test to add {tag1, tag2}  
I get more or less  
 ![Capture du 2020-06-06 15-38-30](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd327401c225b65afb734df8eae513e590987ac5.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 June 2020 13:51 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/12 "2020-06-06T13:51:50Z")

</div>

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](https://nodered.org/docs/user-guide/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

```auto
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;

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 August 2020 14:01 UTC](https://discourse.nodered.org/t/snmp-walker-influxdb/27529/13 "2020-08-05T14:01:32Z")

</div>

Closed on 5 August 2020 14:01 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
