Licensed software & self service

adroitboy
New Contributor III

I have an app that we have X licenses for. I don't install it by default, but do want to make sure we stay within our licensed limit. I assumed this would be fairly easy to setup using a smart group that, but there doesn't appear to be any way to get the "Licenses in Use" as a criteria. If I could use that, it would seem like I could keep licenses in check fairly easily…

Am I missing something? Does anyone do something like this using another method?

7 REPLIES 7

mvu
Valued Contributor

315ccdc1af934a139e602b0db393a6cc

mvu
Valued Contributor

Does that help?

adamcodega
Valued Contributor

You want to use the Licensed Software feature of the JSS for this. You configure the app name and version, how many licenses you have and whether to ignore App Store versions of the app, in case your environment is mixed. Then you can configure the JSS to show the licensed software on the JSS dashboard and/or to email you on violations. What's neat is if you gather application usage, you can also see how much the licensed software is or isn't being used on specific computers.

(Page 415 of the Administrator's Guide)

jsauer
New Contributor

We use the Licensed Software feature and a static group. That way we can display the licensed software for select users in their Self Service as well as see who has it installed.

bpavlov
Honored Contributor

If I understand correctly, then you asked what I asked a while back:
Read my feature request here for a good workaround provided by @mm2270:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=2984

Of course my feature request was marked as a duplicate of this so be sure to vote this up:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=1725

And if you're not satisfied with the options to determine what is licensed software then vote this up as well:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=3437

I think both feature requests would give the Licensing feature set of Casper a big boost and help more organizations stay in compliance.

mm2270
Legendary Contributor II

Funny, I was going to suggest the same thing. Although you can get notified of license counts that exceed what you set, it won't stop the installations from happening unless you go in and disable the policy right after getting the violation notice. I agree that this is just something that should be an option for policies. The db already knows how many are in use based on current inventory data as well as how many licenses you specified. Why not just make the JSS able to auto turn off the install policy once it reaches that limit? Optionally of course, since in some cases you may not want to take any action on exceeding the license count.

But in the interim, a script as I had explained on the FR thread listed above would help pull the data and then decide whether the software should get installed or not. Here's an example API script that gives an idea on how you would do that.

#!/bin/bash

## Get API username, password and license software ID values from script parameters
apiuser="$4"
apipass="$5"
licenseRecordID="$6"

## Get the JSS URL from the Mac
jssURL=$(defaults read /Library/Preferences/com.jamfsoftware.jamf.plist jss_url)

## Pull the license count and the total licenses in use
licenseCount=$(curl -H "Accept: application/xml" -sfku "${apiuser}:${apipass}" "${jssURL}JSSResource/licensedsoftware/id/${licenseRecordID}" | xmllint --format - | awk -F'>|<' '/<license_count>/{print $3}')
usage=$(curl -H "Accept: application/xml" -sfku "${apiuser}:${apipass}" "${jssURL}JSSResource/licensedsoftware/id/${licenseRecordID}" | xmllint --format - | awk -F'>|<' '/<computers>/,/</computers>/{print $3}' | sed '/^$/d')

for i in $usage; do
    usageCount+=($i)
done

echo "License count is: $licenseCount"
echo "Total use count is: ${#usageCount[@]}"

if [ "${#usageCount[@]}" -ge "$licenseCount" ]; then
    ## Don't do the installation. Alert user
    echo "Do something here"
else
    ## Do installation
    echo "Proceed with installation"
fi

This, unfortunately would either involve using two policies - one to do the license check and another to do an install if its able to, or, you'd have to do something like drop the installer package into a temp location as its payload, then run the script to determine if the actual installation should take place and do it, or alert the user that you're out of licenses and clean up the installer pkg in the temp directory. Neither are perfect solutions, which is why I think it should just be built in, but they would work anyway.

adroitboy
New Contributor III

Thanks all.

@mm2270 - Yes!

What I want is not just a the Licensed software name, or the ability to see it in the JSS. I want the actual COUNT of the software installed available to be used in a smart group. I was thinking of creating an extension attribute for each piece of Licensed software that I want to control. It would pull the difference of "$usageCount" and "$licenseCount" through the API. Then I could then scope self service Licensed software installs to smart groups with a criteria of "greater than 0." . I haven't explored it yet though.

I might play around with your API script and see what I can find in the JSS as far as app license count info goes. I would hope the JSS would eventually have a nice policy option that says something to the effect of "Disable Policy if License Count Exceeded".