Script success analytics

yarin
New Contributor II

Hey guys.
Can Jamf create analytics for scripts the was successfully deployed?
I want to create scripts to test if installation succeed or not (Check existence of the file)
and to analyze my enterprise environment to see in which Macs it worked.
If It does , Can I provide an exit code or something?

1 ACCEPTED SOLUTION

thoule
Valued Contributor II

You can create a smart group whose criteria is "Name of Extension Attribute" is "Kids In School".

That Extension attribute will be updated whenever computers update inventory (every 24 hours + when you run it as part of a policy). Computers will be added/removed from that group as the /tmp/ file comes or goes.

For example, I have a policy to install a security agent on computers. I have an extension attribute to see if the agent is installed and running. And a smart group of computers where it is NOT installed and running. Then I scope that install policy to computers that have the agent NOT running and run once every 24 hours.

View solution in original post

3 REPLIES 3

thoule
Valued Contributor II

I think what you are looking for is called an 'Extension Attribute' under Settings. You write a script to do it's thing and return a result. That result shows up as a computer attribute. From there you can make smart groups and policies to address those machines. Text back to the JSS needs to be in <result> tags.

#!/bin/sh

if [ -f /tmp/stayinschool.kids ]; then
   echo "<result>Kids In School</result>"
else
    echo "<result>Damn Dropouts</result>"
fi

yarin
New Contributor II

and I can make Jamf to return a list of every computer that the result was kids in school?

thoule
Valued Contributor II

You can create a smart group whose criteria is "Name of Extension Attribute" is "Kids In School".

That Extension attribute will be updated whenever computers update inventory (every 24 hours + when you run it as part of a policy). Computers will be added/removed from that group as the /tmp/ file comes or goes.

For example, I have a policy to install a security agent on computers. I have an extension attribute to see if the agent is installed and running. And a smart group of computers where it is NOT installed and running. Then I scope that install policy to computers that have the agent NOT running and run once every 24 hours.