Tag Archive: linux


If you have to join a Linux server to a Windows domain managed by Active Directory and add this server into a defined OU, here is what you have to type : (Supposing your Samba version is later than 3.0.23)

root@your_server:#  net ads join -U admin_account@YOUR_COMPANY.ORG createcomputer=”/Computers/Servers/Your_office”

following this  : “OU=Your_office,OU=Servers,OU=Computers,DC=YOUR_COMPANY,DC=ORG”

where admin_account is the login name of a Windows administrator part of the “YOUR_COMPANY.ORG” domain with enough privileges. Pay attention to createcomputer option and its syntax.

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

If monitoring Oracle databases is part of your job, then some supervision programs need Oracle sqlplus command-line to access remote databases and perform some health status checks.

In order to have it on your systems, just download Oracle instant client. It is available on many platforms (Windows 32 and x64, Linux x86 and x86-64, AIX) and free of charge.You can download it as a rpm file or zip one according to your needs.  To proceed the download, an Oracle account is required. The subscription is free and very easy to do.

Oracle instant client download page

More information about Oracle instant client :

Official oracle instant client portal

If you want to perform  redirection of a command run by sudo, you will get the following error :

The file access permissions do not allow the specified action 0403-005 Cannot create the specified file

What does it mean?

Redirection is some kind of built-in features of your current running shell. (bash or ksh). When you issue a command with sudo, the built-in fonctions can not work within the child process.  To overcome this issue, the only workaround is to launch your command within a subshell :

sudo sh -c ‘your command > file.out’

If you want to use FTP commands through a secured login session, here is a solution : sftp. SFTP can be activated on a remote server running openssh-server so that you will be able to run any  FTP commands.

All you have to do is to add the following line into the openssh server configuration file /etc/ssh/sshd_config :

root@localhost:~# echo “Subsystem       sftp    /usr/libexec/openssh/sftp-server” >> /etc/ssh/sshd_config

Reload you configuration file :

root@localhost:~# /etc/init.d/sshd reload

To open a ftp session :

sftp username@server_name

You will be in your default home directory. For instance, if you want to download a file on your own computer, use the get command.

To leave your session, just type quit.

All the modules available for the running kernel are located in the following directory : /lib/modules/$(uname -r)/

In this directory, there are several important files such as modules.pcimap and modules.usbmap. These files are created by depmod. They list all the modules available for the current kernel with the corresponding vendor id/model id of every hardware component which can be plugged to a PCI or USB bus.

Let’s have an example. I want to know which module to load for my fibre channel card (HBA) :

fool@localhost:~$ lspci |grep -i fibre

08:01.0 Fibre Channel: QLogic Corp. ISP2422-based 4Gb Fibre Channel to PCI-X HBA (rev 02)
08:01.1 Fibre Channel: QLogic Corp. ISP2422-based 4Gb Fibre Channel to PCI-X HBA (rev 02)

To get their respective vendor id/model id for each of them :

fool@localhost:~$ lspci -n |grep 08:01.0

08:01.0 0c04: 1077:2422 (rev 02)

Using the model id value, I can find the requested module’s name :

fool@localhost:~$ grep 2422 modules.pcimap
qla2xxx              0×00001077 0×00002422 0xffffffff 0xffffffff 0×00000000 0×00000000 0×0

The approach can be reused for usb devices using the modules.usbmap file.

If you get an error message as below :

sudo: /etc/sudoers is owned by gid 5876, should be 0

(The GID number is here just an example)
The group owner of the file /etc/sudoers is not the good one. As root, do the following change :

root@localhost:~#chown root:root /etc/sudoers

Check whether this file has the good rights otherwise :

root@localhost:~# chmod 0440 /etc/sudoers

Here is a message which was appearing in my syslog file until I solved the problem :

[drm] Initialized drm 1.1.0 20060810
mtrr: type mismatch for e0000000,10000000 old: write-back new: write-combining

MTRR stands for Memory Type range registers. Its a new feature available in the latest Intel processors.It is a new way of partitioning and managing memory resources in your system.There are two solutions for using the right values for mtrr.
The first one is to add this option to your grub command line :  enable_mtrr_cleanup mtrr_spare_reg_nr=1
The second one is to recompile your current kernel and choose the value 1 instead of 0 for MTRR cleanup enable value (0-1) while issuing the command make menuconfig.

I chose the first solution and I do not get any error messages no more :

dmesg |grep mtrr
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
[    0.000000] MTRR variable ranges enabled:
[    0.000000] original variable MTRRs
[    0.000000] Found optimal setting for mtrr clean up
[    0.000000] New variable MTRRs
[    0.000000] Kernel command line: root=/dev/sda2 ro quiet enable_mtrr_cleanup mtrr_spare_reg_nr=1

cat /proc/mtrr
reg00: base=0×000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0×080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0bdd00000 ( 3037MB), size=    1MB, count=1: uncachable
reg03: base=0x0bde00000 ( 3038MB), size=    2MB, count=1: uncachable
reg04: base=0x0be000000 ( 3040MB), size=   32MB, count=1: uncachable
reg05: base=0x0e0000000 ( 3584MB), size=  256MB, count=2: write-combining

For more information :
http://en.gentoo-wiki.com/wiki/MTRR
https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/314928
https://help.ubuntu.com/community/AspireOneDiscussion
http://www.phoronix.com/forums/showpost.php?p=74238&postcount=5
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/Reference_Guide/s2-proc-mtrr.html

Knoppix is a Debian-based live cd which provides automatic hardware detection and a complete desktop solution.
LXDE is used as the default X11 environment.
It’s worth trying it as a rescue cd.
The lastest stable version is : 6.2.1

To download the English-spoken version :

EN Live Knoppix CD

Do not forget to verify the checksum of what you have just downloaded :

Knoppix v6.2.1 md5sum file

Let’s have a look at these following files as well :

The official README

The boot command line options

the list of all the packages included

To know if your CPU is 64 bit one, type the following command :

fool@localhost:~$ grep -w lm  /proc/cpuinfo

If you have an output like that containing the word lm, then you have 64 bit processor.

lm stands for Long mode which is only enabled for 64 bit CPU.

flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm tpr_shadow vnmi flexpriority
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm tpr_shadow vnmi flexpriority

The command uname -i can provide the kind of hardware-platform on which your OS is running. However, you may have unkown as an output of uname -i.

Follow

Get every new post delivered to your Inbox.