Category: rpm package


There are two possible ways to install VMware tools on Linux servers. Either you install them through the VSphere client, either you can automate this task with Puppet. VMware has provided special repositories for all the Linux distribution flavors :  VMware Operating System Specific Packages (OSPs)

Here are the main steps to complete this installation :

->Download the public keys of the VMware OSPs repositories :

rpm –import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

rpm –import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub

->Add a  new repo for YUM in /etc/yum.repos.d/ :

cat /etc/yum.repos.d/vmware-tools.repo
[vmware-tools]
name=VMware Tools
baseurl=http://packages.vmware.com/tools/esx/5.1/rhel6/x86_64
enabled=1
gpgcheck=1

->Fetch the metapackage vmware-tools-esx-nox and it will install all the required dependencies.

Here is now an example of a working Puppet manifest to deploy and install the VMware Tools on Linux servers running RHEL 6.4  :

cat vmwaretools.pp

class vmwaretools {
        exec { “Fetching RSA key”:
        command => “rpm –import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub”,
        path => “/sbin:/bin”
        }

        exec { “Fetching DSA key”:
        command => “rpm –import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub”,
        path => “/sbin:/bin”
        }

        exec { “Setting VMWare yum repo” :
        command => “echo -e \”[vmware-tools]\nname=VMware Tools\nbaseurl=http://packages.vmware.com/tools/esx/5.1/rhel6/x86_64\nenabled=1\ngpgcheck=1\” > /etc/yum.repos.d/vmware-tools.repo”,
        path => “/sbin:/bin”
        }

        package { “vmware-tools-esx-nox”:
          ensure => “installed”
        }
}

Do not forget to reload the puppetmaster on the server where it is located :

service puppetmaster reload

More information about VMware OSPs repositories : Read more

Alongside Centreon, it might be interesting to have additional monitoring and capacity planning tools. Cacti is a frontend to RDDTool and can gather and store state information from any element of your IT infrastructure. Information are located in a MySQL database and in RDD databases as well. RHEL 5.8 comes up with a rpm package for Cacti.

Here are the prerequisites for Cacti. Please install these dependencies as an initial step :

root@localhost:~# rpm -qa |grep -Ei ‘(httpd|mysql-server|php-mysql|php-gd|php-snmp)’
httpd-2.2.3-65.el5_8
mysql-server-5.0.95-1.el5_7.1
php-mysql-5.1.6-39.el5_8
php-gd-5.1.6-39.el5_8
php-snmp-5.1.6-39.el5_8

If the packages above are not present, please install them.  Then, create the MySQL database cacti and an user cactiuser with the appropriate privileges.

root@localhost:~#mysql -u root -p ‘create database cacti’

mysql> CREATE USER cactiuser

mysql> GRANT ALL ON cacti.* to cactiuser@localhost IDENTIFIED BY ‘your_password’;

mysql> FLUSH privileges;

mysql> quit;

Now populate the new database cacti with its structure. Import the sql database creation file as follows :

fool@localhost:~$ mysql -u root -p cacti < /usr/share/doc/cacti-0.8.8a/cacti.sql

Add the right credentials to access cacti database in this file :

root@localhost:~# cat /etc/cacti/db.php

<?php
/*
+————————————————————————-+
| Copyright (C) 2004-2012 The Cacti Group                                 |
|                                                                         |
| This program is free software; you can redistribute it and/or           |
| modify it under the terms of the GNU General Public License             |
| as published by the Free Software Foundation; either version 2          |
| of the License, or (at your option) any later version.                  |
|                                                                         |
| This program is distributed in the hope that it will be useful,         |
| but WITHOUT ANY WARRANTY; without even the implied warranty of          |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
| GNU General Public License for more details.                            |
+————————————————————————-+
| Cacti: The Complete RRDTool-based Graphing Solution                     |
+————————————————————————-+
| This code is designed, written, and maintained by the Cacti Group. See  |
| about.php and/or the AUTHORS file for specific developer information.   |
+————————————————————————-+
| http://www.cacti.net/                                                   |
+————————————————————————-+
*/

/* make sure these values refect your actual database/host/user/password */
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
//$database_password = “your_password”;
$database_password = “cacti”;
$database_port = “3306″;
$database_ssl = false;

/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
//$url_path = “/cacti/”;

/* Default session name – Session name must contain alpha characters */
//$cacti_session_name = “Cacti”;

?>

Once done, modify Apache configuration file to make cacti available to browsers. In the first lines of /etc/httpd/conf.d/cacti.conf, make sure you have these details :

Alias /cacti    /usr/share/cacti

<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require host localhost
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
#               Deny from all
#               Allow from localhost
Allow from all
</IfModule>
</Directory>

I replaced Allow from localhost by Allow from all. You can replace it if you want to limit access to http://localhost/cacti for security reasons.

After Apache conf file being modified, reload its configuration :

root@localhost:~#service httpd configtest && service httpd reload

The last steps of Cacti configuration is made through a web interface. Point your browser to the following url : http://localhost/cacti and just click on the next button at the bottom right hand corner to complete the installation.


Time now to log in. The default credentials are admin/admin. You will asked to change admin’s password :

And finally :

 

 

 

Centreon latest stable version was released on the 1st of August. On a server running RHEL 5.8 with the official Centreon repositories, here are the steps to follow. Make sure that you have installed the yum configuration file for CES repository :

root@localhost:~# cat /etc/yum.repos.d/ces-standard.repo

[ces-standard]
name=Centreon Entreprise Server RPM repository for ces $releasever
baseurl=http://yum.centreon.com/standard/stable/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CES
priority=1

[ces-standard-noarch]
name=Centreon Entreprise Server RPM repository for ces $releasever
baseurl=http://yum.centreon.com/standard/stable/noarch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CES
priority=1

[ces-standard-deps]
name=Centreon Entreprise Server dependencies RPM repository for ces $releasever
baseurl=http://yum.centreon.com/standard/stable/dependencies/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CES
priority=1

[ces-standard-deps-noarch]
name=Centreon Entreprise Server dependencies RPM repository for ces $releasever
baseurl=http://yum.centreon.com/standard/stable/dependencies/noarch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CES
priority=1

Stop some Centreon-related services :

root@localhost:~# service ndo2db stop

root@localhost:~#service centstorage stop

root@localhost:~#service centcore stop
Then, run yum update and you will get the list of rpm  packages to be upgraded for Centreon :

root@localhost:~#yum update

Dependencies Resolved

=============================================================================================================================
 Package                          Arch               Version                          Repository                        Size
=============================================================================================================================
Updating:
 centreon                         noarch             2.3.9-4                          ces-standard-noarch              7.4 M
 centreon-database                noarch             2.3.9-4                          ces-standard-noarch               59 k
 centreon-plugin-meta             noarch             2.3.9-4                          ces-standard-noarch              8.2 k
 centreon-plugins                 noarch             2.3.9-4                          ces-standard-noarch               74 k
 dhclient                         x86_64             12:3.0.5-31.el5_8.1              rhel-5-server-rpms               287 k
 initscripts                      x86_64             8.45.42-1.el5_8.1                rhel-5-server-rpms               1.6 M
 sudo                             x86_64             1.7.2p1-14.el5_8.3               rhel-x86_64-server-5             359 k
Installing for dependencies:
 php-pear-Archive-Zip             noarch             0.1.2-1                          ces-standard-noarch               22 k

Transaction Summary
=============================================================================================================================
Install       1 Package(s)
Upgrade       7 Package(s)

Total                                                                                        650 kB/s | 9.8 MB     00:15     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : initscripts                                                                                          1/15
  Updating       : sudo                                                                                                 2/15
  Updating       : dhclient                                                                                             3/15
  Updating       : centreon-plugins                                                                                     4/15
  Updating       : centreon-database                                                                                    5/15
  Installing     : php-pear-Archive-Zip                                                                                 6/15
install ok: channel://pear.php.net/Archive_Zip-0.1.2
  Updating       : centreon-plugin-meta                                                                                 7/15
  Updating       : centreon                                                                                             8/15
  Cleanup        : sudo                                                                                                 9/15
  Cleanup        : centreon-plugins                                                                                    10/15
  Cleanup        : centreon-plugin-meta                                                                                11/15
  Cleanup        : initscripts                                                                                         12/15
  Cleanup        : centreon                                                                                            13/15
  Cleanup        : centreon-database                                                                                   14/15
  Cleanup        : dhclient                                                                                            15/15
rhel-5-server-cf-tools-1-rpms/productid                                                               | 1.7 kB     00:00     
rhel-5-server-rpms/productid                                                                          | 1.7 kB     00:00     
Installed products updated.

Dependency Installed:
  php-pear-Archive-Zip.noarch 0:0.1.2-1                                                                                      

Updated:
  centreon.noarch 0:2.3.9-4              centreon-database.noarch 0:2.3.9-4       centreon-plugin-meta.noarch 0:2.3.9-4      
  centreon-plugins.noarch 0:2.3.9-4      dhclient.x86_64 12:3.0.5-31.el5_8.1      initscripts.x86_64 0:8.45.42-1.el5_8.1     
  sudo.x86_64 0:1.7.2p1-14.el5_8.3      

Complete!

Then, restart the services you stopped just before :

root@localhost:~# service centstorage start

root@localhost:~# service centcore start

root@localhost:~# service ndo2db start
A few steps left before the upgrade is over. Open up Firefox or your favorite browser and type in the URL adress bar : http://localhost/centreon

While installing Centreon on RHEL 5.8 server, this message was displayed :

file /etc/fonts/conf.avail/10-autohint.conf from install of fontconfig-2.5.93-7.x86_64 conflicts w ith file from package fontconfig-2.4.1-7.el5.i386

On 64 bit-based system, yum may install 32 bit and 64 bit rpm packages for a given software. This is one of its features.  In that case, an upgrade was available for the fontconfig package in Centreon repositories. Their version was earlier than the one installed on the system. The 32 bit version of this rpm has been removed to solve the rpm dependency problem. Just issue the following command as root :

root@localhost:~# yum remove fontconfig-2.4.1-6.el5.i386

Then, type the following commands to install centreon :

root@localhost:~#yum clean all && yum update && yum install centreon

More information on this issue : Centreon official forum

After upgrading Centreon to the latest stable version (2.3.4 -> 2.3.8.3) using Centreon official rpm repositories and yum, some errors in CRITICAL state occured in the main monitoring webpage. All the data provided through the SNMP protocol were unavailable. After an in-depth checking at Centreon configuration, the problem came from the scripts check_centreon_snmp_* which can not be executed properly.

There are located in /usr/lib/nagios/plugins. To debug the problem, I made some tests with check_centreon_snmp_remote_storage. Here are the errors I got :

./check_centreon_snmp_remote_storage

Can’t locate List/MoreUtils.pm in @INC (@INC contains: /usr/lib/nagios/plugins /usr/lib64/nagios/plugins /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/vendor_perl/5.8.8/Config/IniFiles.pm line 14.
BEGIN failed–compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Config/IniFiles.pm line 14.
Compilation failed in require at /usr/lib/nagios/plugins/centreon.pm line 51.
BEGIN failed–compilation aborted at /usr/lib/nagios/plugins/centreon.pm line 51.
Compilation failed in require at ./check_centreon_snmp_remote_storage line 50.
BEGIN failed–compilation aborted at ./check_centreon_snmp_remote_storage line 50.

During the Centreon upgrade, the installation of the List::MoreUtils Perl module was missing. To install it on RHEL 5.8 x86_64, just issue the following command :

root@localhost:~# yum install perl-List-MoreUtils.x86_64

Once installed, to test this Perl module :

fool@localhost:~$ perl -MList::MoreUtils -e1

All the alerts in critical state in Centreon should progressively disappear.

 

Here are some options that may help you managing your rpm-based distro :

–>To which rpm package does this file belong to ?

rpm -qf /path/to/the/file

–> Full description of a rpm package

rpm -qi package_name
–>Display the changelog of a rpm package

rpm -q package_name –changelog
–>Display the content of a rpm package

rpm -pql package_name

Follow

Get every new post delivered to your Inbox.