This repository has been archived on 2023-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
awesome-scripts/node_exporter/directory-size.sh

6 lines
231 B
Bash
Raw Normal View History

2021-05-15 22:27:56 +00:00
#!/bin/bash
echo "# HELP node_directory_size_bytes Disk space used by some directories"
echo "# TYPE node_directory_size_bytes gauge"
2021-05-15 22:47:06 +00:00
du -bsx $1 | sed "s/\([0-9]*\).*\/\(.*\)/node_directory_size_bytes{name=\"\2\",key=\"$2\"} \1/"