ESET Version Extension Attribute

Buraq
New Contributor III

After consulting with Eset, I've written the below Extension Attribute to spit out the version of Eset Security installed. When I try that script in terminal I get the result: 6.7.654. When I create a smart group in Jamf with operator is and value 6.7.654 I don't see any results in the group.

In Extension Attribute I've chosen: Data Type: String and Input Type: Script
In short, the script does work but Jamf doesn't like it as Extension Attribute. Any idea?

The script is:

!/bin/bash

esets_scan="/Applications/ESET Endpoint Security.app/Contents/MacOS/esets_scan"

if [[ -e "$esets_scan" ]]; then esetversion=$("$esets_scan" -v | awk '{ print $5 }') echo $esetversion exit 0
else echo "Not Installed"
fi

exit 0

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

As @putnajoe mentioned, the format for your EA is not correct, so you won't get any results until that is fixed. Try something like this

#!/bin/bash

esets_scan="/Applications/ESET Endpoint Security.app/Contents/MacOS/esets_scan"

if [[ -e "$esets_scan" ]]; then
      result=$("$esets_scan" -v | awk '{ print $5 }')
else
      result="Not Installed"
fi

echo "<result>$result</result>"

The other thing to keep in mind about EAs is that they only get populated on inventory collection. Even after you correct the script, you will need to either wait until your Macs start submitting new inventory to see any results, or force them to submit new inventory soon after getting the EA in place.

View solution in original post

4 REPLIES 4

putnajoe
New Contributor III

Extension attributes need to have the results defined in brackets <results></results> to populate to the JSS. For my own EAs, I usually have a line that echos the variable in the brackets.

echo "<result>$Variable</result>"

I hope this helps.

mm2270
Legendary Contributor III

As @putnajoe mentioned, the format for your EA is not correct, so you won't get any results until that is fixed. Try something like this

#!/bin/bash

esets_scan="/Applications/ESET Endpoint Security.app/Contents/MacOS/esets_scan"

if [[ -e "$esets_scan" ]]; then
      result=$("$esets_scan" -v | awk '{ print $5 }')
else
      result="Not Installed"
fi

echo "<result>$result</result>"

The other thing to keep in mind about EAs is that they only get populated on inventory collection. Even after you correct the script, you will need to either wait until your Macs start submitting new inventory to see any results, or force them to submit new inventory soon after getting the EA in place.

Buraq
New Contributor III

Thanks both!

kerouak
Valued Contributor

We introduced ESET to replace mcafee... 

Oh dear.... 

 

We binned it after so many issues...  All I can say is .. best of luck :-)(