Category: Server


Exim4 does not transfer mails to the root user by default. If you’re trying to test Exim4 by sending an email to the root user, it will never be delivered to root user.That’s a default configuration from Debian. Instead, all emails for root user are transferred to /var/mail/mail.
Here is where it is configured :

root@localhost:~# cat /etc/exim4/conf.d/router/mmm_mail4root

### router/mmm_mail4root
#################################
# deliver mail addressed to root to /var/mail/mail as user mail:mail
# if it was not redirected in /etc/aliases or by other means
# Exim cannot deliver as root since 4.24 (FIXED_NEVER_USERS)

mail4root:
  debug_print = “R: mail4root for $local_part@$domain”
  driver = redirect
  domains = +local_domains
  data = /var/mail/mail
  file_transport = address_file
  local_parts = root
  user = mail
  group = mail
If you need to redirect emails to root, then add the right user in /etc/aliases at line where root word stands. Then run the command newaliases to take this change into account. Send a test email to root and log in to the user you’ve just configured and check its email box with the mail command. You should be able to read the email you’ve just sent a few seconds before.

If you are running several namebased SSL VirtualHosts with mod_GnuTLS, you need to provide the adequate intermediate certificate to check that your SSL certificates chains are valid. With mod_GnuTLS, it is quite tricky to set it up. You do not have any options. The only way to make it work is to do as follow :

For a Debian-based distro :

root@localhost:~# cd /etc/ssl/certs

root@localhost:~#cat your_SSL_intermediate_certificate_provider.pem your_ssl_website_certificate.crt > your_new_ssl_certificate.crt

In the Apache config file for your SSL website, add the following line :

GnuTLSCertificateFile /etc/ssl/certs/your_new_ssl_certificat_site.crt

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

More infos about GnuTLS

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 :

 

 

 

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.

If you try to reinitialize the root passwd of your Linux installation through a recovering boot with init=/bin/sh, you may have  the following error message :

passwd: Authentication token manipulation error

First check if your / filesystem is mounted read-write or read-only. Restart your machine and at the Grub prompt (tested on a fresh install of RHEL 6.2 with Grub version of 0.97), change ro to rw as indicated below :

kernel /vmlinuz-2.6.32-220.el6-x86_64 ro root=/dev/mapper….

kernel /vmlinuz-2.6.32-220.el6-x86_64 rw root=/dev/mapper….

 

An other solution is to make sure that the content of /etc/passwd and /etc/shadow are  the same with the pwconv command.

As root, before reinitializing again its passwd, run the command below :

root@localhost:~# pwconv

Then

root@localhost~# passwd

You should have no more error message.


 

It may be very critical to make the most out of the maximum memory capacity (up to 1TB) in the Proliant servers. To deal with, as a reminder, please find below some useful links you should add in your bookmarks :

http://partsurfer.hp.com

HP Servers memtool

http://h18004.www1.hp.com/products/servers/options/memory-description.html

http://h20000.www2.hp.com/bc/docs/support/SupportManual/c01702744/c01702744.pdf

ftp://ftp.hp.com/pub/c-products/servers/options/Memory_Why_Buy_4AA0-4216ENW.pdf

ftp://ftp.hp.com/pub/c-products/servers/options/c00256943.pdf

http://h20000.www2.hp.com/bc/docs/support/SupportManual/c01702744/c01702744.pdf

ftp://ftp.hp.com/pub/c-products/servers/options/Memory-Config-Recommendations-for-Intel-Xeon-5500-Series-Servers-Rev1.pdf

While looking at error messages on an Ubuntu box, here is one I noticed in /var/log/syslog :

init: ssh respawning too fast, stopped

To avoid this error appearing again, here is the workout :

Add the following line ListenServer 0.0.0.0 in your sshd configuration file. (/etc/ssh/sshd_config)

root@localhost:~#echo “ListenServer 0.0.0.0″ >> /etc/ssh/sshd_config

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.

Follow

Get every new post delivered to your Inbox.