Serial-Numbers

Hi Guys,

Please advise if it possible to pull all devices serial numbers in easy way?

SELECT hostname, serial FROM devices;

Or use the api.

Hi Laf,

I used the following command curl -H ‘X-Auth-Token:e62573e0ca6d9ea4f43902b6d2c019ac’ http://sn1-librenms01/api/v0/devices | grep serial

But it doesn’t present serial numbers of all devices, I can see on the inventory all serial numbers
But I need somehow to export it, is there any other API curl expression I can use?

Can you explain this a little more detailed, please?

When you do the API query, you get a

“serial”: null,

for some of the devices…?

Are we really talking about “devices” or are you looking for the serial numbers of the devices’ components as well?

best regards,
awaum

I’m trying to pull all serial numbers of chassis itself only ,when i do api/devices, I don’t see nothing in the serial

You need to use the inventory API call then for each device to get the that info and possibly even loop within it.

Otherwise in mysql: SELECT device_id, entPhysicalSerialNum from entPhysical WHERE entPhysicalSerialNum!='';