{"definition_raw":"---\nid: oauth-health-check\ntitle: OAuth token health check (GWS + M365)\nschedule: \"*/30 * * * *\"\ntimeout: 90\nretry: false\nenabled: true\nnotify_on: failure\nnotify_to: dm\nrun_as: shell\ncommand: \"python3 /home/lucienne/workspace/scripts/oauth_health_check.py\"\ntags: [oauth, health, monitoring, google, m365]\nruntime_profile: direct_anthropic_sdk\n---\n\nChecks Google Workspace (gws) and Microsoft 365 (graph_api) OAuth tokens every\n30 minutes. Makes a lightweight API call to each service. If a token is expired\nor revoked, sends a Telegram alert so Elmar can re-authenticate before scheduled\ntasks fail.\n\nFor Google Workspace Testing-mode OAuth, also reads non-secret auth metadata\nfrom `~/.config/gws/credentials-meta.json` and sends proactive warning alerts\nbefore the estimated refresh-token expiry window (once at <=48h and once at\n<=24h when metadata is available). Existing legacy credentials without explicit\nauthorization metadata remain \"unknown\" until the next full Google re-auth.\n\nStatus JSON written to ~/workspace/data/oauth-health-status.json for dashboard consumption.\n","id":"oauth-health-check","last_run":{"duration_s":0.890681,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413837.log","output":"GWS: OK | M365: OK | checked: 06:00\n","started_at":"2026-06-13T06:00:44.596620+02:00","status":"completed"},"next_run":"2026-06-13 06:30","next_run_iso":"2026-06-13T06:30:00+02:00","runs":[{"duration_s":0.890681,"finished_at":"2026-06-13T06:00:45.489874+02:00","id":413837,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413837.log","output":"GWS: OK | M365: OK | checked: 06:00\n","started_at":"2026-06-13T06:00:44.596620+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.156303,"finished_at":"2026-06-13T05:30:24.207326+02:00","id":413748,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413748.log","output":"GWS: OK | M365: OK | checked: 05:30\n","started_at":"2026-06-13T05:30:23.048242+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":0.928811,"finished_at":"2026-06-13T05:00:55.968118+02:00","id":413668,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413668.log","output":"GWS: OK | M365: OK | checked: 05:00\n","started_at":"2026-06-13T05:00:55.036630+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.199182,"finished_at":"2026-06-13T04:30:24.841647+02:00","id":413577,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413577.log","output":"GWS: OK | M365: OK | checked: 04:30\n","started_at":"2026-06-13T04:30:23.639802+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.011453,"finished_at":"2026-06-13T04:04:36.598986+02:00","id":413493,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413493.log","output":"GWS: OK | M365: OK | checked: 04:04\n","started_at":"2026-06-13T04:04:35.584997+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.139,"finished_at":"2026-06-13T03:31:22.629699+02:00","id":413402,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413402.log","output":"GWS: OK | M365: OK | checked: 03:31\n","started_at":"2026-06-13T03:31:21.486877+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":0.957745,"finished_at":"2026-06-13T03:00:34.871183+02:00","id":413310,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413310.log","output":"GWS: OK | M365: OK | checked: 03:00\n","started_at":"2026-06-13T03:00:33.910617+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.165227,"finished_at":"2026-06-13T02:30:25.687746+02:00","id":413223,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413223.log","output":"GWS: OK | M365: OK | checked: 02:30\n","started_at":"2026-06-13T02:30:24.520078+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.041376,"finished_at":"2026-06-13T02:02:21.468824+02:00","id":413137,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413137.log","output":"GWS: OK | M365: OK | checked: 02:02\n","started_at":"2026-06-13T02:02:20.423051+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.133975,"finished_at":"2026-06-13T01:30:55.676063+02:00","id":413048,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/413048.log","output":"GWS: OK | M365: OK | checked: 01:30\n","started_at":"2026-06-13T01:30:54.539484+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":0.922458,"finished_at":"2026-06-13T01:00:38.585649+02:00","id":412961,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412961.log","output":"GWS: OK | M365: OK | checked: 01:00\n","started_at":"2026-06-13T01:00:37.659592+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.02833,"finished_at":"2026-06-13T00:30:24.876312+02:00","id":412873,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412873.log","output":"GWS: OK | M365: OK | checked: 00:30\n","started_at":"2026-06-13T00:30:23.846093+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.121221,"finished_at":"2026-06-13T00:00:47.347503+02:00","id":412784,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412784.log","output":"GWS: OK | M365: OK | checked: 00:00\n","started_at":"2026-06-13T00:00:46.224654+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.026988,"finished_at":"2026-06-12T23:30:24.029860+02:00","id":412696,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412696.log","output":"GWS: OK | M365: OK | checked: 23:30\n","started_at":"2026-06-12T23:30:22.999901+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":0.984127,"finished_at":"2026-06-12T23:00:36.473057+02:00","id":412609,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412609.log","output":"GWS: OK | M365: OK | checked: 23:00\n","started_at":"2026-06-12T23:00:35.486901+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.068765,"finished_at":"2026-06-12T22:30:24.550680+02:00","id":412522,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412522.log","output":"GWS: OK | M365: OK | checked: 22:30\n","started_at":"2026-06-12T22:30:23.479263+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.075371,"finished_at":"2026-06-12T22:00:32.907297+02:00","id":412435,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412435.log","output":"GWS: OK | M365: OK | checked: 22:00\n","started_at":"2026-06-12T22:00:31.829516+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.165339,"finished_at":"2026-06-12T21:30:24.888086+02:00","id":412348,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412348.log","output":"GWS: OK | M365: OK | checked: 21:30\n","started_at":"2026-06-12T21:30:23.719992+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.063629,"finished_at":"2026-06-12T21:00:31.327280+02:00","id":412262,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412262.log","output":"GWS: OK | M365: OK | checked: 21:00\n","started_at":"2026-06-12T21:00:30.261304+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"},{"duration_s":1.233548,"finished_at":"2026-06-12T20:30:24.983323+02:00","id":412174,"log_path":"/home/lucienne/workspace/logs/task-runs/oauth-health-check/412174.log","output":"GWS: OK | M365: OK | checked: 20:30\n","started_at":"2026-06-12T20:30:23.747209+02:00","status":"completed","task_id":"oauth-health-check","task_name":"OAuth token health check (GWS + M365)"}],"runs_limit":20,"schedule":"*/30 * * * *","schedule_label":{"description":"Every 30 minutes","is_custom":false,"label":"Every 30 min","sort":1,"sort_time":""},"stats":{"avg_duration":1.1131482091690543,"completed":349,"failed":0,"timeout":0,"total":349},"task":{"_description":"Checks Google Workspace (gws) and Microsoft 365 (graph_api) OAuth tokens every\n30 minutes. Makes a lightweight API call to each service. If a token is expired\nor revoked, sends a Telegram alert so Elmar can re-authenticate before scheduled\ntasks fail.\n\nFor Google Workspace Testing-mode OAuth, also reads non-secret auth metadata\nfrom `~/.config/gws/credentials-meta.json` and sends proactive warning alerts\nbefore the estimated refresh-token expiry window (once at <=48h and once at\n<=24h when metadata is available). Existing legacy credentials without explicit\nauthorization metadata remain \"unknown\" until the next full Google re-auth.\n\nStatus JSON written to ~/workspace/data/oauth-health-status.json for dashboard consumption.","_file":"oauth-health-check.md","_path":"/home/lucienne/workspace/tasks/oauth-health-check.md","command":"python3 /home/lucienne/workspace/scripts/oauth_health_check.py","enabled":true,"id":"oauth-health-check","notify_on":"failure","notify_to":"dm","retry":false,"run_as":"shell","runtime_profile":"direct_anthropic_sdk","schedule":"*/30 * * * *","tags":["oauth","health","monitoring","google","m365"],"timeout":90,"title":"OAuth token health check (GWS + M365)"}}
