How to properly monitor cloud sync jobs?

rlpowell

Dabbler
Joined
Oct 6, 2022
Messages
25
There's an email alert for when a cloud sync job *fails*, but there's no email alert for when it *succeeds*, let alone for "it's been running for 3 days maybe something's wrong".

I'd really like a way to check if a cloud sync job has succeeded completely in the last, say, 2 days, and alert otherwise. I am comfortable with command line and API programming and so on, but I don't see any obvious way to do this.

I'm on TrueNAS Scale, in case that matters.

The /api/v2.0/core/get_jobs API call appears to only show the current running job if a job is running, so there's no way there to find out if the *last* job succeeded.

/var/log/jobs/ has the jobs in it, but I can't see anything that indicates success or failure in those logs.

/var/log/middlewared.log appears to be the logs for the thing that launches the jobs, but it also doesn't appear to indicate success or failure at all.

The best idea I've had so far is "have one script that calls the get_jobs API and writes out to a file if it sees SUCCESS, and have another script that checks the age of that file".

This whole thing is not awesome. Anyone have any better ideas? Am I missing something basic here?
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Congrats! You are better than 98% of the userbase of this forum, myself included.
Does it work? You might want to submit it as a resource.
 
Top