a G%@i’ ã@s6ddlmZddlmZmZmZGdd„deeƒZdS)é)Úglob)ÚPluginÚ RedHatPluginÚ PluginOptc@s<eZdZdZdZdZdZeddddgZd d „Z d d „Z d S)ÚWatchdogzWatchdog information.Úwatchdog)Úsystem)rú conf-filez/etc/watchdog.confzwatchdog config file)ÚdefaultZdescc CsŽd}t|dddh}|D]R}| d¡d ¡}z(| dd¡\}}| ¡d krT| ¡}WqtyhYq0qWdƒn1s€0Y|S) aGet watchdog log directory. Get watchdog log directory path configured in ``conf_file``. :returns: The watchdog log directory path. :returntype: str. :raises: IOError if ``conf_file`` is not readable. NÚrzUTF-8)Úencodingú#rú=ézlog-dir)ÚopenÚsplitÚstripÚ ValueError)ÚselfÚ conf_fileÚlog_dirZconf_fÚlineÚkeyÚvalue©rú?/usr/lib/python3.9/site-packages/sos/report/plugins/watchdog.pyÚ get_log_dirs    &zWatchdog.get_log_dirc Csö| | d¡¡}| d¡}| |dg¡| ddg¡z| |¡}|rJ|}Wn:ty†}z"| d|›d|›¡WYd}~n d}~00| d ¡r¤t| |d ¡ƒ}n t| |d ¡ƒt| |d ¡ƒ}| |¡t| d ¡ƒD]}| d|›¡qÜdS)zªCollect watchdog information. Collect configuration files, custom executables for test-binary and repair-binary, and stdout/stderr logs. r z/var/log/watchdogz/etc/sysconfig/watchdogz/etc/watchdog.dz/usr/libexec/watchdog/scriptszCould not read z: NZall_logsÚ*z*.stdoutz*.stderrz/dev/watchdog*zwdctl )Z path_joinZ get_optionZ add_copy_specrÚIOErrorZ _log_warnrZadd_cmd_output)rrrÚresÚexZ log_filesÚdevrrrÚsetup4s0 þþ , ÿ zWatchdog.setupN) Ú__name__Ú __module__Ú __qualname__Z short_descZ plugin_nameZprofilesZpackagesrZ option_listrr"rrrrrsÿÿrN)rZsos.report.pluginsrrrrrrrrÚ s