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.

1#!/bin/sh
2
3# This script will check the status of the SentinelOne Agent
4
5if command -v sentinelctl 1>/dev/null; then
6echo "<result> SentinelOne agent is installed with version
7`sentinelctl version | awk '{print $2}'` and was connected to management
8console `sentinelctl config Server Address | tail -1 | awk '{print $2}'` </result>";
9
10else
11s1_agent=$(ps aux | grep -Ei "sentineld$" | awk '{ print $11 };' |
12grep -v grep)
13
14if [ -z $s1_agent ]; then
15echo "<result>SentinelOne Agent is not Installed.</result>";
16
17else
18s1_agent=$(echo $s1_agent | sed 's|sentineld|
19sentinelctl|g')
20echo "<result>SentinelOne Agent is running but
21could not locate SentinelCtl in the default PATH /usr/local/bin. The full path is - $s1_agent </result>" ;
22
23fi
24
25fi

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