idddlmZmZmZmZmZddlZddlZddlmZ GddeZ Gdde eZ Gdd e eeZ y) )Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOptN)datetimecBeZdZdZdZdZdZdZdZe ddd gZ 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)defaultdesccZ|j|j|jd|jdrdndd |j |j}tjd}|D]}|j|s|j|j|}d|d dz}||vr|jds[ tj|j}tjtj|z }|j d kDr d |z} |j%| |d|z} |j%| d|zy#t $r!|j d|jzYywxYw#t"$r"}|j d |d |Yd}~0d}~wwxYw)N*rrF) sizelimittailitzsar: could not list %szsa[\d]+r zCould not determine age of 'z'' - skipping converting to sar format: z sar -A -f %szsadf -x -- -A %sz%s.xml) add_copy_spec path_joinsa_path get_optionlistdirOSError _log_warnrecompilematchosstatst_mtimedttoday fromtimestampdays Exceptionadd_cmd_output) selfdir_listsa_regexfname sa_data_path sar_filename_ftime_ageerrsar_cmdsadf_cmds 8/usr/lib/python3/dist-packages/sos/report/plugins/sar.pysetupz Sar.setup5s 4>>$,,<*.//)*DQ$"'  ) ||DLL1H::j)  @E~~e$#~~dllEB $uQRy0 x/??95 %%'WW\%:%C%CF#%88:0@0@0H#HD#yy1} ( --|;G''>- <##Hh.>?- @  NN3dllB C  * )% NN$0!6 % %s+EAE?'E<;E<? F*F%%F*N) __name__ __module__ __qualname____doc__ short_desc plugin_nameprofilespackagesrr option_listr8r7r r s>0,JK(HHG)U; =K &@rCr ceZdZdZy) RedHatSarrNr9r:r;rrBrCr7rErE^sGrCrEceZdZdZy) DebianSarz/var/log/sysstatNrFrBrCr7rHrHcs GrCrH) sos.report.pluginsrrrrrr r#rr&r rErHrBrCr7rJsG99 #K@&K@\\ !\<!rC