Skip to main content
Question

SentinelOne bash Script


Forum|alt.badge.img+1

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

Forum|alt.badge.img+8
  • New Contributor
  • 63 replies
  • February 3, 2021

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


dbrundage11
Forum|alt.badge.img+3
  • New Contributor
  • 4 replies
  • February 4, 2021

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

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings