diff --git a/agent360/plugins/diskusage.py b/agent360/plugins/diskusage.py index 14052b1..2478a16 100755 --- a/agent360/plugins/diskusage.py +++ b/agent360/plugins/diskusage.py @@ -11,13 +11,27 @@ class Plugin(plugins.BasePlugin): def run(self, config): + ''' + Returns disk partitions usage statistics. + + Example config for /etc/agent360.ini: + [diskusage] + enabled = yes + exclude = /dev/loop,/dev/snap,/squashfs,/cagefs-skeleton + ''' + disk = {} disk['df-psutil'] = [] + ignored_partitions = config.get('diskusage', 'exclude', fallback='').split(',') + if ignored_partitions == ['']: + ignored_partitions = ['/loop', '/snap', 'squashfs', 'cagefs-skeleton'] + else: + ignored_partitions += ['/loop', '/snap', 'squashfs', 'cagefs-skeleton'] + for part in psutil.disk_partitions(False): valid_part = True - ignored_partitions = ['/loop', '/snap', 'squashfs', 'cagefs-skeleton'] - + for ignore in ignored_partitions: if ignore in part.device or ignore in part.mountpoint or ignore in part.fstype: valid_part = False diff --git a/agent360/plugins/dovecot.py b/agent360/plugins/dovecot.py index 7c35c5e..0584959 100644 --- a/agent360/plugins/dovecot.py +++ b/agent360/plugins/dovecot.py @@ -13,7 +13,7 @@ def run(self, config): Returns active dovecot IMAP and POP3 session and the current version. Sudo permission to acces doveadm and dovecot commands are required. - Exampel config for /etc/agent360.ini: + Example config for /etc/agent360.ini: [dovecot] enabled = yes ''' diff --git a/agent360/plugins/postfix.py b/agent360/plugins/postfix.py index 0bc527d..6b9a880 100644 --- a/agent360/plugins/postfix.py +++ b/agent360/plugins/postfix.py @@ -13,7 +13,7 @@ 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: + Example config for /etc/agent360.ini: [postfix] enabled = yes log = /var/log/mail.log