Skip to main content
Question

How to find the version of the Eracent Agent

  • September 29, 2014
  • 6 replies
  • 35 views

ImAMacGuy
Forum|alt.badge.img+23

Anybody using eracent? I'm looking for a way to pull the version of the agent installed, but it doesn't show up under plugins or installed applications. I could scope off the installed package, but was hoping for a better way to check against the app as that can get messy once multiple packages are brought in.

6 replies

Forum|alt.badge.img+8
  • Contributor
  • September 29, 2014

Never used it before but perhaps it has some info in a plist located within the app/agent.

Example when I check Microsoft Excels version I run:

defaults read /Applications/Microsoft Office 2011/Microsoft Excel.app/Contents/version.plist CFBundleShortVersionString

Perhaps a starting point? Hope you get it figured out!


ImAMacGuy
Forum|alt.badge.img+23
  • Author
  • Esteemed Contributor
  • September 29, 2014

it doesn't seem to have a plist file, i found an XML file that does have the Version= that I need, but not sure how to extract the data.


Forum|alt.badge.img+18
  • Valued Contributor
  • September 29, 2014

just guessing,
awk -F= '/Version/{print $2"}' xmlfile


Forum|alt.badge.img+8
  • Contributor
  • September 29, 2014

@nessts beat me to it. Was on a conference call and when I finished (apparently I didn't have enough fight in me to be on the call and hit the "Post It" button) he already answered it.

Hope is one liner helps out. If not please post the xml or relative portion.


ImAMacGuy
Forum|alt.badge.img+23
  • Author
  • Esteemed Contributor
  • September 29, 2014

I appreciate you guys taking the time to look at this!

<?xml version="1.0" encoding="utf-8" ?>
<ScannerConfig
    Version="9.8.0.69" >
    <Scanner>
        <!--

when I tried the awk command it returned this...(note, I tried with the " as shown in your example, as well as some variations there-of to get it to work; all returned the below behavior

sudo awk -F='/Version/{print $2}' /private/var/Eracent/EPA/conf/ScannerConfig.xml 
awk: syntax error at source line 1
 context is
     >>> /private/var/Eracent/EPA/conf/ScannerConfig. <<< xml
awk: bailing out at source line 1

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • September 29, 2014
awk -F'"' /Version/{print $2}' /path/to/xmlfile

should do it.

Edit: BTW, the reason you were getting that error is because you weren't including a space between the -F= and '/Version/{print $2}' Look closely at what @nessts][/url posted and you'll see the space between them.