JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr O6ufddlmZddlZddlZddlmZmZmZmZm Z GddeZ Gdde eZ Gdd e eeZ y) )datetimeN)Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOptcHeZdZdZdZdZdZdZdZe ddd gZ d Z d Z y )SaraN The sar plugin is designed to collect system performance data as recorded by sysstat. The raw binary data, i.e. the 'saX' files, will be collected and for files a week old or younger, this plugin will capture human-readable conversions of those files provided by the 'sar' command locally available, if the local sysstat installation has not already created a converted copy (e.g. for the current day-of data being collected at the time of report generation). Using the 'all-sar' plugin option will not only cause the plugin to capture _all_ 'saX' files present on the host, but further perform the 'sar' conversion on all files, not just those produced within the last week. Converted 'sar' files will be written to the sos_commands/sar/, and not to the /var/log/ path that sysstat writes to. Note that this conversion is done because it is unlikely that the same version of sysstat that produces the 'saX' files will be the same version available on a given analyst's workstation, and this conversion is version sensitive. zSystem Activity Reportersar)system performance)sysstat /var/log/saall-sarFz"gather all system activity records)defaultdesccl|j|j|jd|jdrdndd |j |j}tjd}|D]}|j|s|j|j|}d|d dz}||vr:|jds|j|r`d |}|j||d |}|j||d y#t $r!|j d|jYywxYw) N*rrF) sizelimittailitzsar: could not list zsa[\d]+r z sar -A -f zsadf -x -- -A z.xml) add_copy_spec path_joinsa_path get_optionlistdirOSError _log_warnrecompilematchis_older_than_7daysadd_cmd_output)selfdir_listsa_regexfname sa_data_path sar_filenamesar_cmdsadf_cmds 8/usr/lib/python3/dist-packages/sos/report/plugins/sar.pysetupz Sar.setup5s0 4>>$,,<*.//)*DQ$"'  ) ||DLL1H::j)  >E~~e$#~~dllEB $uQRy0 x/??95// = *<.9G''>+L>:##Htn= >  NN1$,,@ A  sD 'D32D3c tj|j}tjtj |z }|j dkry y#t$r!}|jd|d|Yd}~yd}~wwxYw)z Is the file older than 7 days? FzCould not determine age of 'z'' - skipping converting to sar format: NT) osstatst_mtimedttoday fromtimestampdays Exceptionr)r$sarfile_ftime_ageerrs r,r"zSar.is_older_than_7daysSs HWWW%..F88: 0 0 88DyyA~   H NN9'CAADG H H  HsAA B&BBN) __name__ __module__ __qualname____doc__ short_desc plugin_nameprofilespackagesrr option_listr-r"r,r r sB0,JK(HHG)U; =K >< rFr ceZdZdZy) RedHatSarrNr<r=r>rrErFr,rHrHasGrFrHceZdZdZy) DebianSarz/var/log/sysstatNrIrErFr,rKrKfs GrFrK) rr3r0rsos.report.pluginsrrrrrr rHrKrErFr,rMsG$ 99N&Nb\ !\<!rF