juju / autopilot-log-collector

GNU General Public License v3.0
2 stars 6 forks source link

Add collection of ps_mem output to juju hosts. #4

Closed fginther closed 7 years ago

fginther commented 7 years ago

This creates a /var/log/ps_mem.txt file on each juju host machine (not on lxds). The logs are then collected via the bootstrap unit (machine 0) and the base-machine units in the inner environment. Collection looks like:

2017-01-24 19:56:53,238 INFO Collecting ps_mem output for all hosts including bootstrap
2017-01-24 19:56:55,364 INFO Collecting ps_mem output on unit 1
2017-01-24 19:57:00,300 INFO Collecting ps_mem output on unit 0
2017-01-24 19:57:07,115 INFO Collecting ps_mem output on unit 3
2017-01-24 19:57:13,722 INFO Collecting ps_mem output on unit 2
2017-01-24 19:57:25,716 INFO Collecting ps_mem output on unit 5
2017-01-24 19:57:31,989 INFO Collecting ps_mem output on unit 4

ps_mem.txt looks like:

 Private  +   Shared  =  RAM used   Swap used   Program

132.0 KiB +  53.0 KiB = 185.0 KiB         0.0 KiB     0.0 KiB   tee
192.0 KiB +  30.0 KiB = 222.0 KiB         0.0 KiB     0.0 KiB   acpid
  8.0 KiB + 268.0 KiB = 276.0 KiB       220.0 KiB   220.0 KiB   rabbitmq-server (2)
 80.0 KiB + 253.0 KiB = 333.0 KiB       108.0 KiB   144.0 KiB   inet_gethost (2)
...
  1.0 GiB +  47.7 MiB =   1.0 GiB        28.6 MiB   123.0 MiB   neutron-server (11)
  1.8 GiB +   1.8 MiB =   1.8 GiB       147.2 MiB   147.2 MiB   mongod (2)
  1.9 GiB +   4.2 MiB =   1.9 GiB         9.9 MiB     9.9 MiB   landscape-clien (8)
-------------------------------------------------------------
                         10.7 GiB       901.9 MiB     1.7 GiB
=============================================================

This example is stored under: landscape-0-inner-logs/base-machine-0/var/log/ps_mem.txt

This was tested manually on a local deployment by running collect-logs logs.tar.gz.

blackboxsw commented 7 years ago

Good 1 fginther. Land away.