Is there a simple GUI application that will monitor running processes periodically and alert the user when a process is not running? The ones I have found are far too complex (eg Monit). I am sure this is trivial to achieve with a script, but I’d rather use a GUI.
A use case would look like this: every 60 minutes check if Syncthing is running and display a notification if it’s not. In my experience, Syncthing is very reliable when it launches successfully but there may be an issue with conflicting versions that may prevent it from running at boot. Syncthing has no way to alert the GUI user when something goes wrong and you may find after you left home that your laptop hasn’t synced. Checking manually is a headache, prone to errors and goes against the idea of fit and forget.
(Debian Trixie with KDE Plasma)
i use syncthing, and start it via the systems service. i found it reliable. systems has a feature by which you can get notified on error (look up the onerror key), you might be able to do what u need with that.
alternately, you can run a systemd timer that runs periodically and notifies you when your condition is met. if u want a pop-up, use zenity etc.
By systems service you’re talking about systemd, right? I found this guide that sets up syncthing as a systemd service. Archwiki has a different one though.
And as the Archwiki alludes to, there’s this Syncthingtray tool that can be set up to show notifications.
Hello! I don’t know of a desktop watchdog application that will do this for you, but you may be able to achieve this with a simple cron job. Probably just an hourly crontab entry that looks for a running process with the right name, and uses something like
notify-send
to send an alert if it’s not found. I’ll jump on the computer and have a quick play, though I run gnome not plasma so I don’t know how well it will translate.I know you’re looking for a desktop solution, but here’s something that you can try in case you can’t find one – I’m betting that having a solution is better than having none!
So I just had a quick muck around:
- You can use
pgrep
to detect if a process with a given name is running - You can use
notify-send
(part of thelibnotify-bin
package) to publish a configurable desktop notification - You can drop it into a cron job to run it automatically on a schedule
As a test, the following command will look for a process called
syncthing
and send a desktop notification if it can’t find it:pgrep syncthing || notify-send "Syncthing is not running"
To set up a cron job:
- open a terminal
- run
sudo apt update && sudo apt install -y libnotify-bin
to install the app that will let you send desktop notifications - open the editor with
crontab -e
(if you need to pick an editor,nano
will probably be your best bet, it’s easiest to use) - in the editor, add the following line to the end of the file:
0 * * * * pgrep syncthing || notify-send "Syncthing is not running"
- The
0 * * * *
sets up the schedule (on the 0th minute of every hour, every day of the month, every month, on every day of the week) - Everything after that is the command to run
- The
- save and quit
If you ever want to get rid of it, just open the cron file again (
crontab -e
) and remove the line.Good luck, I hope you find what you’re looking for!
[edit] added step (2) to install libnotify-bin in case you don’t have it already.
I went for this one and it works with both
notify-send
and/dev/pts/0
. Not sure why it is better, but I opted for the latter. Simple, lightweight and versatile, suitable for any process.Any KDE Plasma users reading this, to enable notifications history for these you can follow the instructions here. Many thanks everyone.
- You can use
It doesn’t work for me (using plasma). Also it seems to be using DBUS which I am not sure if it will work within a cron job.
A simple solution that works for me is something like this:
echo hello > /dev/pts/0