ÿØÿà JFIF ÿþ; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 157.90.209.209 / Your IP : 216.73.216.17 [ Web Server : Apache System : Linux hcomm124.dns-wk.info 4.18.0-553.64.1.el8_10.x86_64 #1 SMP Mon Jul 28 12:01:56 EDT 2025 x86_64 User : evidenciarevista ( 1049) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Domains : 216 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/2717180/root/usr/local/lib/python3.6/site-packages/agent360/plugins/ |
Upload File : |
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import subprocess import plugins import re class Plugin(plugins.BasePlugin): __name__ = 'postfix' def run(self, config): ''' 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 ''' data = {} maillog = config.get('postfix', 'log') pflbin = config.get('postfix', 'pflogsumm') pversion = config.get('postfix', 'version') mqueue = config.get('postfix', 'queue') output = os.popen('sudo ' + pflbin + ' -d today --detail 0 ' + maillog).read() for row in output.split("\n"): if re.search(r' +[0-9]+ +[a-z]{1}[a-z- ]+[a-z]', row): stat = re.findall(r'[a-z]{1}[a-z- ]+[a-z]', row)[0] num = re.findall(r'\b[0-9]*\b', row)[0] data[stat] = int(num) if pversion == "true": data['meta'] = {'version': 'Postfix ' + os.popen('sudo postconf -d | grep mail_version -m 1 | egrep -o "[0-9.]+"').read().rstrip()} if mqueue == "true": mqcommand = os.popen('sudo mailq | tail -n 1').read() if "empty" in mqcommand: data['queue'] = {'mails': 0 , 'size': 0 } else: data['queue'] = {'mails': re.findall(r'[0-9]+ Request', mqcommand)[0].replace(" Request", ""), 'size': re.findall(r'-- [0-9]+', mqcommand)[0].replace("-- ", "") } return data if __name__ == '__main__': Plugin().execute()