10 lines
364 B
Bash
10 lines
364 B
Bash
#!/bin/bash
|
|
|
|
ALL_SESSIONS=$(ps auxwww | grep sshd: | grep -v grep -c)
|
|
ROOT_SESSIONS=$(ps auxwww | grep sshd: | grep -v grep | grep 'root\|priv' -c)
|
|
|
|
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"
|