HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/mdstat.cpython-36.pyc
3

3	Egl�@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-f6rmvwrq/agent360/agent360/plugins/mdstat.py�runs.


z
Plugin.runN)�__name__�
__module__�__qualname__rrrrrrsr�__main__)rZpluginsr	Z
BasePluginrr�executerrrr�<module>s
(