10 lines
298 B
Bash
10 lines
298 B
Bash
|
#!/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"
|