Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/watchdog.cpython-36.opt-1.pyc

3

�fO�@s6ddlmZddlmZmZmZGdd�dee�ZdS)�)�glob)�Plugin�RedHatPlugin�	PluginOptc@s<eZdZdZdZd
ZdZedddd�gZdd	�Z	d
d�Z
dS)�WatchdogzWatchdog information.�watchdog�system�	conf_filez/etc/watchdog.confzwatchdog config file)�defaultZdesccCs�d}t|ddd��d}x\|D]T}|jd�dj�}y(|jdd�\}}|j�d	krV|j�}Wqtk
rlYqXqWWdQRX|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)�selfr	�log_dirZconf_f�line�key�value�r�/usr/lib/python3.6/watchdog.py�get_log_dirs	
zWatchdog.get_log_dircCs�|j|jd��}|jd�}|j|dg�|jddg�y|j|�}|rJ|}Wn4tk
r�}z|jd||f�WYdd}~XnX|jd�r�t|j|d	��}n t|j|d
��t|j|d��}|j|�x$t|jd��D]}|jd
|�q�WdS)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�resZexZ	log_filesZdevrrr�setup3s*

$

zWatchdog.setupN)r)r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrZoption_listrrrrrrrs
rN)rZsos.report.pluginsrrrrrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists