Librenms not shipping metrics to InfluxDB

Hi there,

I am configuring my LibreNMS shipping all monitoring devices’ metrics to InfluxDB. I have followed document InfluxDB - LibreNMS Docs to enable support for InfluxDB. I also installed a InfluxDB on another server with Telegraf.

But my LibreNMS is not shipping all monitoring devices’ metrics to InfluxDB. Can you please give me a recommendation on this? DO we have extra setup on InfluxDB server?

Thank you.


Jeff Deng

Minimally you need

$config['influxdb']['enable'] = true;
$config['influxdb']['transport'] = 'http'; # Default, other options: https, udp
$config['influxdb']['host'] = 'ip or fqdn';
$config['influxdb']['port'] = '8086';
$config['influxdb']['db'] = 'librenms';

You can test to see if you can post to the database using curl using some test data like the below template

curl -XPOST 'http://your.influddb.fqdn:8086/write?db=librenms' --data-binary "somemeasurement count=1'

Hi PJGuy,

Thank you for your reply.

Yes, I have added $config[‘influxdb’] things in Librenms config.php already. But my influxdb still not receiving metrics from Librenms. I ran curl command, and got “Unauthoried” issue. The user - jeff is my influxda login. Do you have a document about setting up Librenms shipping metrics to influxDB?

curl -i -XPOST --data-binary "HARDWARE,CPU=1 value=91"

Enter host password for user ‘jeff’:
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
X-Platform-Error-Code: unauthorized
Date: Tue, 10 Aug 2021 04:31:04 GMT
Content-Length: 48


Jeff Deng

The config above is what I have as my config.

So the curl command is assuming anyone can write to influxdb, you can add the username and password to it like so:

curl -i -XPOST http://jeff:[email protected]:8086/write?db=HWDB --data-binary "HARDWARE,CPU=1 value=91"

I assume your config also has the following lines?

$config['influxdb']['username'] = 'jeff';
$config['influxdb']['password'] = 'jeffspw';

Thanks PJGuy, yes, I have username and password on config.php and curl. it looks unauthorized error. I will investigate this and come back to you with an update. :slight_smile:

An update for this - the issue has been resolved. It was influxdb user privilege problem. Assigned correct privilege to the database resolved this. Thanks :slight_smile: