コード例 #1
0
        IfotFileWatch('arc', 1, 'sun_pos_mon'),
        SkaWebWatch('arc', 1, 'index.html'),
        SkaWebWatch('arc', 1, 'chandra.snapshot'),
        SkaWebWatch('arc', 1, 'hrc_shield.png'),
        SkaWebWatch('arc', 1, 'GOES_xray.gif'),
        SkaWebWatch('arc', 1, 'GOES_5min.gif'),
        SkaWebWatch('arc', 1, 'solar_wind.gif'),
        SkaWebWatch('arc', 1, 'ACE_5min.gif')])

set_report_attrs(jws)
# Are all the reports OK?
report_ok = all([j.ok for j in jws])
errors = [job.basename for job in jws if not job.ok]
# Set the age strings manually to display in hours
for jw in jws:
    jw.age_str = '{:.2f}'.format(jw.age / HOURS) if jw.exists else 'None'
index_html = make_html_report(jws, args.rootdir,
                              index_template=os.path.join(FILEDIR,
                                                          'hourly_template.html'),
                              just_status=True
                              )
recipients = ['*****@*****.**']

if args.email and not report_ok:
    jobwatch.sendmail(
        recipients, index_html, args.date_now,
        subject="{} Week {} errors: {}".format(
            time.strftime("%Y", time.localtime()),
            time.strftime("%W", time.localtime()),
            ", ".join(errors)))
コード例 #2
0
    FileWatch('dsn_summary', 1,
              '/data/mta4/proj/rac/ops/ephem/dsn_summary.dat'),
    SkaWebWatch('gui_stat_reports', 10, 'index.html'),
    SkaWebWatch('fid_drift', 2, 'drift_acis_s.png'),
    SkaWebWatch('eng_archive', 1, '', filename='/proj/sot/ska/data/eng_archive/data/dp_pcad32/TIME.h5'),
    SkaWebWatch('kadi', 1, '', filename='/proj/sot/ska/data/kadi/events.db3'),
    SkaWebWatch('obc_rate_noise', 50, 'trending/pitch_hist_recent.png'),
    SkaWebWatch('perigee_health_plots', 5, 'index.html'),
    SkaWebWatch('vv_rms', 10, 'hist2d_fig.png'),
    ])

jws.extend([
    SkaDbWatch('acq_stats_data', 4),
    SkaDbWatch('aiprops', 4),
    SkaDbWatch('cmds', -1, timekey='date'),
    SkaDbWatch('cmd_states', -1, timekey='datestart'),
    SkaDbWatch('load_segments', -1, timekey='datestop'),
    SkaDbWatch('obspar', 4),
    SkaDbWatch('starcheck_obs', 4, timekey='mp_starcat_time'),
    SkaDbWatch('trak_stats_data', 4, timekey='kalman_tstart'),
    ])

set_report_attrs(jws)
index_html = make_html_report(jws, args.rootdir, args.date_now)
recipients = ['*****@*****.**']

if args.email:
    jobwatch.sendmail(recipients, index_html, args.date_now)

jobwatch.remove_old_reports(args.rootdir, args.date_now, args.max_age)