HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/sos/report/plugins/__pycache__/watchdog.cpython-310.pyc
o

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)�default�descc
Cs�d}t|d��4}|D](}|�d�d��}z|�dd�\}}|��dkr(|��}Wq
ty2Yq
wWd�|S1s>wY|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_dir�conf_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|�|�}|r%|}WntyA}z|�d||f�WYd}~nd}~ww|�d�rPt|�|d	��}nt|�|d
��t|�|d��}|�|�t|�d��D]	}|�d
|�qldS)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: %sN�all_logs�*z*.stdoutz*.stderrz/dev/watchdog*zwdctl %s)�	path_join�
get_option�
add_copy_specr�IOError�	_log_warnr�add_cmd_output)rr	r�res�ex�	log_files�devrrr�setup4s8
��
���
�
�zWatchdog.setupN)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profiles�packagesr�option_listrr)rrrrrs��rN)�sos.report.pluginsrrrrrrrrr�<module>s