Category: RedHat


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

If you want the home directory of a user to be created at the first login, you probably use the PAM’s module pam_oddjob_mkhomedir to do that job. This operation is done for users not locally registered on the server.

You may have encounter this error after trying to log in for the first time. The authentication has worked well but the user does not have its own home directory.

org.freedesktop.DBus.Error.ServiceUnknown: The name com.redhat.oddjob_mkhomedir was not provided by any .service files
Could not chdir to home directory /home/CONCUR/$USER: No such file or directory

This is because a service called oddjobd,  is not started on your server.

root@localhost:~#service oddjobd start

Make sure that this service will be available at boot time.

root@localhost:~#chkconfig –level 2345 oddjobd on

After installing RHEL6.3 on a server, the next step is to register your server as a new asset in your local inventory (in Satellite for instance) or at https://access.redhat.com

Registering and giving the right subscriptions to your server can be done with subscription-manager command line utility. If you want to do the both steps in one time, just type :

root@localhost:~#subscription-manager register –autosubscribe

If you want to know the registration and subscription state of your server :

root@localhost:~# subscription-manager list

You may have the following output :

+——————————————-+
Installed Product Status
+——————————————-+
Product Name:             Red Hat Enterprise Linux Server
Product ID:               69
Version:                  6.3
Arch:                     x86_64
Status:                   Not Subscribed           
Starts:
Expires:  

In the web console, you may have the following message looking at your server’s page :

Status  : “System is not properly subscribed”

For the moment, the only workaround found to change this state and make your server properly subscribed is to look at the pool id of one of your subscriptions for an already declared server. (Both servers must be similar in terms of subscriptions).

root@localhost:~#subscription-manager list –available |grep -A3 -w ‘Red Hat Enterprise Linux Server’
Product Name:             Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up
                        to 1 guest) with Smart Management
Product Id:               RH0184831                
Pool Id:                  8a85f984356102f801356202921d190b

Product Name:             Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up
                        to 1 guest) with Smart Management
Product Id:               RH0184831RN              
Pool Id:                  8a85f984356102f80135620294061945

Product Name:             Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up
                        to 1 guest) with Smart Management
Product Id:               RH0184831RN              
Pool Id:                  8a85f984356102f801356202a51b1952

And now, for the server in error, just manually add a subscription to it :

root@localhost:~#subscription-manager subscribe –pool=your_chosen_pool_id

To check after this fresh modification :

root@localhost:~#subscription-manager list
+——————————————-+
Installed Product Status
+——————————————-+
Product Name:             Red Hat Enterprise Linux Server
Product ID:               69
Version:                  6.3
Arch:                     x86_64                   
Status:                   Subscribed               
Starts:                   12/15/11
Expires:                  07/27/13 

 

 

 

Network configuration under RHEL 6 has slightly changed. No configuration found if you perform an minimum installation.Networking is managed with NetworkManager by default. On a server, using GUI tools is best to avoid when possible.

To make your networking work out of the box, some changes are needed in a few files.
To make the network interface to configure available with the right information, add any changes in /etc/sysconfig/networking-scripts/ifcfg-eth0. This file should contain at least the following lines :

DEVICE=eth0
HWADDR=MAC_ADDRESS
IPADDR=IP address server
NETMASK= its netmask
BROADCAST= its broadcast
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no

NM_CONTROLLED set to no just tells the system not to use NetworkManager as default networking management tool.

Next step, add the following information in /etc/sysconfig/network :

NETWORKING=yes
GATEWAY= default gateway for the server
HOSTNAME=FQDN of the server

Do not forget to populate /etc/hosts file with localhost, your server’s IP address, its FQDN and aliases

Add the IP addresses of your DNS servers in /etc/resolv.conf :

cat /etc/resolv.conf

search your_domain
nameserver DNS_server1_IP_Address
nameserver DNS_server2_IP_Address

After any changes on the networking configuration, restart the related service :

root@localhost:~#service restart network

To check that the requested network interfaces are up and well configured, check their status :

root@localhost: ~#service status network

If you need to add more parameters to the configuration files above, have a look at this document available on your server :

cat /usr/share/doc/initscripts-9.03.31/sysconfig.txt

If you are working with a RHEL 5.5 or above on a Dell server (PowerEdge R 710) with a SAS Controller integrated RAID, you may have some error messages in the kernel log file. Running dmesg command, here is what you have :

fool@localhost:~$ dmesg

megasas_register_aen[0]: already registered
megasas_register_aen[0]: already registered
megasas_register_aen[0]: already registered

fool@localhost:~$ uname -r

2.6.18-308.11.1.el5

These messages appeared after a recent kernel update. Within this update, the megaraid_sas module has been upgraded and a new function was added to the source code providing complementary information about the module once loaded and interacting with the kernel.

A case issue was filled in RHEL Knowledge Database :

RHEL KB id 43634

These messages are just informational messages. No errors to be expected.

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

Sometimes, after restarting all the Centreon-related services (Mysqld, Centcore, Centstorage, ndo2db, Nagios, Apache), you may have a long listing of error messages in the UNKNOWN status such as :

ERROR: Received noSuchName(2) error-status at error-index 1.

ERROR: Received noSuchName(2) error-status at error-index 4.

It concerns all the information monitored through SNMP. One solution to wipe them out of your Centreon dashboard is to stop all the Centreon-related services. Then, delete all the files contained in /var/lib./centreon/centplugins/:

root@localhost:~# rm -rf /var/lib/centreon/centplugins/*

Then restart Centreon and everything should be nice again.

Follow

Get every new post delivered to your Inbox.