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__/postfix.cpython-36.pyc

3

�uGh��@sHddlZddlZddlZddlZGdd�dej�ZedkrDe�j�dS)�Nc@seZdZdZdd�ZdS)�Plugin�postfixcCs*i}|jdd�}|jdd�}|jdd�}|jdd�}tjd|d|�j�}xJ|jd�D]<}tjd	|�rZtjd
|�d}	tjd|�d}
t|
�||	<qZW|d
kr�ddtjd�j�j	�i|d<|d
k�r&tjd�j�}d|kr�ddd�|d<n6tjd|�dj
dd�tjd|�dj
dd�d�|d<|S)ak
        Monitoring of the Postfix MTA log and optionally the Postfix version and the mailqueue
        Dependency: Pflogsumm log analyzer, sudo access

        Exampel config for /etc/agent360.ini:
        [postfix]
        enabled = yes
        log = /var/log/mail.log
        pflogsumm = /usr/sbin/pflogsumm
        version = true
        queue = true
        r�logZ	pflogsumm�version�queuezsudo z -d today --detail 0 �
z +[0-9]+ +[a-z]{1}[a-z- ]+[a-z]z[a-z]{1}[a-z- ]+[a-z]rz
\b[0-9]*\b�truezPostfix z>sudo postconf -d | grep mail_version -m 1 | egrep -o "[0-9.]+"�metazsudo mailq | tail -n 1�empty)Zmails�sizez[0-9]+ Requestz Request�z	-- [0-9]+z-- )�get�os�popen�read�split�re�search�findall�int�rstrip�replace)�self�config�dataZmaillogZpflbinZpversionZmqueue�output�row�stat�numZ	mqcommand�r�A/root/tmp/pip-build-gzoz1_uw/agent360/agent360/plugins/postfix.py�runs&

6z
Plugin.runN)�__name__�
__module__�__qualname__r!rrrr rsr�__main__)r�
subprocessZpluginsrZ
BasePluginrr"�executerrrr �<module>s+

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