NIXStats / nixstatsagent

NIXStats monitoring agent
https://www.nixstats.com
Other
92 stars 38 forks source link

Plesk Cgroups Manager plugin #53

Closed btbroot closed 2 years ago

btbroot commented 2 years ago

Needs testing!

btbroot commented 2 years ago

Sample output:

{'/sys/fs/cgroup/user.slice/user-1000.slice': {'cpu.stat': {'system_usec': 0,
                                                            'ts': 1649097773.8887284,
                                                            'usage_usec': 0,
                                                            'user_usec': 0},
                                               'memory.current': 11092979712,
                                               'uid': 1000,
                                               'username': 'al'}}
btbroot commented 2 years ago

Tested on Focal

$ python3.8 plesk-cgroups.py >1; python3.8 /usr/lib/python3.8/pickle.py 1
{'/sys/fs/cgroup/unified/user.slice/user-999.slice': {'cpu.stat': {'system_usec': 0,
                                                                   'ts': 1649481010.8836482,
                                                                   'usage_usec': 0,
                                                                   'user_usec': 0},
                                                      'uid': 999,
                                                      'username': 'ubuntu'}}
btbroot commented 2 years ago

Tested on Focal:

$ python3.8 plesk-cgroups.py >1; python3.8 /usr/lib/python3.8/pickle.py 1
{'/sys/fs/cgroup/unified/user.slice/user-999.slice': {'cpu.stat': {'system_usec': 0,
                                                                   'ts': 1649482975.3983037,
                                                                   'usage_usec': 0,
                                                                   'user_usec': 0},
                                                      'memory.current': 1102839808,
                                                      'uid': 999,
                                                      'username': 'ubuntu'}}
btbroot commented 2 years ago

Tested on Focal:

$ python3.8 plesk-cgroups.py >1; python3.8 /usr/lib/python3.8/pickle.py 1
{'/sys/fs/cgroup/unified/user.slice/user-1000.slice': {'cpu.stat': {'system_usec': 0,
                                                                    'ts': 1649490574.0728345,
                                                                    'usage_usec': 0,
                                                                    'user_usec': 0},
                                                       'io.stat': {'11:0': {'Async': 0,
                                                                            'Discard': 0,
                                                                            'Read': 0,
                                                                            'Sync': 0,
                                                                            'Total': 0,
                                                                            'Write': 0,
                                                                            'ts': 1649490574.0727482},
                                                                   '252:0': {'Async': 0,
                                                                             'Discard': 0,
                                                                             'Read': 0,
                                                                             'Sync': 0,
                                                                             'Total': 0,
                                                                             'Write': 0,
                                                                             'ts': 1649490574.0727627}},
                                                       'memory.current': 2243121152,
                                                       'uid': 1000,
                                                       'username': 'al'}}
btbroot commented 2 years ago

This PR is abandoned as the original change will go to https://github.com/plesk/agent360 instead