Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/mdstat.cpython-36.pyc

3

�uGhl�@s@ddlZddlZddlZGdd�dej�Zedkr<e�j�dS)�Nc@seZdZdZdd�ZdS)�PluginZmdstatc	
Cs�tjd�j�}i}ytj|�}Wntk
r4dSXx�|dj�D]�\}}i}|ddk	rfd|d<nd|d<|dd	k	r�d|d<nd|d<|d
dk	r�d|d
<nd|d
<d|d<x4|d
j�D]$\}}|dd	k	r�|dd|d<q�W|||<qDW|S)z�
        Monitor software raid status using mdadm:
        pip install mdstat

        Requires sudo access to mdjson add to /etc/sudoers:
        agent360 ALL=(ALL) NOPASSWD: /usr/local/bin/mdjson
        ZmdjsonzCould not load mdstat dataZdevices�activeTr�Z	read_onlyFZresyncNZfaulty�disks)�os�popen�read�json�loads�	Exception�items)	�self�config�data�results�key�valueZdeviceZdiskZ	diskvalue�r�@/root/tmp/pip-build-gzoz1_uw/agent360/agent360/plugins/mdstat.py�runs.


z
Plugin.runN)�__name__�
__module__�__qualname__rrrrrrsr�__main__)rZpluginsr	Z
BasePluginrr�executerrrr�<module>s
(

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