parent
c395134a75
commit
52764e5bed
5 changed files with 42 additions and 12 deletions
@ -1,8 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
DIR=$1 |
||||
KEY=$2 |
||||
FILE=$3 |
||||
|
||||
du -bsx $DIR | sed "s/\([0-9]*\).*\/\(.*\)/node_dir_size{name=\"\2\",key=\"$KEY\"} \1/" > "$FILE$$" |
||||
mv "$FILE$$" "$FILE" |
@ -0,0 +1,9 @@ |
||||
#!/bin/bash |
||||
|
||||
ALL_SESSIONS=$(who | wc -l) |
||||
ROOT_SESSIONS=$(who | grep root | wc -l) |
||||
|
||||
echo "# HELP node_active_sessions active sessions by type." |
||||
echo "# TYPE node_active_sessions gauge" |
||||
echo "node_active_sessions{type=\"all\"} $ALL_SESSIONS" |
||||
echo "node_active_sessions{type=\"root\"} $ROOT_SESSIONS" |
@ -0,0 +1,5 @@ |
||||
#!/bin/bash |
||||
|
||||
echo "# HELP node_directory_size_bytes Disk space used by some directories" |
||||
echo "# TYPE node_directory_size_bytes gauge" |
||||
du -bsx "$1" | sed "s/\([0-9]*\).*\/\(.*\)/node_directory_size_bytes{name=\"\2\",key=\"$2\"} \1/" |
Loading…
Reference in new issue