Move to a smart group, if a user pressed a button on self service

fr33silver
New Contributor

I want users to be moved to a smart group if they press a button on self-service.
For example, a user presses a "HELP!" button, they are immediately moved to a smart group and I get informed about it.

6 REPLIES 6

isThisThing0n
Contributor

Your ‘HELP!’ button could install a basic package that drops a receipt file somewhere (/etc/). Create an extension attribute that looks for the file and have the ‘HELP!’ policy run an immediate recon after it runs.

The smart group would be based on the presence of the receipt file.

If you use Slack you can create a webhook that will post an SOS alert to a private channel alerting you that a user clicked the button.

fr33silver
New Contributor

Interesting!
I'll look into it.

Thanks!

fr33silver
New Contributor

Now I'm at a blocker.
The file created, the computer was added to the smart group.
I was informed and handled it.

I want the computer out of the smart group. In other words, the file must get deleted.

Is it possible to put a timer on the file?

I used this script

#!/bin/sh
if [ -e /sbin/filename ]
then 
  echo "<result>True</result>"
else
  echo "<result>False</result>"
fi

What should I add, if I want it to delete the file after 30 minutes?

jcarr
Release Candidate Programs Tester

There are a number of ways to do this, but perhaps the simplest would be to have the script that lays down the receipt file have a timer that deletes it after 30 minutes. Just be sure to run recon after the file is put in place and again after it is deleted so that the EA is updated and the smart group membership recalculated.

mschroder
Valued Contributor

How does the timer know that you handled the case? Wouldn't it be safer if you triggered the removal of the file, once you handled the issue? You could write a policy that does the removal, add the smart group mentioned above as a 'Limitation', add the device in question to the 'Scope' once you handled the case, and also have the policy run a recon after the file removal.

isThisThing0n
Contributor

Is the smart group doing anything else other than triggering an email alert?

There are more efficient ways of sending notifications from users via self service.