# LibreNMS working with InfluxDB

**URL:** <https://community.influxdata.com/t/librenms-working-with-influxdb/1215>\
**Category:** Systems\
**Created:** [June 7, 2017, 6:09pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215 "2017-06-07T18:09:48Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 6:09pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/1 "2017-06-07T18:09:48Z")

</div>

I have been working to get LibreNMS set up with InfluxDB. I have created the DB in Influx and added the configs to config.php and validate.php does not show any errors. I have looked at the SERIES in the Influx DB librenms databse and I see that there something there but there isn’t any data associated with the series info.

When I debug the connection between LibreNMS and Influx I see the following error:

15:25:59.723808 IP (tos 0x0, ttl 64, id 57462, offset 0, flags [DF], proto TCP (6), length 52)  
localhost.8086 \> localhost.37620: Flags [F.], cksum 0xfe28 (incorrect -\> 0x1937), seq 111586, ack 236829, win 6721, options [nop,nop,TS val 135066 ecr 135066], length 0  
15:25:59.723824 IP (tos 0x0, ttl 64, id 38492, offset 0, flags [DF], proto TCP (6), length 52)  
localhost.37620 \> localhost.8086: Flags [.], cksum 0xfe28 (incorrect -\> 0x2770), seq 236829, ack 111587, win 3080, options [nop,nop,TS val 135066 ecr 135066], length 0

When I look at the PCAP file I would expect to see a POST that contains data that looks like POST cpu,host=serverA,region=us\_west value=0.64… But I just see Data: 706f6c6 etc.

I am not an Influx or LibreNMS guru so any help to figure this out would be greatly appreciated.

Thank you.

-Patrick

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 7, 2017, 6:32pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/2 "2017-06-07T18:32:26Z")

</div>

@papatango71 While I am an InfluxDB guru I am not a LibreNMS guru. Can you share the full POST request that is getting set to InfluxDB? I will also say that that error message is coming out of LibreNMS not InfluxDB.

I also found [this post on their forum](https://community.librenms.org/t/enable-influxdb-support-in-librenms/167/14) that might help.

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 6:42pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/3 "2017-06-07T18:42:44Z")

</div>

Here is my config.php config for influxdb:

## Added for InfluxDB

$config[‘influxdb’][‘enable’] = true;  
$config[‘influxdb’][‘transport’] = ‘http’; # Default, other options: https, udp  
$config[‘influxdb’][‘host’] = ‘127.0.0.1’;  
$config[‘influxdb’][‘port’] = ‘8086’;  
$config[‘influxdb’][‘db’] = ‘librenms’;

# $config[‘influxdb’][‘username’] = ‘admin’;

# $config[‘influxdb’][‘password’] = ‘admin’;

$config[‘influxdb’][‘timeout’] = 0; # Optional  
$config[‘influxdb’][‘verifySSL’] = false; # Optional

I am not using any authentication at this point… i am just confirming this works. I went through the post you recommended and I have done everything that is listed there. Where would I get the full POST request that is being sent to InfluxDB…?? The POST that I see in my pcap is as follows:

POST /write?db=librenms&precision=m HTTP/1.1\r\n

Thank you.

-Patrick

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 7, 2017, 6:44pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/4 "2017-06-07T18:44:02Z")

</div>

@papatango71 Are you seeing any errors in the `influxdb` logs? `/var/log/influxdb/influxdb.log` or `journalctl -u influxdb`

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 6:53pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/5 "2017-06-07T18:53:06Z")

</div>

> [@jackzampolin](#):
>
> journalctl -u influxdb

Seeing the following errors using journalctl -u influxdb:

Jun 07 15:45:25 librenms influxd[1213]: [httpd] 127.0.0.1 - - [07/Jun/2017:15:45:25 +0000] “POST /write?db=librenms&precision=n HTTP/1.1” 204 0 “-” “GuzzleHttp/6.0.2 curl/7.47.0 PHP/7.0.18-0ubuntu0.16.04.1” 52f94a39-4b98-11e7-92d1-000000000000  
Jun 07 15:45:25 librenms influxd[1213]: [httpd] 127.0.0.1 - - [07/Jun/2017:15:45:25 +0000] “POST /write?db=librenms&precision=n HTTP/1.1” 204 0 “-” “GuzzleHttp/6.0.2 curl/7.47.0 PHP/7.0.18-0ubuntu0.16.04.1” 52fa0ff0-4b98-11e7-92d2-000000000000  
Jun 07 15:45:25 librenms influxd[1213]: [httpd] 127.0.0.1 - - [07/Jun/2017:15:45:25 +0000] “POST /write?db=librenms&precision=n HTTP/1.1” 204 0 “-” “GuzzleHttp/6.0.2 curl/7.47.0 PHP/7.0.18-0ubuntu0.16.04.1” 52fad41c-4b98-11e7-92d3-000000000000  
Jun 07 15:45:25 librenms influxd[1213]: [httpd] 127.0.0.1 - - [07/Jun/2017:15:45:25 +0000] “POST /write?db=librenms&precision=n HTTP/1.1” 204 0 “-” “GuzzleHttp/6.0.2 curl/7.47.0 PHP/7.0.18-0ubuntu0.16.04.1” 52fb95b5-4b98-11e7-92d4-000000000000  
Jun 07 15:45:25 librenms influxd[1213]: [httpd] 127.0.0.1 - - [07/Jun/2017:15:45:25 +0000] “POST /write?db=librenms&precision=n HTTP/1.1” 204 0 “-” “GuzzleHttp/6.0.2 curl/7.47.0 PHP/7.0.18-0ubuntu0.16.04.1” 52fc72ab-4b98-11e7-92d5-000000000000  
Jun 07 15:45:25 librenms influxd[1213]: [httpd] 127.0.0.1 - - [07/Jun/2017:15:45:25 +0000] “POST /write?db=librenms&precision=n HTTP/1.1” 204 0 “-” “GuzzleHttp/6.0.2 curl/7.47.0 PHP/7.0.18-0ubuntu0.16.04.1” 52fd3806-4b98-11e7-92d6-000000000000

There isn’t anything being logged in /var/log/influxdb.

-Patrick

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 7, 2017, 6:54pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/6 "2017-06-07T18:54:28Z")

</div>

@papatango71The 204 indicates successful writes. Are you seeing data in InfluxDB?

```auto
$ influx
> use librenms
> show measurements

```

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 6:55pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/7 "2017-06-07T18:55:51Z")

</div>

root@librenms:/opt/librenms# influx  
Connected to [http://localhost:8086](http://localhost:8086) version 1.2.4  
InfluxDB shell version: 1.2.4

> use librenms  
> Using database librenms  
> show measurements  
> name: measurements  
> name

* * *

bgp  
cbgp  
cefswitching  
cipsec\_flow  
fortigate\_cpu  
fortigate\_sessions  
hr\_processes  
hr\_users  
ipSystemStats  
ipsectunnel  
mempool  
netstats-icmp  
netstats-ip  
netstats-ip\_forward  
netstats-snmp  
netstats-tcp  
netstats-udp  
ntp  
ospf-statistics  
ping-perf  
poller-perf  
ports  
processors  
sensor  
sla  
storage  
ucd\_cpu  
ucd\_load  
ucd\_mem  
uptime

When I connect with grafana and look for the data I am not seeing anything.

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 7, 2017, 6:58pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/8 "2017-06-07T18:58:20Z")

</div>

It looks like the data is getting there. Are you connected to the right database in Grafana?

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 9:56pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/9 "2017-06-07T21:56:01Z")

</div>

I have a basic query written in grafana and I am not seeing any data. i would assume that even without any math to change this from octets to bits I should still see something in the graph…

 ![](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/1X/a68005cc4d6c13ccb460a694c36991c8e537bc56.png)

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 9:57pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/10 "2017-06-07T21:57:12Z")

</div>

Connecting to librenms without issues…

 ![](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/1X/6951436550f0367f72d42a5e9e29c722eb1211f7.png)

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 7, 2017, 10:08pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/11 "2017-06-07T22:08:13Z")

</div>

Have you tried running the same query in the `influx` cli?

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 7, 2017, 10:12pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/12 "2017-06-07T22:12:12Z")

</div>

I have not… I will give that a try… I am a newb at Influx so this may take me a few times to get this correct… 🙂

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 12, 2017, 7:56pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/13 "2017-06-12T19:56:33Z")

</div>

It does look like the data is making it into Influx… Dumb question… What measurements holds the interface bandwidth statistics…?? I looked under port but that does not look to be correct… Any help would be greatly appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 12, 2017, 9:16pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/14 "2017-06-12T21:16:49Z")

</div>

I am getting close… I am able to get data pulled from the ports section in regards to bandwidth measurements:

> select INOCTETS from ports where hostname=‘pr01.xxx.xxx’ and ifName=‘Bundle-Ether20’ limit 10  
> name: ports  
> time INOCTETS

* * *

1496849123860976425 7.6012331215949e+14  
1496849419356264131 7.6013245585627e+14  
1496849725987836120 7.6014099246521e+14  
1496850026394534483 7.6015981561484e+14  
1496850325443260816 7.6016875240205e+14  
1496850627268916599 7.6017653085436e+14  
1496850923191686220 7.6018537147324e+14  
1496851229178957782 7.6019686444285e+14  
1496851527558451467 7.6021006722896e+14  
1496851830822554692 7.6022312604583e+14

When I try and graph this out in Grafana it looks pretty funky. I have selected bits/sec for the Axes. Below is the image that shows the queries for INOCTETS & OUTOCTETS. Any help to figure this out would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 12, 2017, 10:10pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/15 "2017-06-12T22:10:52Z")

</div>

@papatango71 I don’t know what your traffic patterns look like so I don’t really know what `funky` looks like. That looks like there is a dip at night which I would assume is expected.

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 12, 2017, 11:14pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/16 "2017-06-12T23:14:34Z")

</div>

Sorry… I should have been clear. I am trying to convert this from octets to bits/second but it is now showing up correctly. I am not sure if my math is incorrect or if I am missing an equation some where…

-Patrick

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 13, 2017, 3:50pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/17 "2017-06-13T15:50:39Z")

</div>

> [@papatango71](#):
>
> select INOCTETS from ports where hostname=‘pr01.xxx.xxx’ and ifName=‘Bundle-Ether20’ limit 10

Have you tried `SELECT INOCTETS / 8 as bits FROM ports WHERE hostname = 'foo' and ifName = 'bar' LIMIT 10`?

---

<div class="post-metadata">

**Author:** ![papatango71](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@papatango71](https://community.influxdata.com/u/papatango71)\
**Post date:** [June 13, 2017, 5:18pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/18 "2017-06-13T17:18:06Z")

</div>

Updated the query with the correct hostname, etc. and it is working.

> SELECT INOCTETS / 8 as bits FROM ports WHERE hostname = ‘[pr01.xx.xx.net](http://pr01.xx.xx.net)’ and ifName = ‘Bundle-Ether20’ limit 10;  
> name: ports  
> time bits

* * *

1496849123860976425 9.501541401993625e+13  
1496849419356264131 9.501655698203375e+13  
1496849725987836120 9.501762405815125e+13  
1496850026394534483 9.5019976951855e+13  
1496850325443260816 9.502109405025625e+13  
1496850627268916599 9.5022066356795e+13  
1496850923191686220 9.5023171434155e+13  
1496851229178957782 9.502460805535625e+13  
1496851527558451467 9.502625840362e+13  
1496851830822554692 9.502789075572875e+13

When I try and run the query that is built in Grafana on Influx I get the following error:

SELECT mean(“INOCTETS”) FROM “ports” WHERE “hostname” = ‘[pr01.xxx.xx.net](http://pr01.xxx.xx.net)’ AND “ifName” = ‘Bundle-Ether20’ AND $timeFilter GROUP BY time($\_\_interval) fill(null) limit 10;  
ERR: error parsing query: missing parameter: timeFilter

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 13, 2017, 10:17pm UTC](https://community.influxdata.com/t/librenms-working-with-influxdb/1215/19 "2017-06-13T22:17:53Z")

</div>

@papatango71 It seems your initial issue has been long since solved. Is this a seperate issue? Also this seems like a Grafana question.
