vzstats

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search


vzstats is a tool to gather OpenVZ usage statistics. This page tries to explain it, mostly in form of questions and answers.

vzstats consists of a client and a server. A client (vzstats package) is installed on an OpenVZ server (hardware node), so there are many clients. There is only one server, it is deployed at stats.openvz.org.

General

What is the purpose of vzstats?

We, OpenVZ developers, are curious. We want to know more about our users. We want some stats.

We would like to know how many OpenVZ servers are there in the wild. Since OpenVZ is free software available from many places, there is no easy way to find out.

We want to know which OpenVZ kernels are our users run, say what is the proportion of RHEL5 to RHEL6 kernel user base.

We would like to see how many people use new technologies such as ploop and vswap.

It would be good to know for how many CPU cores, or number of containers, or gigabytes of disk space, should we optimize.

Finally, we share all that information back to you.

Why do I need to participate?

Maybe because you want to help OpenVZ out just a bit. Because sharing is good. Or perhaps you are just a good person.

Why is it opt-out rather than opt-in?

We just don't have a good place (such as installer or some GUI) to ask you for opt-in.

What about my privacy?

We are trying to keep the client very simple, so you can see for yourself what information is gathered and how it is being sent.

All submissions are anonymous and is not including your IPs, MAC addresses, host names etc.

Except for the information gathered, server knows client's UUID and IP.

UUID is random, it's only purpose to track each client as a separate distinct entity.

Client IP address is naturally known to the server. It is stored in httpd server logs but is not used for statistics.

Client

How the client works?

When vzstats is executed, it does the following:

  1. checks if UUID is obtained; asks the server for one if it's not;
  2. runs scripts from /usr/libexec/vzstats directory;
  3. collects their output into separate text files, one per script;
  4. creates a tarball with all these text files
  5. sends this tarball together with UUID to the stats server, stats.openvz.org

Where can I see client source code?

Client is written in shell, so just check /usr/sbin/vzstats script.

There is a git repository for client code, see http://git.openvz.org/?p=vzstats;a=summary

What is UUID?

Это просто уникальный случайный идентификатор в формате UUID v4 [1]. Пример такого UUID: 285ad6e8-fe62-433c-be2a-643e1c54b315

Когда vzstats запускается в первый раз он проверяет, что у него нет UUID. Запрашивает его у сервера и сохраняет полученный UUID локально.

Какая информация собирается?

Для получения подробностей смотрите скрипты в /usr/libexec/vzstats.

Скачать

Последнюю и предыдущие версии vzstats вы можете найти на Download/vzstats.

Исходный код

https://src.openvz.org/projects/OVZL/repos/vzstats/browse

Когда он запускается?

vzstats запускается в следующих случаях:

  • После установки, если OpenVZ уже установлен.
  • Когда какой-либо из пакетов OpenVZ обновлен (vzctl, vzquota, ploop, kernel)
  • Раз в месяц по крону, если crond запущен.

Вы также можете запустить его в ручную (/usr/sbin/vzstats под root) , если хотите обновить статистику по Вашему серверу.

Как отключить отправку

Вы можете полностью деактивировать vzstats клиент на Вашем компьютере выполнив следующую команду:

touch /etc/vz/vzstats-disable

Если Вы захотите включить его снова просто выполните:

rm -f /etc/vz/vzstats-disable

Сервер

Сервер состоит из следующих частей:

  • база данных (MySQL)
  • просто скрипт для генерации UUID
  • скрипт, который сохраняет переданный файл
  • скрипт для обработки и сохранения данных в базу данных
  • веб-интерфейс (http://stats.openvz.org/), который показывает статистику из базы данных

Также смотрите