mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #8768 from Security-Onion-Solutions/config
refactor sostatus telegraf input script
This commit is contained in:
@@ -11,12 +11,11 @@
|
||||
if [[ ! "`pidof -x $(basename $0) -o %PPID`" ]]; then
|
||||
|
||||
SOSTATUSLOG=/var/log/sostatus/status.log
|
||||
SOSTATUSCODE=$(jq -r .status_code /var/log/sostatus/status.log)
|
||||
SOSTATUSJSON=$(cat /var/log/sostatus/status.log)
|
||||
SOSTATUSCODE=$(jq -r .status_code $SOSTATUSLOG)
|
||||
SOSTATUSJSON=$(cat $SOSTATUSLOG | sed 's/"/\\"/g')
|
||||
|
||||
if [ -f "$SOSTATUSLOG" ]; then
|
||||
echo "sostatus status=$SOSTATUSCODE"
|
||||
echo "sostatus json=$SOSTATUSJSON"
|
||||
echo "sostatus status=$SOSTATUSCODE,json=\"$SOSTATUSJSON\""
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user