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

Change code to allow for non root
This commit is contained in:
Mike Reeves authored and GitHub committed 2024-04-03 12:56:17 -04:00
commit 1c7cc8dd3b
1 file changed
+5 -2
+5 -2
View File
@@ -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() {