McAfee EPO Version Extension Attribute

ammonsc
Contributor II

I thought you used to be able to share extension attributes but I do not remember now.

I got the basis of this from an older EA located here

[McAfee Check EPO Agent Version]https://www.jamf.com/jamf-nation/third-party-products/files/525/mcafee-check-epo-agent-version)

#!/bin/sh

#Reports the version of the McAfee EPO Agent installed on the client computer.
#Data Type in JSS for this script should be set to: string

Version=`cat /etc/cma.d/EPOAGENT3700MACX/config.xml | grep "<Version>.*</Version>" |sed -e "s/<Version>(.*)</Version>/1/"|tr "|" " "`

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

fi
5 REPLIES 5

Taylor_Armstron
Valued Contributor

Looks good. FWIW, this is what I've been using:

#!/bin/bash

ePOAgent=$(xmllint -xpath "string(//Version)"  /etc/cma.d/EPOAGENT3700MACX/config.xml)

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

exit 0

Going to take a look at yours though... seems easier to understand for most people.

mm2270
Legendary Contributor III

Here's ours. Always more than one way to do these things.

#!/bin/sh

EPOVersion=$(awk -F'>|<' '/<Version>/{print $3}' /etc/cma.d/EPOAGENT3700MACX/config.xml)

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

donmontalvo
Esteemed Contributor III

@mm2270 So shorter and faster....we're stealing yours...

$ time cat /etc/cma.d/EPOAGENT3700MACX/config.xml | grep '<Version' | cut -d '>' -f 2 | cut -d '<' -f 1
5.0.6.347

real    0m0.005s
user    0m0.004s
sys 0m0.009s
$ time awk -F'>|<' '/<Version>/{print $3}' /etc/cma.d/EPOAGENT3700MACX/config.xml
5.0.6.347

real    0m0.004s
user    0m0.001s
sys 0m0.002s
$
--
https://donmontalvo.com

jimmy-swings
Contributor II
RESULT=$( /Library/McAfee/cma/bin/msaconfig -version )

leobrt
New Contributor III

Hi,
With the McAfee renaming to Trellix, do you have the attribute extensions for the EPO agent, EDR or other version of the Trellix product please?