import json, os, glob # find job ids for the failing jobs targets = { 'pa': ('/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json', ['大脑任务执行', 'Gateway看门狗-知微', '元自成长-每日', '记忆守卫-每日', '宏观新闻采集', '跨市场背离检测']), 'default': ('/home/hmo/.hermes/cron/jobs.json', ['大脑任务执行', 'evolution-pulse', 'wiki-self-growth', '知识研究-日常', '梦境循环-知识库归并']), } for label, (jf, names) in targets.items(): d = json.load(open(jf)) jobs = d if isinstance(d, list) else d.get('jobs', []) for j in jobs: if j.get('name') in names: print(f"{label} | {j['name']} | id={j.get('id')} | status={j.get('last_status')} | error={str(j.get('last_error'))[:200]}")