Sophos SafeGuard verision 7 Extension Attribute

johnklimeck
Contributor II

Deploying Sophos SafeGuard version 7.x. I was able to grab this EA and upload it to the JSS, but it's for version 5x.

I thought I figured it out when I saw that Sophos has renamed the sgadmin to sgdeadmin in version 7, and I just updated that in the script, but I still get an empty returned EA result when I run recon:

#!/bin/sh

#This script has been verified to work on Sophos SafeGuard (v 05.49.00).

#Check to see if SafeGuard is installed
if [ -f "/usr/bin/sgdeadmin" ]; then
result=`/usr/bin/sgdeadmin --status | grep -A 3 "Volume info" | grep "| 0" | awk 'BEGIN { FS = "|" } ; {print $6}' | awk '{print $1}'`
    echo "<result>$result</result>"
else
    echo "<result>Not installed</result>"
fi

Thanks in advance, John

3 REPLIES 3

pblake
Contributor III

Stupid question, did you confirm on your test machine that /usr/bin/sgdeadmin actually exists? If so my guess is the --status command is no longer valid. You may need to get a man page for sgdeadmin.

johnklimeck
Contributor II

Yes, sgdeadmin is definitely there in /usr/bin

akamenev47
Contributor II

Looks like Sophos changed name and the location of the sgadmin, I modified the scrip to locate the 7th version number, which can be used as extension attribute and in the smart group for all 7 versions (Like >> 7.*):

#!/bin/sh

#This script has been verified to work on Sophos SafeGuard (v 7.0.2.33).

#Check to see if SafeGuard is installed
if [ -f "/usr/local/bin/sgdeadmin" ]; then
result=`/usr/local/bin/sgdeadmin --version | egrep -o 'd{1,2}.d{1,2}.d{1,2}.d{1,2}'`
    echo "<result>$result</result>"
else
    echo "<result>Not installed</result>"
fi
Ahoy!