mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
fix typo and prevent agent from getting re-added
This commit is contained in:
@@ -179,7 +179,7 @@
|
||||
<log_format>syslog</log_format>
|
||||
<location>/var/ossec/logs/active-responses.log</location>
|
||||
</localfile>
|
||||
%- if grains['os'] == 'Ubuntu' %}
|
||||
{%- if grains['os'] == 'Ubuntu' %}
|
||||
<localfile>
|
||||
<log_format>syslog</log_format>
|
||||
<location>/var/log/auth.log</location>
|
||||
|
||||
@@ -31,6 +31,7 @@ USER="foo"
|
||||
PASSWORD="bar"
|
||||
AGENT_NAME=$(hostname)
|
||||
AGENT_IP="{{ip}}"
|
||||
AGENT_ID=001
|
||||
|
||||
display_help() {
|
||||
cat <<HELP_USAGE
|
||||
@@ -135,5 +136,10 @@ shift $(($OPTIND - 1))
|
||||
|
||||
# Default action -> try to register the agent
|
||||
sleep 10s
|
||||
register_agent
|
||||
STATUS=$(curl -s -k -u $USER:$PASSWORD $PROTOCOL://$API_IP:$API_PORT/agents/$AGENT_ID | jq .data.status | sed s'/"//g')
|
||||
if [[ $STATUS == "Active" ]]; then
|
||||
echo "Agent $AGENT_ID already registered!"
|
||||
else
|
||||
register_agent
|
||||
fi
|
||||
#remove_agent
|
||||
|
||||
Reference in New Issue
Block a user