SentinelOne bash Script

clint_francica
New Contributor

Hi Im tring to implement a bash script trough JAMF to filter SentinelOne's version useing sentinelctl version. Basicaly it gets the version, stores it into a variable and runs it trough an if statment and if the version dosnt match it runs sentinelctl uninstall, but the script is still not working.

Any ideas ?

2 REPLIES 2

wyip
Contributor

Can you post a copy of your script and any errors you may be getting?

dbrundage
New Contributor II

This is the Sentinel One script I use in an Extension Attribute.

#!/bin/sh

# This script will check the status of the SentinelOne Agent

if command -v sentinelctl 1>/dev/null; then
echo "<result> SentinelOne agent is installed with version
`sentinelctl version | awk '{print $2}'` and was connected to management
console `sentinelctl config Server Address | tail -1 | awk '{print $2}'` </result>";

else
s1_agent=$(ps aux | grep -Ei "sentineld$" | awk '{ print $11 };' |
grep -v grep)

if [ -z $s1_agent ]; then
echo "<result>SentinelOne Agent is not Installed.</result>";

else
s1_agent=$(echo $s1_agent | sed 's|sentineld|
sentinelctl|g')
echo "<result>SentinelOne Agent is running but
could not locate SentinelCtl in the default PATH /usr/local/bin. The full path is - $s1_agent </result>" ;

fi

fi