Merge pull request #12741 from Security-Onion-Solutions/metrics

Change code to allow for non root
This commit is contained in:
Mike Reeves
2024-04-03 12:56:17 -04:00
committed by GitHub

View File

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