HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/sos/report/plugins/__pycache__/watchdog.cpython-38.pyc
U

i��d>�@s6ddlmZmZmZddlmZGdd�dee�ZdS)�)�Plugin�RedHatPlugin�	PluginOpt)�globc@s<eZdZdZdZdZdZedddd�gZd	d
�Z	dd�Z
d
S)�WatchdogzWatchdog information.�watchdog)�system)r�	conf_filez/etc/watchdog.confzwatchdog config file)�defaultZdescc
Csxd}t|d��`}|D]T}|�d�d��}z(|�dd�\}}|��dkrP|��}Wqtk
rfYqXqW5QRX|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�r�#r�=�zlog-dir)�open�split�strip�
ValueError)�selfr	�log_dirZconf_f�line�key�value�r�=/usr/lib/python3/dist-packages/sos/report/plugins/watchdog.py�get_log_dirs	zWatchdog.get_log_dirc
Cs�|�|�d��}|�d�}|�|dg�|�ddg�z|�|�}|rJ|}Wn4tk
r�}z|�d||f�W5d}~XYnX|�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 %s: %sNZall_logs�*z*.stdoutz*.stderrz/dev/watchdog*zwdctl %s)Z	path_joinZ
get_optionZ
add_copy_specr�IOErrorZ	_log_warnrZadd_cmd_output)rr	r�res�exZ	log_filesZdevrrr�setup4s0
��
$
�
zWatchdog.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrZoption_listrrrrrrrs��rN)Zsos.report.pluginsrrrrrrrrr�<module>s