SAR command (sysstat) doesn't work into VM created using Ubuntu stemcell
I deployed a set of bosh managed vms using stemcells [3263.10] and [3312.12] with Ubuntu 14.04.
bosh-softlayer-xen-ubuntu-trusty-go_agent | ubuntu-trusty | 3312.12* | 1443361 |
Issuing the sar command I got:
root@a7bf2596-de9c-4e25-8f9f-eb1fe8bed821:~# sar Cannot open /var/log/sysstat/sa01: No such file or directory Please check if data collecting is enabled in /etc/default/sysstat
Despite sysstat is enabled by default Link it doesn't work.
Issue is due to the fact that directory /var/log/systat is missing. This directory is normally created by dpkg during the sysstat*.deb installation script. To me it seems a bug of pkg_mgr.
I fixed the deployed VMs by issuing: mkdir /var/log/sysstat service sysstat restart
@maximilien as per my email
It seems that stemcell contains the /var/log/sysstat folder, but this is "lost" when the bosh agent change the mount point of /var/log to /var/vcap/data/root_log file system.
Notice that the /var/log/sysstat folder is created by dpkg/apt-get during package installation and the sysstat service start script doesn't create that if missing.
sysstat dir is created on the wrong filesystem (/ one) and not on /var/vcap/data/root_log
The default permission of "/var/log" is set to 775 at line 40, but it's changed to 770 at line 907-910 in commit 257a51094b68933f3e26a65e561c6c49cdb9b6a2. Need to understand why it's changed to 770.
/cc @aalbanes @maximilien @cppforlife
@mattcui Matt I see, this is another issue.
The sysstat folder creation is not impacted by this permission change, that folder is created by root who owns the /var folder tree... as I said in comment#2 the issue is that deb installation via chroot creates the folder in the root filesystem (/), when the agent start it replace the mount point of /var/log to /var/vcap/data/root_log and this lead to sysstat folder to disappear.
@aalbanes yes, I think there needs to copy all content in /var/log to /var/vcap/data/root_log before bind mount.
@maximilien @jianqiu could you please help discuss with @cppforlife or other guys there when you get a chance. Thanks.
@mattcui DK had some customer thingie today. We'll try him tomorrow
Trying to use the sysstat plugin from Telegraf in a BOSH vm and having a similar issue, would you have any update?
Hey @cppforlife can we chat about this today? Thx
/cc @jianqiu
@fdhex @mattcui @maximilien and i looked into this just now. seems like we could augment stemcell to make it possible to start that service. it seems like unlike auditd service it doesnt create log directory on the fly: https://www.pivotaltracker.com/story/show/140456537
Resoled in stemcell 3421: https://github.com/cloudfoundry/bosh-linux-stemcell-builder/releases/tag/v3421