node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Disk Space Used Seem Like Not Right For Multiple partitions

Open piaoyu opened this issue 8 years ago • 5 comments

Host operating system: output of uname -a

Linux sz-kpi-s3-252 3.10.0-327.ali2010.rc7.alios7.x86_64 #1 SMP Thu Jun 29 21:45:21 CST 2017 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

/bin # node_exporter --version node_exporter, version 0.14.0 (branch: master, revision: 840ba5dcc71a084a3bc63cb6063003c1f94435a6) build user: root@bb6d0678e7f3 build date: 20170321-12:12:54 go version: go1.7.5

node_exporter command line flags

100.0 - 100 * (node_filesystem_avail{instance=~'$node',device !~'tmpfs',device!~'by-uuid'}
  / node_filesystem_size{instance=~'$node',device !~'tmpfs',device!~'by-uuid'})

Are you running node_exporter in Docker?

What did you do that produced an error?

What did you expect to see?

/dev/sdh1       3.6T   89M  3.4T   1% /home7
/dev/sdf1       3.6T   89M  3.4T   1% /home5
/dev/sdk1       3.6T   89M  3.4T   1% /home10
/dev/sdj1       3.6T   89M  3.4T   1% /home9
/dev/sdi1       3.6T   89M  3.4T   1% /home8
/dev/sdg1       3.6T   89M  3.4T   1% /home6
/dev/sdc1       3.6T   89M  3.4T   1% /home2
/dev/sdd1       3.6T   89M  3.4T   1% /home3
/dev/sde1       3.6T   89M  3.4T   1% /home4
/dev/sdl1       3.6T   89M  3.4T   1% /home11
/dev/sdb1       3.6T   50G  3.4T   2% /home1
/dev/sda4       3.6T  106G  3.5T   3% /home

What did you see instead?

2018-04-24 12 03 05 pm

piaoyu avatar Apr 24 '18 04:04 piaoyu

I don't see where the problem is. The df -h output you included shows all filesystems are 3% used, which is exactly what is displayed on the graph.

Perhaps if you used the legend as a table in grafana to display the current/average/max values, it would help to show the actual numbers.

SuperQ avatar Apr 24 '18 06:04 SuperQ

@SuperQ it does'nt count the /dev/sda4 or /home1 Disk Space Used but /host/sys and /host/proc

piaoyu avatar Apr 24 '18 07:04 piaoyu

I think this is due to the way you're trying to regexp match devices. Regexp matches in Prometheus are anchored, so they imply '^by-uuid$', for example.

Maybe what you want is something like device=~"/dev/sd.*" to limit the output to your real disk volumes.

SuperQ avatar Apr 24 '18 07:04 SuperQ

Since this appears to be a usage question, not a bug or feature request, I suggest you take it to the community. Github issues are reserved for bugs and feature requests. There are far fewer people here that can help you, and it causes extra workload on our maintainers.

SuperQ avatar Apr 24 '18 07:04 SuperQ

I would like to extract extract disc utilization of the cluster, even when we have multi partitions of disk using Prometheus

Above query working fine when we have single partitions:

100 - (100 * ((node_filesystem_avail_bytes{mountpoint="/",fstype!="rootfs"} ) / (node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"}) ))

100.0 - 100 * (node_filesystem_avail{instance=~'$node',device !~'tmpfs',device!~'by-uuid'} / node_filesystem_size{instance=~'$node',device !~'tmpfs',device!~'by-uuid'})

But above query unable to extract multi partitions? Anybody has any idea on same??

deeruattavar avatar Oct 20 '21 12:10 deeruattavar