Installation de centreon

Bonjour, je suis une debutante j'ai installé nagios sur mon poste (fedora) et mnt j'essaie d'installer centreon mais je reçoi a la fin un message :
can't connect to local Mysql server through socket '/var/lib/mysql/mysql.sock' (111)
MySQL InnoDB Engine status
can't connect to local MySQL server through socket '/var/lib/musql/mysql.sock' (111)

(sachant que j'ai suivi l'installation et la configuration du site officiel de fedora)

j'ai vraiment besoin d'aide merci d'avance ^_^

14 réponses

  1. Bonjour à tous.

    Je suis le responsable de tech-max.fr je vous informe de la disponibilité du script cité plus haut mais pour les distribution basées sur RedHat (Fedora 14, CentOS 5.6 et 6.0)

    Vous pourrez le trouver a cette adresse:

    http://www.tech-max.fr/simple-install-nagios/

    Merci à tous et bon courage.
    1. Modérateur
      Salut :-) Merci de ton passage et de ta contribution !!
  2. Modérateur
    Je viens de voir le problème, en admettant que ce ne soit pas une erreur de recopie :

    can't connect to local Mysql server through socket '/var/lib/mysql/mysql.sock' (111)
    MySQL InnoDB Engine status
    can't connect to local MySQL server through socket '/var/lib/musql/mysql.sock' (111) 
    


    Ce fichier est dans /var/run/mysql/, tu as donc mal renseigné son emplacement lors de l'installation de centreon (note : ne déplace pas mysql.sock).

    Bonne chance
    1. [root@localhost ~]# mysql -u root -p
      Enter password:
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 4
      Server version: 5.0.45 Source distribution

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql>

      [root@localhost ~]# mysql -u root -p -h 127.0.0.1
      Enter password:
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 5
      Server version: 5.0.45 Source distribution

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql>
      1. Modérateur
        À l'installation on doit te demander si tu veux utiliser les sockets unix ou ip, essaye l'autre.

        On est bien d'accord que mysql et centreon sont installés sur la même machine ?

        Est-ce que tu arrives à te connecter à mysql en ligne de commande :

        mysql -u root -p
        mysql -u root -p -h 127.0.0.1


        Bonne chance
        1. [root@localhost ~]# ls -l /var/lib/mysql
          total 20560
          -rwxrwxrwx 1 mysql mysql 10485760 avr 13 19:14 ibdata1
          -rwxrwxrwx 1 mysql mysql 5242880 avr 14 10:18 ib_logfile0
          -rwxrwxrwx 1 mysql mysql 5242880 avr 8 14:08 ib_logfile1
          drwxrwxrwx 2 mysql mysql 4096 avr 8 14:08 mysql
          -rwxrwxrwx 1 mysql mysql 310 avr 8 12:16 mysql.sock
          -rwxrwxrwx 1 mysql mysql 0 avr 8 12:15 mysql.sock~
          drwxrwxrwx 2 mysql mysql 4096 avr 8 14:08 test

          [root@localhost ~]# netstat -ntlp
          Connexions Internet actives (seulement serveurs)
          Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
          tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2346/mysqld
          tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2052/rpcbind
          tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2547/cupsd
          tcp 0 0 0.0.0.0:34679 0.0.0.0:* LISTEN 2071/rpc.statd
          tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2394/sendmail: acce
          tcp 0 0 :::80 :::* LISTEN 2424/httpd
          tcp 0 0 :::22 :::* LISTEN 2257/sshd

          [root@localhost ~]# iptables --list
          Chain INPUT (policy ACCEPT)
          target prot opt source destination
          RH-Firewall-1-INPUT all -- anywhere anywhere

          Chain FORWARD (policy ACCEPT)
          target prot opt source destination
          REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

          Chain OUTPUT (policy ACCEPT)
          target prot opt source destination

          Chain RH-Firewall-1-INPUT (1 references)
          target prot opt source destination
          ACCEPT all -- anywhere anywhere
          ACCEPT icmp -- anywhere anywhere icmp any
          ACCEPT esp -- anywhere anywhere
          ACCEPT ah -- anywhere anywhere
          ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns
          ACCEPT udp -- anywhere anywhere udp dpt:ipp
          ACCEPT tcp -- anywhere anywhere tcp dpt:ipp
          ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
          ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
          REJECT all -- a

          [root@localhost ~]# ps aux | grep mysqld
          root 2286 0.0 0.3 4704 496 ? S 10:18 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/tmp/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
          mysql 2346 0.0 0.8 136452 1404 ? Sl 10:18 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/tmp/mysql.sock
          root 3385 0.0 0.4 4076 764 pts/2 S+ 10:40 0:00 grep mysqld
          1. Modérateur
            Que donnent les commandes :

            ls -l /var/lib/mysql  
            netstat -ntlp  
            iptables --list
            ps aux | grep mysqld


            Bonne chance
            1. j'ai bien suivi les étapes mais je reçois la meme erreur

              can't connect to local Mysql server through socket '/var/lib/mysql/mysql.sock' (111)
              MySQL InnoDB Engine status
              can't connect to local MySQL server through socket '/var/lib/musql/mysql.sock' (111)

              -- Tout ce qui arrive, arrive toujours pour une raison ^_^
              1. j'avais du mal a trouver leur équivalent mais je pense que ces sites vont m'aider ^_^
                1. Modérateur
                  Ci-dessous un script d'instllation et nagios centreon qui m'a été amicalement donné par le responsable de tech-max.fr :

                  #!/bin/bash 
                  #chmod +x nagcent 
                  set -e 
                  
                  nagios_version="3.2.3" 
                  nagios_plugins_version="1.4.15" 
                  ndoutils_version="1.4b9" 
                  centreon_version="2.1.10" 
                  
                  # 
                  # Installation des dépendances 
                  # 
                  
                  aptitude install mailutils build-essential sudo apache2 apache2-mpm-prefork php5 php5-mysql php-pear php5-ldap php5-snmp php5-gd mysql-server libmysqlclient15-dev rrdtool librrds-perl libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl snmp snmpd libnet-snmp-perl libsnmp-perl libgd2-xpm libgd2-xpm-dev libpng12-dev gettext 
                  
                  # 
                  # Création de l'utilisateur et du groupe nagios  
                  # 
                  
                  if [ $(grep -c "^nagios:" /etc/passwd) -eq 0 ] 
                  then 
                   /usr/sbin/useradd -m nagios 
                   passwd nagios 
                  fi 
                  
                  # 
                  # Création du groupe nagcmd 
                  # 
                  
                  if [ $(grep -c "^nagios:" /etc/passwd) -eq 0 ] 
                  then 
                   groupadd nagcmd 
                  fi 
                  
                  # 
                  # On ajoute nagios et www-data aux groupes nagios et nagcmd 
                  # 
                  
                  /usr/sbin/usermod -G nagios,nagcmd nagios 
                  /usr/sbin/usermod -G nagios,nagcmd www-data 
                  
                  # 
                  #Install Nagios 
                  # 
                  
                  cd /usr/local/src/ 
                  
                  archive_nagios="nagios-$nagios_version.tar.gz" 
                  if [ ! -f $archive_nagios ] 
                  then 
                   wget [http://download.tech-max.fr/nagios/]$archive_nagios 
                  fi 
                  
                  tar xvzf $archive_nagios 
                  cd nagios-$nagios_version/ 
                  ./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --enable-nanosleep --enable-event-broker 
                  make all install install-init install-commandmode install-config 
                  
                  # 
                  #Install Nagios plugins 
                  # 
                  
                  cd /usr/local/src/ 
                  archive_nagios_plugins="nagios-plugins-$nagios_plugins_version.tar.gz" 
                  if [ ! -f $archive_nagios_plugins ] 
                  then 
                   wget [http://download.tech-max.fr/nagios/]$archive_nagios_plugins 
                  fi 
                    
                  tar xvzf $archive_nagios_plugins  
                  cd nagios-plugins-$nagios_plugins_version/ 
                  ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl=/usr/bin/openssl 
                  make 
                  make install 
                  
                  # 
                  #Install NDO 
                  # 
                  
                  cd /usr/local/src/ 
                  archive_ndoutils="ndoutils-$ndoutils_version.tar.gz" 
                  if [ ! -f $archive_ndoutils ] 
                  then 
                   wget [http://download.tech-max.fr/nagios/]$archive_ndoutils 
                  fi 
                  tar xvzf $archive_ndoutils  
                  
                  # 
                  # Installation du patch 
                  # 
                  
                  cd ndoutils-$ndoutils_version 
                  wget [http://download.tech-max.fr/nagios/ndoutils]${ndoutils_version}_light.patch 
                  patch -p1 -N < ndoutils${ndoutils_version}_light.patch 
                  ./configure --prefix=/usr/local/nagios/ --enable-mysql --disable-pgsql \ 
                     --with-ndo2db-user=nagios --with-ndo2db-group=nagios 
                  make 
                  cp ./src/ndomod-3x.o /usr/local/nagios/bin/ndomod.o 
                  cp ./src/ndo2db-3x /usr/local/nagios/bin/ndo2db 
                  cp ./config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg 
                  cp ./config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg 
                  chmod 770 /usr/local/nagios/bin/ndo* 
                  chown nagios:nagios /usr/local/nagios/bin/ndo* 
                  cp ./daemon-init /etc/init.d/ndo2db 
                  chmod +x /etc/init.d/ndo2db 
                  
                  # 
                  # Install Centreon 
                  # 
                  
                  cd /usr/local/src/ 
                  wget [http://download.tech-max.fr/nagios/centreon-]$centreon_version.tar.gz 
                  tar xvzf centreon-$centreon_version.tar.gz 
                  cd centreon-$centreon_version/ 
                  export PATH="$PATH:/usr/local/nagios/bin/" 
                  ./install.sh -i 
                  /etc/init.d/apache2 reload 
                  
                  # 
                  # Langue Centreon 
                  # 
                  
                  # En toute rigueur il faudrait faire locale=$LANG mais on n'est pas sûr de trouver toutes 
                  # les langues sur [http://download.tech-max.fr/] 
                  
                  lang="fr_FR" 
                  locale="$lang.UTF-8" 
                  centreon_lang_version="2.1-$lang-1" 
                  
                  mkdir -p /usr/local/centreon/www/locale/$locale/LC_MESSAGES/ 
                  cd /usr/local/src/ 
                  archive_nagios_lang="centreon-$centreon_lang_version.tgz" 
                  if [ ! -f $archive_nagios_lang ] 
                  then 
                   wget [http://download.tech-max.fr/nagios/]$archive_nagios_lang 
                  fi 
                  tar xvzf $archive_nagios_lang  
                  #cd centreon-$centreon_lang_version/LC_MESSAGES 
                  cd centreon-$centreon_lang_version.1/LC_MESSAGES 
                  cp messages.mo /usr/local/centreon/www/locale/$locale/LC_MESSAGES/messages.mo 
                  read -p "Se connecter à [http://Ip/centreon,] suivre les étapes de configuration de l'interface Centreon et à la fin appuyer sur une touche pour finaliser..." 
                  
                  # 
                  # Ajout des services ndo2db et nagios 
                  # 
                  
                  update-rc.d ndo2db defaults 
                  update-rc.d nagios defaults 
                  /etc/init.d/ndo2db start 
                  /etc/init.d/nagios start 
                  
                  # 
                  # On vérifie que tout est OK 
                  # 
                  
                  if [ $(grep -c "ndomod" /usr/local/nagios/var/nagios.log) -ne 0 ] 
                  then 
                   grep ndomod /usr/local/nagios/var/nagios.log 
                  fi 
                  

                  Attention certaines lignes sont trop larges pour tenir sur le forum donc fais un copier coller.

                  Tu mets tout ça dans un fichier par exemple /home/toto/install_nagios_centreon.sh puis tu lances ces commandes :

                  chmod a+x /home/toto/install_nagios_centreon.sh 
                  sudo /home/toto/install_nagios_centreon.sh


                  Si à ce stade sudo n'est pas installé sur ta machine configure-le comme indiqué ici :
                  http://www.mistra.fr/tutoriel-linux-profils-et-droits.html#h3-1-4-les-sudoers

                  J'espère que ça t'aidera !

                  Bonne chance
                  1. Modérateur
                    Et il est lancé ?

                    netstat -ntlp | grep 3306


                    Bonne chance
                    1. Modérateur
                      As-tu installé un serveur mysql ?
                      Est-ce que le serveur mysql est lancé ?

                      Bonne chance