Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/watchdog.cpython-312.pyc
�

-�_g���<�ddlmZddlmZmZmZGd�dee�Zy)�)�glob)�Plugin�RedHatPlugin�	PluginOptc�@�eZdZdZdZdZdZeddd��gZd	�Z	d
�Z
y)�WatchdogzWatchdog information.�watchdog)�system)r	�	conf-filez/etc/watchdog.confzwatchdog config file)�default�descc�6�d}t|dd��5}|D]]}|jd�dj�}	|jdd�\}}|j�d	k(r|j�}�_	ddd�|S#t$rY�vwxYw#1swY|SxYw)
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_dir�conf_f�line�key�values       �=/usr/lib/python3/dist-packages/sos/report/plugins/watchdog.py�get_log_dirzWatchdog.get_log_dirs�����
�)�S�7�
3�
	�v��	
���z�z�#��q�)�/�/�1���#'�:�:�c�1�#5�L�S�%��y�y�{�i�/�"'�+�+�-���
	
�
	����	"�����
	���s.�(B�8A?�2B�?	B�B�
B�B�Bc��|j|jd��}|jd�}|j|dg�|jddg�	|j|�}|r|}|jd	�rt
|j|d
��}n7t
|j|d��t
|j|d��z}|j|�t
|jd
��D]}|jd|����y#t$r!}|jd|�d|���Yd}~��d}~wwxYw)z�Collect watchdog information.

            Collect configuration files, custom executables for test-binary
            and repair-binary, and stdout/stderr logs.
        rz/var/log/watchdogz/etc/sysconfig/watchdogz/etc/watchdog.dz/usr/libexec/watchdog/scriptszCould not read z: N�all_logs�*z*.stdoutz*.stderrz/dev/watchdog*zwdctl )�	path_join�
get_option�
add_copy_specr �IOError�	_log_warnr�add_cmd_output)rrr�res�ex�	log_files�devs       r�setupzWatchdog.setup4sC���N�N�4�?�?�;�#?�@�	��.�.�!4�5��	
����%�
�	�	
����+�
�	�	@��"�"�9�-�C�����?�?�:�&��T�^�^�G�S�9�:�I��d�n�n�W�j�A�B��d�n�n�W�j�A�B�C�I�	
���9�%�����'7�8�9�	0�C����&����/�	0���	@��N�N�_�Y�K�r�"��>�?�?��	@�s�D�	E� D<�<EN)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profiles�packagesr�option_listr r.��rrrs9��(�J��K��H��H�	�+�';�-�	/��K�
�2'0r8rN)r�sos.report.pluginsrrrrr7r8r�<module>r:s ���>�>�L0�v�|�L0r8