Backup Monitoring using Nagios/Sensu


I’m thinking of adding monitoring of my infrastructure by building a Nagios/Sensu plugin. In essence, I’m wondering if I can check on the status of a Duplicati “instance” on a Linux/Mac computer using the command line. I could run a web query, or check a log file.

With Crashplan, I was basically looking (grep) in the log files for a successful backup in the last 48 hours.

Would anyone have a suggestions?


I’m not really sure how Nagios/Sensu works, but based on my guesses I would think some of these might be useful (note that some of these are theoretical, I don’t know if they’ll work or not):

  • use the --log-file parameter (and possibly --log-level) to give you a grep-able file
  • read the raw log tables from the sqlite log file
  • use a --run-script-after shell to get access to exitcode (and possibly other finish stats)
  • look at something like what @StephenGregory is doing here Export result in standardized format
  • use HTTP requests to the Duplicati server to get the same data shown in the web UI (which of course could include (last successful run")

Thanks for the leads.

The --run-script-after would be the easiest solution, as I could just make a shell script that checks the last return code. However, that requires changing something in each backup job.

The web option is flexible, as the monitoring could be remote and all OS could be checked from a single machine. However, is there any documentation on the API used by the UX so that I could call the backend directly? In addition, if I’ve password protected my backup, would basic-auth be enough to get the content I need?

I’ll do a little digging to see if I can’t find the answer to my questions.


Got a little more information. Assuming I can find a way to login, this would work :slight_smile:

curl ‘’ -XGET -H ‘Cookie: session-auth=xyz’ -H ‘X-XSRF-Token: xyz’

Login is handled by login.cgi, but everything seems complicated by the fact that it’s Angular. Having lots of problems with the X-XSRF-Token. I’ll take a look latter.

You’ve already gone beyond my experience with the API so I don’t know that I can help much there. :slight_smile:

I thought I had seen a topic where somebody else was looking at direct API calls but I can’t seem to find it now (maybe it was on GitHub).

It sounds like this may not be an issue for you but keep in mind that by default the Duplicati server only listens on localhost so if your monitor CLI call is on another machine you’ll need to open up the server to accepting requests from there. Note that the Duplicati server is NOT hardened, so it’s strongly recommended to not expose it over the internet!

If the CLI is on the same machine as all your jobs, you should be able to set a global setting --run-script-after call, but obviously this is less useful if you’re working across multiple machines.

And of course I forgot to include above that since Duplicati is open source you are free to pop on over to GitHub and look at directly adding Nagios/Sensu support in the source code… :wink: