Skip to content

Commit

Permalink
Merge pull request #12741 from Security-Onion-Solutions/metrics
Browse files Browse the repository at this point in the history
Change code to allow for non root
  • Loading branch information
TOoSmOotH committed Apr 3, 2024
2 parents 58d081e + 8889c97 commit 1c7cc8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions salt/common/tools/sbin/so-common
Expand Up @@ -249,8 +249,11 @@ get_random_value() {
}

get_agent_count() {

AGENTCOUNT=$(/usr/sbin/so-elasticagent-status | grep -wF active | awk '{print $2}')
if [ -f /opt/so/log/agents/agentstatus.log ]; then
AGENTCOUNT=$(cat /opt/so/log/agents/agentstatus.log | grep -wF active | awk '{print $2}')
else
AGENTCOUNT=0
fi
}

gpg_rpm_import() {
Expand Down

0 comments on commit 1c7cc8d

Please sign in to comment.