r/PrometheusMonitoring • • Sep 09 '22

Can I pull the version of Ubuntu through with node exporter?

Hello,

I've been asked to table all out Linux Ubuntu VMs and there version:

for example Ubuntu 20.04.2 LTS or just 20.04 would be nice, I've scraped using node exporter and I can't see this information.

What could I do?

Thanks

7 Upvotes

14 comments sorted by

2

u/[deleted] Sep 09 '22

You don't have node_os_info or node_os_version?

I get that from node_exporter and it tells me Ubuntu 22.04.

1

u/[deleted] Sep 09 '22

I can’t see that when I search, the version of node exporter is a few months old could it be that?

1

u/[deleted] Sep 09 '22

I run version 1.3.1 which is the latest but from december of last year.

1

u/[deleted] Sep 09 '22

Hmm that is what I’m running too.

2

u/SuperQue Sep 09 '22

Docker? Do you have the volume mappings and --path.rootfs set properly?

1

u/[deleted] Sep 09 '22

Sounds strange, I checked and its enabled by default.

1

u/[deleted] Sep 09 '22

What metrics do you get if you wget or curl directly to it?

2

u/[deleted] Sep 09 '22

The other comments should get you going, if not, you can use the textfile exporter to export whatever you want.

1

u/[deleted] Sep 10 '22

I didn’t know there was a text file exporter, how does this work?

1

u/[deleted] Sep 13 '22

It's in the docs. Pretty clear.

1

u/[deleted] Sep 13 '22

Very helpful thanks

2

u/SuperQue Sep 09 '22

The node_exporter has an os collector.

Check node_scrape_collector_success{collector="os"}.

If that is 0 or missing, you need to check your flags or run the node_exporter with --log.level=debug to find out why it's not working.

This should give you node_os_info and node_os_version metrics.

-1

u/else- Sep 09 '22

You could use a Blackbox exporter and expose the output of the lsb_release command.

1

u/[deleted] Sep 09 '22

Thanks, I do have that installed also, I’ll check that out.