files/disable-tso : Fix wrong interface column

ip monitor link command returns interface name in second column not first.

Signed-off-by: Dimitri Savineau <dimitri.savineau@enovance.com>
Merge pull request #84 from dsavineau/fix-tso-script

files/disable-tso : Fix wrong interface column
openstack-common: install ntpstat on Debian

ntpstat is used on install-server & openstack-full roles by monitoring
to detect if NTP is synchronized to the clock servers.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
openstack-full/monitoring: copy recursively the scripts

Since this commit:
https://github.com/enovance/openstack-monitoring/commit/3ec22e4cf8246e44445fd9f17157348d7aeb8dd1

We have a new directory for each OpenStack project to monitor.
We need to use -r when using "cp" otherwise the copy will fail.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
openstack-full/monitoring: only copy bash & python scripts

Do not copy legacy scripts

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
functions: update repo after adding a new repo

After adding a new repository, it's very useful to refresh the packages
list.

i.e. run apt-get update after adding OpenStack repository

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
functions: fix update_repositories to be run before "return"

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
functions: drop update_repositories

moving update_repositories in some functions was a bad idea since the
functions are used to redirect the output to a apt/yum file.
so each time update was run, the ouput was redirected to the file.

let's use update_repositories when we need it, which is the case in this
patch when we want to install ntpstat on Debian.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
openstack-full/monitoring: copy full dir

Monitoring scripts are not full Python and there is some dependencies
for common code.
It's important to keep the same namespace so let's copy recursively the
scripts to the nagios directory.

For example, nova scripts will go in <nagios-scripts-dir>/nova/*.py etc.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
openstack-full: add python-psutil package

python-psutil is missing to make run the monitoring scripts.

close #85

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
files/disable-tso: Refact script

Previous commit c98f8f55f745dc4d940a2c60fbe773d36fa57262 was not enough to fix
the problem.

The $LINE variable passed to vm_netlink and router_netlink doesn't use double
quotes so each column in $LINE is an argument and not a unique string.

7: qr-138be9c2-45: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
$1       $2                $3               $4  $5   $6     $7     $8     $9

Instead of getting the interface name in each function, the interface name is
filtered in ip_monitor and ethtool isn't applied to some interface like tap*
matching in the regex.

54: tap1c38b3fb-f7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
master qbr1c38b3fb-f7 state UNKNOWN mode DEFAULT qlen 500

ethool was applied to tap1c38b3fb-f7 because the regex matches with
qbr1c38b3fb-f7

Signed-off-by: Dimitri Savineau <dimitri.savineau@enovance.com>
Merge pull request #86 from dsavineau/refact-tso-script

files/disable-tso: Refact script
openstack-full: disable-tso script also on RHEL/CentOS

The TSO issue is confirmed to be also on RHEL/CentOS kernels.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
files/disable-tso: add missing "echo"

echo was missing to display two messages.
move monitoring from openstack-full to openstack-common
fix percona monitoring package under Debian/Ubuntu by moving from openstack-full to openstack-common
openstack-common: Do not start puppet during cloud-init

Currently cloud-init starts puppet during the initialization
phase[1]. This is not something we want as it generates incorrect
ssl keys for later use.

[1] https://github.com/number5/cloud-init/blob/master/cloudinit/config/cc_puppet.py#L118
openstack-common: Add missing -i flag for sed on cloud.cfg
openstack-common: Do not start puppet agent at boot
install-server: Adding numpy dependency