Posted on 03-17-2021 12:22 PM
We need to view usage statistics on each of the Adobe apps we use. I can't figure out how to report the usage in the last 90 days per user. I don't even seem to get very close. Below is essentially what I'm looking for.
ComputerName, UserName, ApplicationName, Usage
laptop12, jdoe@company.com, Adobe Acrobat Pro, 23 hours
If I look at each of roughly 800 computers I can see the pretty charts that claim to show usage. Some level of data is there, but I see no way to export it to make it useful.
Posted on 04-14-2021 01:47 PM
Hey @srenschen - did you ever find a solution for this? Im in a similar boat right now
Posted on 02-08-2023 09:32 AM
I could use the same report. Any updates?
02-22-2024 08:57 AM - edited 02-22-2024 09:06 AM
Here's my computer record in Jamf:
Here is the output from the API application usage endpoint. In descending chronological order (so today is at the top...):
curl -LsS -X GET -H 'Accept: application/json' -u "$apiuser:$apipswd" "$jamfurl/computerapplicationusage/id/1381/2022-08-15_2022-08-19" | jq '.[] | .[] | .apps | .[] | select(.name == "Safari.app")'
{
"name": "Safari.app",
"version": "15.6.1",
"foreground": 138,
"open": 0
}
{
"name": "Safari.app",
"version": "15.6.1",
"foreground": 292,
"open": 0
}
{
"name": "Safari.app",
"version": "15.6.1",
"foreground": 149,
"open": 0
}
{
"name": "Safari.app",
"version": "15.6",
"foreground": 207,
"open": 0
}
{
"name": "Safari.app",
"version": "15.6",
"foreground": 298,
"open": 0
}
For the 15th, it shows 298m, which in the pretty bar graph is 4h58m. Not the worst, but totally workable for finding out how long an app has been used?
#!/bin/bash
apiuser=''
apipswd=''
jamfurl='https://something:8443/JSSResource'
objctid()
{
idsdat=$(/usr/bin/curl -sS -X GET -H 'accept: application/xml' -u "$apiuser:$apipswd" "$jamfurl/$1")
arrsiz=$(echo "$idsdat" | /usr/bin/xmllint --xpath "//size/text()" -)
for ((i=0;i<=arrsiz;i++)) { echo "$idsdat" | /usr/bin/xmllint --xpath "concat(//$2[$i]/id/text(),' ')" - ; }
}
id_arr=($(objctid computers computer))
for i in "${id_arr[@]}"
do
usage="$(curl -LsS -X GET -H 'Accept: application/json' -u "$apiuser:$apipswd" "$jamfurl/computerapplicationusage/id/$i/2022-08-15_2022-08-15" | jq -c '.[] | .[] | .apps | .[] | select(.name == "Safari.app")')"
if [ -n "$usage" ]
then
echo "{\"computer\":\"$(curl -LsS -X GET -H 'Accept: application/json' -u "$apiuser:$apipswd" "$jamfurl/computers/id/$i/subset/General" | jq -r '.[] | .[].name')\",\"id\":$i,\"usage\":$usage}" | jq '.'
fi
unset i
done
That creates a new json object for each user that used Safari on the 15th either in foreground or background with computer name & object ID & it skips users that had 0 time with Safari open (the endpoint kind of just does that naturally I am taking advantage of it...)