Hey All,
Wondering if anyone out there has:
A) installed or worked with Digital Guardian DLP software for Mac?
B) successfully created an extension attribute that reports the agent version installed?
C) mastered the rare art form of text manipulation in the command line and can help me regardless of the software I'm reporting on?
DG's command line binary, "dgctl" has an easy way to report on the currently installed version by typing the following into a Terminal window: "dgagent/dgctl --version" which outputs the following (excessively verbose in my opinion) info:
2017-03-03 16:55:14.968 dgctl[19465:70794] DGAgent for Mac OS X version 7.1.4.0004
2017-03-03 16:55:14.969 dgctl[19465:70794] OK
I've tried piping into tools (and combinations thereof) using sed, grep, awk, cut etc. and no matter what I try, I just get a blank response and no output. I'm looking to cut out everything except the "7.1.4.0004" ideally, but getting frustrated that I can't seem to modify the text at all.
Even by removing any pipes into txt manipulation and just attempting to return the two line result with an echo returns nothing, i.e.
#!/bin/bash
if [ -d /dgagent ] ; then
dgVersion=$( /dgagent/dgctl --version )
echo "DG version is $dgVersion"
else
echo "<result>Not Installed</result>"
fi
exit 0
Before you ask, no, there does not appear to be any plist, log or other static/clear text item installed that I could use instead to report on the version number. Seems like you must get the information by running this command.
Any expert scripting/EA help out there would be very much appreciated! Thank you!