Skip to content

Instantly share code, notes, and snippets.

@b4tman
Last active January 30, 2025 07:31
Show Gist options
  • Save b4tman/f0437fd54734de6ece9266eae922de44 to your computer and use it in GitHub Desktop.
Save b4tman/f0437fd54734de6ece9266eae922de44 to your computer and use it in GitHub Desktop.
1c get sessions count
#!/bin/sh
echo -n "Всего лицензий: " && \
rg "Количество пользователей:\s.*$" /var/1C/licenses/*.lic | rg -o "\b\\d{1,3}\b" | awk '{s+=$1} END {print s}'
echo -n "Всего сеансов: " && \
/opt/1cv8/x86_64/current/rac session --cluster=$(/opt/1cv8/x86_64/current/rac cluster list localhost | rg -e "^cluster\s*:" -m 1 | rg -e "[[:xdigit:]-]{36}" -o) list| rg -c "^session\s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment