3

How can I receive notifications of failed cron jobs via my Unity desktop environment?

The age-old solution of having cron send emails is problematic as my ISP doesn't provide an SMTP server, and it's almost certain that my residential IP will be blacklisted. Sending mails locally to my own /var/mail/$USER spool file seems perfect, but yet, remarkably, I've not been able to find a desktop indicator applet for Unity that checks local mboxes. The mail-notification applet might, but given that its dependencies include bogofilter, evolution, and much much more, I refuse to install it on principal. There are a handful of other similar applets, but these either don't work on Unity, or don't work on local mboxes.

Searching online reveals many instances of people asking how to get notify-send to work, but all the solutions tend to assume the X session is running on DISPLAY=:0, which is only true ~50% of the time, as I share my desktop machine with my wife.

This is the sort of problem that was well solved 15 years ago with WindowMaker, for which there surely are/were many dockapps that monitor local mboxes, but yet, I'm genuinely at loss trying to get a solution on my modern Unity setup. I'd be most grateful for any suggestions. My own best effort is to have cron send local mails to the mbox and have Unity run a script upon startup that polls my spool file and keeps on pinging me with notifications until I empty it.

sircolinton
  • 131
  • 2
  • Have you found a working solution? I took a look at https://unix.stackexchange.com/questions/2881/show-a-notification-across-all-running-x-displays but coudn't get notify-send to work as root. – divieira Dec 19 '17 at 11:14
  • 1
    @divieira ugh, no, I gave up on looking for a good solution. I just write to output.log and try to remember to run "mail" from time to time to check my local mailbox. I'm very unsatisfied with this! – sircolinton Dec 20 '17 at 18:17
  • 1
    thanks for the reply! Too bad it didn't work out though. I'm using https://healthchecks.io/ . At least it alerts me via email when something fails, so that I can go and check. Hope you find a good solution! – divieira Dec 21 '17 at 18:45
  • @divieira Oh, good find, thanks! Healthchecks.io very conveniently does what I need; I'll start using it. Happy Christmas :-) – sircolinton Dec 24 '17 at 19:12
  • Glad to hear it helped! Happy holidays! – divieira Dec 26 '17 at 10:27

0 Answers0