index.rst 8.92 KB
Newer Older
1
2
3
4
############
Installation
############

Antoine Nguyen's avatar
Antoine Nguyen committed
5
Merethis recommends using its official packages from the Centreon
6
7
8
9
Entreprise Server (CES) repository. Most of Merethis' endorsed
software are available as RPM packages.

Alternatively, you can build and install your own version of this
Dorian Guillois's avatar
Dorian Guillois committed
10
software by following the :ref:`user_installation_using_sources`.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

**************
Using packages
**************

Merethis provides RPM for its products through Centreon Entreprise
Server (CES). Open source products are freely available from our
repository.

These packages have been successfully tested with CentOS 5 and RedHat 5.

Prerequisites
=============

In order to use RPM from the CES repository, you have to install the
Dorian Guillois's avatar
Dorian Guillois committed
26
appropriate repo file. Run the following command as privileged user ::
27
28
29
30
31
32
33
34

  $ wget http://yum.centreon.com/standard/ces-standard.repo -O /etc/yum.repos.d/ces-standard.repo

The repo file is now installed.

Install
=======

Dorian Guillois's avatar
Dorian Guillois committed
35
Run the following commands as privileged user ::
36
37
38
39
40
41

  $ yum clean all
  $ yum install centreon-connector-perl

All dependencies are automatically installed from Merethis repositories.

Dorian Guillois's avatar
Dorian Guillois committed
42
.. _user_installation_using_sources:
43
44
45
46
47
48
49
50

*************
Using sources
*************

To build Centreon Connector Perl, you will need the following external
dependencies:

Dorian Guillois's avatar
Dorian Guillois committed
51
52
53
54
  * a C++ compilation environment.
  * CMake **(>= 2.8)**, a cross-platform build system.
  * Centreon Clib, The centreon Core library.
  * Perl, the perl library to use embedded perl.
55
56
57
58
59
60
61

This program is compatible only with Unix-like platforms (Linux,
FreeBSD, Solaris, ...).

Prerequisites
=============

Dorian Guillois's avatar
Dorian Guillois committed
62
63
CentOS
------
64

Dorian Guillois's avatar
Dorian Guillois committed
65
In CentOS you need to add manually cmake. After that you can
66
67
68
69
70
71
install binary packages. Either use the Package Manager or the
yum tool to install them. You should check packages version when
necessary.

Package required to build:

72
73
74
75
76
77
78
79
80
81
82
83
=========================== ===================== ==================================
Software                     Package Name         Description
=========================== ===================== ==================================
C++ compilation environment gcc gcc-c++ make      Mandatory tools to compile.
CMake **(>= 2.8)**          cmake                 Read the build script and
                                                  prepare sources for compilation.
Centreon Clib (>= 1.0)      centreon-clib-devel   Core library used by Centreon
                                                  Connector.
Perl                        perl                  Scripting language.
                            perl-devel (CentOS 6) Header perl (only for CentOS 6).
                            perl-ExtUtils-Embed   Embedded perl (only for CentOS 6).
=========================== ===================== ==================================
84

Dorian Guillois's avatar
Dorian Guillois committed
85
#. Install basic compilation tools ::
86

Dorian Guillois's avatar
Dorian Guillois committed
87
     $ yum install gcc gcc-c++ make perl
88
     $ yum install perl-devel perl-ExtUtils-Embed # Only for CentOS 6
89

Dorian Guillois's avatar
Dorian Guillois committed
90
#. Get and install cmake
91

Dorian Guillois's avatar
Dorian Guillois committed
92
   For CentOS 5 ::
93

Dorian Guillois's avatar
Dorian Guillois committed
94
95
96
     $ ARCH=`uname -m`
     $ wget http://apt.sw.be/redhat/el5/en/${ARCH}/extras/RPMS/cmake-2.8.8-1.el5.rfx.${ARCH}.rpm
     $ rpm -Uvh cmake-2.8.8-1.el5.rfx.${ARCH}.rpm
97

Dorian Guillois's avatar
Dorian Guillois committed
98
   For CentOS 6 ::
99

Dorian Guillois's avatar
Dorian Guillois committed
100
101
102
     $ ARCH=`uname -m`
     $ wget http://apt.sw.be/redhat/el6/en/${ARCH}/extras/RPMS/cmake-2.8.8-1.el6.rfx.${ARCH}.rpm
     $ rpm -Uvh cmake-2.8.8-1.el6.rfx.${ARCH}.rpm
Dorian Guillois's avatar
Dorian Guillois committed
103

Dorian Guillois's avatar
Dorian Guillois committed
104
#. Install Centreon Clib
105

Dorian Guillois's avatar
Dorian Guillois committed
106
   See the Centreon Clib :ref:`documentation <centreon-clib:centreon_clib_install>`.
107
108
109
110
111
112
113
114
115

Debian/Ubuntu
-------------

In recent Debian/Ubuntu versions, necessary software is available as
binary packages from distribution repositories. Either use the Package
Manager or the apt-get tool to install them. You should check packages
version when necessary.

Dorian Guillois's avatar
Dorian Guillois committed
116
Package required to build:
117

Dorian Guillois's avatar
Dorian Guillois committed
118
=========================== ================= ================================
119
Software                    Package Name      Description
Dorian Guillois's avatar
Dorian Guillois committed
120
=========================== ================= ================================
121
C++ compilation environment build-essential   Mandatory tools to compile.
Dorian Guillois's avatar
Dorian Guillois committed
122
123
124
125
CMake **(>= 2.8)**          cmake             Read the build script and
                                              prepare sources for compilation.
Centreon Clib               centreon-clib-dev Core library used by Centreon
                                              Connector.
126
Perl                        libperl-dev       Scripting language.
Dorian Guillois's avatar
Dorian Guillois committed
127
=========================== ================= ================================
128

Dorian Guillois's avatar
Dorian Guillois committed
129
#. Install compilation tools ::
130

Dorian Guillois's avatar
Dorian Guillois committed
131
   $ apt-get install build-essential cmake libperl-dev
132

Dorian Guillois's avatar
Dorian Guillois committed
133
134
#. Install Centreon Clib

Dorian Guillois's avatar
Dorian Guillois committed
135
   See the Centreon Clib :ref:`documentation <centreon-clib:centreon_clib_install>`.
Dorian Guillois's avatar
Dorian Guillois committed
136

137
138
139
140
141
142
143
144
145
146
OpenSUSE
--------

In recent OpenSUSE versions, necessary software is available as binary
packages from OpenSUSE repositories. Either use the Package Manager or
the zypper tool to install them. You should check packages version
when necessary.

Package required to build:

Dorian Guillois's avatar
Dorian Guillois committed
147
=========================== =================== ================================
148
Software                    Package Name        Description
Dorian Guillois's avatar
Dorian Guillois committed
149
=========================== =================== ================================
150
C++ compilation environment gcc gcc-c++ make    Mandatory tools to compile.
Dorian Guillois's avatar
Dorian Guillois committed
151
152
153
154
CMake **(>= 2.8)**          cmake               Read the build script and
                                                prepare sources for compilation.
Centreon Clib               centreon-clib-devel Core library used by Centreon
                                                Connector.
155
Perl                        perl                Scripting language.
Dorian Guillois's avatar
Dorian Guillois committed
156
=========================== =================== ================================
157

Dorian Guillois's avatar
Dorian Guillois committed
158
#. Install compilation tools ::
159

Dorian Guillois's avatar
Dorian Guillois committed
160
   $ zypper install gcc gcc-c++ make cmake perl
161

Dorian Guillois's avatar
Dorian Guillois committed
162
163
#. Install Centreon Clib

Dorian Guillois's avatar
Dorian Guillois committed
164
   See the Centreon Clib :ref:`documentation <centreon-clib:centreon_clib_install>`.
Dorian Guillois's avatar
Dorian Guillois committed
165

166
167
168
169
170
171
172
173
174
Build
=====

Get sources
-----------

Centreon Connector Perl can be checked out from Merethis's git
server at http://git.centreon.com/centreon-connector. The Perl
connector sources reside in the perl subdirectory. On a Linux box
Dorian Guillois's avatar
Dorian Guillois committed
175
with git installed this is just a matter of ::
176
177
178

  $ git clone http://git.centreon.com/centreon-connector

179
180
Or You can get the latest Centreon Connector's sources from its
`download website <http://www.centreon.com/Content-Download/download-centreon-connector>`_.
Dorian Guillois's avatar
Dorian Guillois committed
181
Once downloaded, extract it ::
182
183
184

  $ tar xzf centreon-connector.tar.gz

185
186
187
188
189
Configuration
-------------

At the root of the project directory you'll find a perl/build directory
which holds build scripts. Generate the Makefile by running the
Dorian Guillois's avatar
Dorian Guillois committed
190
following command ::
191
192
193
194

  $ cd /path_to_centreon_connector/perl/build

Your Centreon Connector Perl can be tweaked to your particular needs
Dorian Guillois's avatar
Dorian Guillois committed
195
using CMake's variable system. Variables can be set like this ::
196
197
198
199
200

  $ cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .

Here's the list of variables available and their description:

Dorian Guillois's avatar
Dorian Guillois committed
201
============================== ================================================ ======================
Dorian Guillois's avatar
Dorian Guillois committed
202
Variable                       Description                                      Default value
Dorian Guillois's avatar
Dorian Guillois committed
203
============================== ================================================ ======================
Dorian Guillois's avatar
Dorian Guillois committed
204
205
206
207
208
WITH_CENTREON_CLIB_INCLUDE_DIR Set the directory path of centreon-clib include. auto detection
WITH_CENTREON_CLIB_LIBRARIES   Set the centreon-clib library to use.            auto detection
WITH_CENTREON_CLIB_LIBRARY_DIR Set the centreon-clib library directory (don't   auto detection
                               use it if you use WITH_CENTREON_CLIB_LIBRARIES).
WITH_PREFIX                    Base directory for Centreon Connector Perl
Dorian Guillois's avatar
Dorian Guillois committed
209
                               installation. If other prefixes are expressed as ``/usr/local``
Dorian Guillois's avatar
Dorian Guillois committed
210
                               relative paths, they are relative to this path.
Dorian Guillois's avatar
Dorian Guillois committed
211
WITH_PREFIX_BINARY             Define specific directory for Centreon Connector ``${WITH_PREFIX}/bin``
Dorian Guillois's avatar
Dorian Guillois committed
212
213
214
                               Perl binary.
WITH_TESTING                   Enable generation of unit tests. They can later  OFF
                               be run by typing *make test*.
Dorian Guillois's avatar
Dorian Guillois committed
215
============================== =======================================================================
216

Dorian Guillois's avatar
Dorian Guillois committed
217
Example ::
218
219
220

  $ cmake \
     -DWITH_PREFIX=/usr \
Dorian Guillois's avatar
Dorian Guillois committed
221
     -DWITH_PREFIX_BINARY=/usr/lib/centreon-connector \
222
223
     -DWITH_TESTING=0 .

Dorian Guillois's avatar
Dorian Guillois committed
224
At this step, the software will check for existence and usability of the
Dorian Guillois's avatar
Dorian Guillois committed
225
rerequisites. If one cannot be found, an appropriate error message will
Dorian Guillois's avatar
Dorian Guillois committed
226
227
be printed. Otherwise an installation summary will be printed.

Dorian Guillois's avatar
Dorian Guillois committed
228
229
230
231
232
233
.. note::
  If you need to change the options you used to compile your software,
  you might want to remove the *CMakeCache.txt* file that is in the
  *build* directory. This will remove cache entries that might have been
  computed during the last configuration step.

234
235
236
Compilation
-----------

Dorian Guillois's avatar
Dorian Guillois committed
237
Once properly configured, the compilation process is really simple ::
238
239
240
241
242
243
244
245
246

  $ make

And wait until compilation completes.

Install
=======

Once compiled, the following command must be run as privileged user to
Dorian Guillois's avatar
Dorian Guillois committed
247
finish installation ::
248
249
250
251

  $ make install

And wait for its completion.