# Using openweathermap with influxdb,telegraf,andgrafana

**URL:** <https://community.influxdata.com/t/using-openweathermap-with-influxdb-telegraf-andgrafana/21910>\
**Category:** Telegraf\
**Created:** [September 30, 2021, 4:18pm UTC](https://community.influxdata.com/t/using-openweathermap-with-influxdb-telegraf-andgrafana/21910 "2021-09-30T16:18:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mohamed/32/8438_2.png) [@mohamed](https://community.influxdata.com/u/mohamed)\
**Post date:** [September 30, 2021, 4:18pm UTC](https://community.influxdata.com/t/using-openweathermap-with-influxdb-telegraf-andgrafana/21910/1 "2021-09-30T16:18:24Z")

</div>

hello everyone  
i’m trying to use telegraf plugin with influxdb to get data from openweathermap and visualize it on grafana.

i was using influxdb with nodred and grafana to visualize sensor data  
so i have influxdb and grafana already installed on my raspberry  
for my new aim (openweathermap) , I installed telegraf and modified its config file to add the API and city ID.

I tested telegraf and i get data as shown

 ![Capture](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/2/27b3790adca2e4d8e6ac500547e67dfcb0d9f937.png)

but i can’t get the data in influxdb !!!  
could anyone help me ?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [September 30, 2021, 9:37pm UTC](https://community.influxdata.com/t/using-openweathermap-with-influxdb-telegraf-andgrafana/21910/2 "2021-09-30T21:37:26Z")

</div>

Hello @mohamed,  
i’m going a little blind trying to read that output. Can you please copy and paste some of the openweathermap line protocol?  
Thank you.

---

<div class="post-metadata">

**Author:** ![mohamed](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mohamed/32/8438_2.png) [@mohamed](https://community.influxdata.com/u/mohamed)\
**Post date:** [October 1, 2021, 5:42pm UTC](https://community.influxdata.com/t/using-openweathermap-with-influxdb-telegraf-andgrafana/21910/3 "2021-10-01T17:42:56Z")

</div>

> Blockquote  
> pi@raspberrypi:~ $ sudo telegraf -test -config /etc/telegraf/telegraf.conf  
> 2021-10-01T17:41:21Z I! Starting Telegraf 1.20.0  
> swap,host=raspberrypi free=104853504i,total=104853504i,used=0i,used\_percent=0 1633110082000000000  
> swap,host=raspberrypi in=0i,out=0i 1633110082000000000  
> mem,host=raspberrypi active=127643648i,available=670281728i,available\_percent= 69.16499716819246,buffered=37244928i,cached=452354048i,commit\_limit=589406208i,c ommitted\_as=1127038976i,dirty=28672i,free=247742464i,high\_free=0i,high\_total=0i, huge\_page\_size=0i,huge\_pages\_free=0i,huge\_pages\_total=0i,inactive=526454784i,low \_free=0i,low\_total=0i,mapped=241147904i,page\_tables=5070848i,shared=13385728i,sl ab=47448064i,sreclaimable=31596544i,sunreclaim=15851520i,swap\_cached=0i,swap\_fre e=104853504i,swap\_total=104853504i,total=969105408i,used=231763968i,used\_percent =23.915248649608195,vmalloc\_chunk=0i,vmalloc\_total=1140850688i,vmalloc\_used=3870 720i,write\_back=0i,write\_back\_tmp=0i 1633110082000000000  
> system,host=raspberrypi load1=0.01,load15=0.16,load5=0.24,n\_cpus=4i,n\_users=3i 1633110082000000000  
> system,host=raspberrypi uptime=380i 1633110082000000000  
> system,host=raspberrypi uptime\_format=" 0:06" 1633110082000000000  
> kernel,host=raspberrypi boot\_time=1633109702i,context\_switches=406590i,entropy \_avail=3079i,interrupts=334935i,processes\_forked=1415i 1633110082000000000  
> diskio,host=raspberrypi,name=mmcblk0 io\_time=33040i,iops\_in\_progress=0i,merged \_reads=9282i,merged\_writes=1276i,read\_bytes=449423360i,read\_time=100951i,reads=1 1533i,weighted\_io\_time=118381i,write\_bytes=9950208i,write\_time=17430i,writes=743 i 1633110082000000000  
> diskio,host=raspberrypi,name=mmcblk0p1 io\_time=1330i,iops\_in\_progress=0i,merge d\_reads=3989i,merged\_writes=0i,read\_bytes=11281408i,read\_time=1620i,reads=218i,w eighted\_io\_time=1724i,write\_bytes=1024i,write\_time=104i,writes=2i 16331100820000 00000  
> diskio,host=raspberrypi,name=mmcblk0p2 io\_time=32630i,iops\_in\_progress=0i,merg ed\_reads=5293i,merged\_writes=1276i,read\_bytes=437601280i,read\_time=99287i,reads= 11295i,weighted\_io\_time=116613i,write\_bytes=9949184i,write\_time=17325i,writes=74 1i 1633110082000000000  
> disk,device=mmcblk0p2,fstype=ext4,host=raspberrypi,mode=rw,path=/ free=1033530 1632i,inodes\_free=784400i,inodes\_total=922944i,inodes\_used=138544i,total=1491253 6576i,used=3916734464i,used\_percent=27.481929161681517 1633110082000000000  
> disk,device=mmcblk0p1,fstype=vfat,host=raspberrypi,mode=rw,path=/boot free=214 328832i,inodes\_free=0i,inodes\_total=0i,inodes\_used=0i,total=264289280i,used=4996 0448i,used\_percent=18.903698250644144 1633110082000000000  
> processes,host=raspberrypi blocked=0i,dead=0i,idle=47i,paging=0i,running=0i,sl eeping=93i,stopped=0i,total=140i,total\_threads=256i,unknown=0i,zombies=0i 163311 0082000000000

Blockquote

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [October 4, 2021, 3:44pm UTC](https://community.influxdata.com/t/using-openweathermap-with-influxdb-telegraf-andgrafana/21910/4 "2021-10-04T15:44:50Z")

</div>

Hello @mohamed,  
2021-10-01T17:41:21Z I! Starting Telegraf 1.20.0  
swap,host=raspberrypi free=104853504i,total=104853504i,used=0i,used\_percent=0 1633110082000000000  
swap,host=raspberrypi in=0i,out=0i 1633110082000000000  
mem,host=raspberrypi active=127643648i,available=670281728i,available\_percent= 69.16499716819246,buffered=37244928i,cached=452354048i,commit\_limit=589406208i,c ommitted\_as=1127038976i,dirty=28672i,free=247742464i,high\_free=0i,high\_total=0i, huge\_page\_size=0i,huge\_pages\_free=0i,huge\_pages\_total=0i,inactive=526454784i,low \_free=0i,low\_total=0i,mapped=241147904i,page\_tables=5070848i,shared=13385728i,`sl <---` ab=47448064i,sreclaimable=31596544i,sunreclaim=15851520i,swap\_cached=0i,`swap_fre <---`e=104853504i,swap\_total=104853504i,total=969105408i,used=231763968i,used\_percent =23.915248649608195,vmalloc\_chunk=0i,vmalloc\_total=1140850688i,vmalloc\_used=3870 720i,write\_back=0i,write\_back\_tmp=0i 1633110082000000000  
system,host=raspberrypi load1=0.01,load15=0.16,load5=0.24,n\_cpus=4i,n\_users=3i 1633110082000000000  
system,host=raspberrypi uptime=380i 1633110082000000000  
system,host=raspberrypi uptime\_format=" 0:06" 1633110082000000000  
kernel,host=raspberrypi boot\_time=1633109702i,context\_switches=406590i,entropy \_avail=3079i,interrupts=334935i,processes\_forked=1415i 1633110082000000000  
diskio,host=raspberrypi,name=mmcblk0 io\_time=33040i,iops\_in\_progress=0i,merged \_reads=9282i,merged\_writes=1276i,read\_bytes=449423360i,read\_time=100951i,reads=1 1533i,weighted\_io\_time=118381i,write\_bytes=9950208i,write\_time=17430i,writes=`743 i <---` 1633110082000000000  
diskio,host=raspberrypi,name=mmcblk0p1 io\_time=1330i,iops\_in\_progress=0i,merge d\_reads=3989i,merged\_writes=0i,read\_bytes=11281408i,read\_time=1620i,reads=218i,w eighted\_io\_time=1724i,write\_bytes=1024i,write\_time=104i,writes=2i 16331100820000 00000  
diskio,host=raspberrypi,name=mmcblk0p2 io\_time=32630i,iops\_in\_progress=0i,merg ed\_reads=5293i,merged\_writes=1276i,read\_bytes=437601280i,read\_time=99287i,reads= 11295i,weighted\_io\_time=116613i,write\_bytes=9949184i,write\_time=17325i,writes=74 `1i <--` 1633110082000000000  
disk,device=mmcblk0p2,fstype=ext4,host=raspberrypi,mode=rw,path=/ free=1033530 1632i,inodes\_free=784400i,inodes\_total=922944i,inodes\_used=138544i,total=1491253 6576i,used=3916734464i,used\_percent=27.481929161681517 1633110082000000000  
disk,device=mmcblk0p1,fstype=vfat,host=raspberrypi,mode=rw,path=/boot free=214 328832i,inodes\_free=0i,inodes\_total=0i,inodes\_used=0i,total=264289280i,used=4996 0448i,used\_percent=18.903698250644144 1633110082000000000  
processes,host=raspberrypi blocked=0i,dead=0i,idle=47i,paging=0i,running=0i,`sl <---`  
eeping=93i,stopped=0i,total=140i,total\_threads=256i,unknown=0i,zombies=0i 163311 0082000000000

Ive tried to highlight some mistakes in the line protocol that I see what what you’ve shared. I don’t know if most of the spaces are a copy and paste error, but that could contributing to the failure…so I’d verify that there aren’t unwanted spaces in my output.

Also I noticed that one of your fields is `writes=743 i` and another is `writes=74 1i` that space would be causing problems as well (assuming its not a typo from copy and paste)

Can you please share your telegraf config?
