HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/watchdog.cpython-39.pyc
a

^��c>�@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
Cs�d}t|d��h}|D]R}|�d�d��}z(|�dd�\}}|��dkrP|��}WqtydYq0qWd�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�r�#r�=�zlog-dir)�open�split�strip�
ValueError)�selfr	�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|}Wn6ty�}z|�d||f�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 %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_files�devrrr�setup4s0
��
(
�
zWatchdog.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrZoption_listrr rrrrrs��rN)Zsos.report.pluginsrrrrrrrrr�<module>s