Posted on 05-12-2016 01:32 PM
I have a simple extension attribute that's supposed to display an Agent version:
#!/bin/bash
# Check to see if the SentinelOne agent is installed.
# If the agent is installed, report the agent
# version.
printf '<result>'
if result=`/usr/local/bin/sentinelctl version | awk '{print $2 $3}'`; then
printf "$result"
else
printf "Unavailable/Not Installed"
fi
printf '</result>'
When I run this locally on my machine, it works, but running it as an extension attribute doesn't seem to work.
Any suggestions on how to debug this issue?
Solved! Go to Solution.
Posted on 05-12-2016 04:10 PM
Try:
#!/bin/bash
# Check to see if the SentinelOne agent is installed.
# If the agent is installed, report the agent
# version.
if [ -f "/usr/local/bin/sentinelctl" ] ; then
RESULT=$( /usr/local/bin/sentinelctl version | awk '{print $2 $3}' )
else
RESULT="not installed"
fi
echo "<result>$RESULT</result>"
Posted on 05-12-2016 01:52 PM
I also tried:
#!/bin/bash
# Check to see if the SentinelOne agent is installed.
# If the agent is installed, report the agent
# version.
if [ -f "/usr/local/bin/sentinelctl" ] ; then
RESULT=`sudo /usr/local/bin/sentinelctl version | awk '{print $2 $3}'`
else
RESULT="not installed"
fi
echo "<result>$RESULT</result>"
Just to see what happens :)
Posted on 05-12-2016 04:10 PM
Try:
#!/bin/bash
# Check to see if the SentinelOne agent is installed.
# If the agent is installed, report the agent
# version.
if [ -f "/usr/local/bin/sentinelctl" ] ; then
RESULT=$( /usr/local/bin/sentinelctl version | awk '{print $2 $3}' )
else
RESULT="not installed"
fi
echo "<result>$RESULT</result>"
Posted on 05-12-2016 06:16 PM
Super weird. It works when running script via Policy, but as an extension attribute, it does not.
edit: flushPolicyHistory fixed it.