How to trigger an update of smart computer groups?

fdanckwerts
New Contributor

Hello.

For a special workflow I need to update an attribute of the jamfsoftware database's 'computers' table directly using the mysql command. This works without any error, but the membership of a smart computer group will not update according to the changed attribute. How can I trigger to update the membership of a smart computer group from 'outside' the JSS?

Example:

The smart computer group has the criteria: asset_tag is 1

Now I change the asset_tag of an computer object to 1 using the mysql command, but the computer will not become member of the smart computer group unless I 'save' the smart computer group again using the JSS web front end.

One possible solution is to set the attribute 'asset_tag' using the API. This is possible, but it is very complicated, because the Casper Suite runs on a Windows Server and so I has to install curl or use a power shell script.

Maybe there is a better way to trigger the JSS to update the membership of a smart computer group.

Info: Casper Suite 8.52 running on Windows Server 2008 R2

Thanks
Felix

3 REPLIES 3

jarednichols
Honored Contributor

I suggest you use the API to make your change rather than direct MySQL mucking. The Smart Group should also update that way as well.

barnesaw
Contributor III

I agree with Jared, I would avoid mucking with the db directly. The JSS is designed to update when something is done with it, not on direct db manipulation.

And that doesn't even touch on the many possible ways to write bad data by mistake. It's a bad idea on all fronts to do direct db manipulation on any production system.

fdanckwerts
New Contributor

Hi jarednichols, barnesaw.

Thank you for your answers. Because my JSS runs on Windows it is very complicated to do a http api put from a script. Power shell is able to do this, but only with more that 15 lines of code and then it is not even simple. I now installed "curl" for Windows and use it to update the database via api. This is no elegantly solution, but it works. ;)

Felix