Smart Group from Running Process

SynapticCleft
New Contributor III

Since we are able to kill a process that is restricted, can we, by extension, make a smart group from people who are running/not running a process? I want to pop up a dialog that tells the end user not to quit TeamViewer.

2 ACCEPTED SOLUTIONS

talkingmoose
Moderator
Moderator

What version of TeamViewer are they running? TeamViewer Host, for example, should be running as a system account. TeamViewer QuickSupport would run under a user account.

If you're running the full version of TeamViewer with the need to connect to a machine remotely then I suggest replacing it with TeamViewer Host.

To answer your question, I suggest using a launchd agent to keep a process running rather than relying on users to keep a process running.

View solution in original post

mm2270
Legendary Contributor III

Since Smart Groups are only populated from an inventory collection, this would seem like it would never quite be accurate. As in, the information could be hours or even days old.
Trying to make a message appear based on Smart Group status would probably end up firing at the wrong times or not fire when you'd want it to.

I think if you want a way to send up a message based on a process running or not running, you'd want to create something like a LaunchAgent or LaunchDaemon with a StartInterval of x seconds (no shorter than 10) that would run a simple script and check the process list and take action depending on the condition.

You could also try something like a Launchd that has a KeepAlive key for the TeamViewer executable, so it would relaunch it if it found it wasn't running. It won't prevent it from being quit, but it will relaunch it within around 10 seconds or less. Not sure if that would be helpful or not in your scenario.

View solution in original post

2 REPLIES 2

talkingmoose
Moderator
Moderator

What version of TeamViewer are they running? TeamViewer Host, for example, should be running as a system account. TeamViewer QuickSupport would run under a user account.

If you're running the full version of TeamViewer with the need to connect to a machine remotely then I suggest replacing it with TeamViewer Host.

To answer your question, I suggest using a launchd agent to keep a process running rather than relying on users to keep a process running.

mm2270
Legendary Contributor III

Since Smart Groups are only populated from an inventory collection, this would seem like it would never quite be accurate. As in, the information could be hours or even days old.
Trying to make a message appear based on Smart Group status would probably end up firing at the wrong times or not fire when you'd want it to.

I think if you want a way to send up a message based on a process running or not running, you'd want to create something like a LaunchAgent or LaunchDaemon with a StartInterval of x seconds (no shorter than 10) that would run a simple script and check the process list and take action depending on the condition.

You could also try something like a Launchd that has a KeepAlive key for the TeamViewer executable, so it would relaunch it if it found it wasn't running. It won't prevent it from being quit, but it will relaunch it within around 10 seconds or less. Not sure if that would be helpful or not in your scenario.