Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE for psdiff - support subdirectories for config files #19

Closed
vilitux opened this issue Sep 27, 2019 · 1 comment
Closed

RFE for psdiff - support subdirectories for config files #19

vilitux opened this issue Sep 27, 2019 · 1 comment

Comments

@vilitux
Copy link
Member

vilitux commented Sep 27, 2019

To easily manage multiple pieces of config, it would be nice to support multiple configuration files under a directory instead of a single config file (/etc/psdiff.conf). Example:

$ ls -l /etc/psdiff.conf.d/
-rw-r--r-- 1 root root 0 sep 27 14:43 docker.conf
-rw-r--r-- 1 root root 0 sep 27 14:43 tetris.conf
-rw-r--r-- 1 root root 0 sep 27 14:43 zabbix.conf
@wdoekes
Copy link
Member

wdoekes commented Dec 5, 2019

Fixed in 4abe57a

# cat /etc/psdiff.d/kvm.py

class ProcessFormatterMixin(object):
    def adjust(self, process):
        super(ProcessFormatterMixin, self).adjust(process)

        # For kvm, show only "/usr/bin/kvm -id X -name Y".
        if process.cmdline.startswith('/usr/bin/kvm '):
            p = process.cmdline.split()
            new = [p[0]]
            [new.extend(p[i:i+2])
             for i, j in enumerate(p)
             if j.startswith(('-id', '-name'))]
            process.cmdline = ' '.join(new)

If the psdiff.conf is removed.

@wdoekes wdoekes closed this as completed Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants