Can I export to CSV the devices we have in LibreNMS?

Hello,

Can I export a device list to csv of what we have in LibreNMS?

Thanks

Hello, I’ve just done that today.
I didn’t found tools on librenms so I’ve done this from mysql.
I’m a begginer in database but the result was not that bad.
I wanted to have IP address, model, serial number and location.

sudo mysql
use librenms
select d.hostname, d.hardware, d.serial, d.location_id as device, l.location, l.id as location from devices d inner join locations l on l.id = d.location_id ;

Then you copy paste on a notepad, you replace | with ,
And in excel you can import CSV.

2 Likes

Thanks you!

I’ve also been given this that works too:

  1. run this → php artisan tinker

Then paste

file_put_contents('devices_export.csv', Device::all()->map(fn($device) => implode(',', $device->toArray()))->implode(PHP_EOL));

Regards

1 Like

How about use the api and parse the json?

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