Accessing the version-control system

If you plan to follow Zabbix development for a longer period of time, or if you want to see how exactly a particular change was implemented, daily snapshots will quickly become cumbersome to use. There are no snapshots of the feature branches, so we have to use SVN if the feature has not been merged into the main branches yet.

You can also browse the official SVN repository using a WebSVN instance: https://www.zabbix.org/websvn/wsvn/zabbix.com. It won't allow you to do a local checkout, but for a quick check on a few files, it can be more convenient.

To access SVN repositories, specific software—a client—is needed. There are many different SVN clients for various platforms, and you can choose whichever seems most convenient to you. Here, we will use the official command-line client. As this client is available on almost all Linux distributions, we may want to use it on our Zabbix test server. But before we start playing with it, we must know that the Zabbix source code repository resides at https://svn.zabbix.com/. In SVN, development is usually split into a trunk and branches. While the trunk represents the most recent development work, branches are usually used for stable version maintenance. Zabbix uses the same schema, and there are branches for stable version maintenance, such as 3.0; the development for the next stable version happens in the development section, the trunk. The changes do not happen in the version branches or trunk right away, though—they are first implemented in the development branches, which are usually located at svn://svn.zabbix.com/branches/dev/ZBX-1, with the correct ZBX or ZBXNEXT issue number at the end.

Let's say we are interested in the latest features and want to retrieve the trunk. To do this, run the following:

$ svn checkout svn://svn.zabbix.com/trunk zabbix-trunk

This will proceed to retrieve all the files in the trunk and place them in a directory called zabbix-trunk. As of writing this, the Zabbix trunk checkout uses approximately 118 MB on disk, but the amount transferred over the network will be less than that. Once the process completes, you might be tempted to proceed with compilation, but that won't be easy to do as there is no configuration script. There's a convenient script to generate the configuration:

$ ./bootstrap.sh

After this completes, we should have the configuration script. Now, we can compile this development version of Zabbix, right? Not quite yet. Development repositories hold only a generic database schema and content description, so we will not be able to create the database. We will have to generate the actual schema and data files ourselves. For the Zabbix frontend, specific CSS files have to be generated, too. It is also suggested you create a package, one just like those downloadable from the Zabbix site, so let's do that. But before we can generate the database schema and package, we have to use the configuration script. We can make it slightly faster and require fewer dependencies by omitting any features that are not required. This also enables the creation of a Zabbix package on another machine that does not have all the dependencies for the required functionality installed, such as SNMP or IPMI monitoring. In the simplest case, run the following:

$ ./configure

This will produce the files required for the database schema and package generation. Now, we can proceed with the schema and CSS-generation:

$ make dbschema
$ make css
We discussed the packages required for compilation in Chapter 1, Getting Started with Zabbix. For the make css step, you will also need the Sass Ruby gem.

With the database schema and CSS files generated, we are ready to create a package:

$ make dist

After this command completes, the source directory should have a new archive, named zabbix-<version>.tar.gz. Here, the version will be whatever name the development part has received. From now on, we are back on the known path, as this package is pretty much the same as the one you can download from the released version area or from the daily snapshots area.

But that was a lot of work to get the same thing we could have downloaded right away—why do it at all? Indeed, if you only want to grab the development version once, daily snapshots should be your choice. But an SVN checkout presents other benefits. Let's understand what those are.

When writing this book, Zabbix SIA announced to its partners that it was looking in moving to Git so it can be that things have changed and that the source code is now available in Git instead on SVN.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.179.119