fixed active-sessions.sh

This commit is contained in:
Samuel Philipp 2021-05-21 19:07:42 +02:00
parent 9bd3a90acd
commit a1bb84ab0e
Signed by: samuel-p
GPG key ID: 2AD495D17760CB4E

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
ALL_SESSIONS=$(netstat -tnp | grep sshd -c) ALL_SESSIONS=$(netstat -tnp | grep sshd -c)
SU_SESSIONS=$(ps aux | grep ' [s]u' -c) SU_SESSIONS=$(ps aux | grep ' [s][u] ' -c)
ROOT_SESSIONS=$(netstat -tnp | grep sshd | grep root -c) ROOT_SESSIONS=$(netstat -tnp | grep sshd | grep root -c)
echo "# HELP node_active_sessions active sessions by type." echo "# HELP node_active_sessions active sessions by type."