HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //usr/local/lib/python3.9/site-packages/agent360/plugins/__pycache__/mdstat.cpython-39.pyc
a

q�dgl�@s@ddlZddlZddlZGdd�dej�Zedkr<e���dS)�Nc@seZdZdZdd�ZdS)�PluginZmdstatc	Cs�t�d���}i}zt�|�}Wnty4YdS0|d��D]�\}}i}|ddurdd|d<nd|d<|dd	ur�d|d<nd|d<|d
dur�d|d
<nd|d
<d|d<|d
��D]$\}}|dd	ur�|dd|d<q�|||<qB|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�A/usr/local/lib/python3.9/site-packages/agent360/plugins/mdstat.py�runs.



z
Plugin.runN)�__name__�
__module__�__qualname__rrrrrrsr�__main__)rZpluginsr	Z
BasePluginrr�executerrrr�<module>s
(