Projet

Général

Profil

Anomalie #1053

installation d'un serveur nagios externe

Ajouté par Loïc Dachary il y a plus de 11 ans. Mis à jour il y a presque 5 ans.

Statut:
Fermé
Priorité:
Normale
Assigné à:
Catégorie:
Task
Version cible:
Début:
27/11/2012
Echéance:
28/11/2012
% réalisé:

100%

Temps estimé:
Temps passé:
Difficulté:
2 Facile

Description

pour surveiller ns1.april.org yopo.april.org et pavot.april.org afin d'avoir des alertes si l'une d'elle tombe

Révisions associées

Révision 5efbe807 (diff)
Ajouté par Loïc Dachary il y a plus de 11 ans

ajout du support nagios, configuration screenrc et correction des noms de domaine. refs #1053

Historique

#1

Mis à jour par Loïc Dachary il y a plus de 11 ans

ssh -t -A ssh -A controller.vm

root@controller:~# nova boot --image 'Debian GNU/Linux Wheezy Beta2' --flavor e.1-cpu.10GB-disk.1GB-ram --key_name loic --availability_zone=bm0003 --poll nagios-hetzner
+------------------------+--------------------------------------+
|        Property        |                Value                 |
+------------------------+--------------------------------------+
|   OS-DCF:diskConfig    |                MANUAL                |
| OS-EXT-STS:power_state |                  0                   |
| OS-EXT-STS:task_state  |              scheduling              |
|  OS-EXT-STS:vm_state   |               building               |
|       accessIPv4       |                                      |
|       accessIPv6       |                                      |
|       adminPass        |             DJnq3x5GLWJS             |
|      config_drive      |                                      |
|        created         |         2012-11-28T09:51:53Z         |
|         flavor         |      e.1-cpu.10GB-disk.1GB-ram       |
|         hostId         |                                      |
|           id           | 68e59fc1-f442-4bcf-8c24-2d94c52ac999 |
|         image          |    Debian GNU/Linux Wheezy Beta2     |
|        key_name        |                 loic                 |
|        metadata        |                  {}                  |
|          name          |            nagios-hetzner            |
|        progress        |                  0                   |
|         status         |                BUILD                 |
|       tenant_id        |   7c918c873280465da3785f5699d48316   |
|        updated         |         2012-11-28T09:51:53Z         |
|        user_id         |   ad2d198a5d474880a6da963aec8debe3   |
+------------------------+--------------------------------------+

Instance building... 100% complete
Finished

#2

Mis à jour par Loïc Dachary il y a plus de 11 ans

dns:/etc/bind# git show
commit fe92431dc2689400bb1c2308925b6f29f4cc702c
Author: Loic Dachary <loic@dachary.org>
Date:   Wed Nov 28 11:20:27 2012 +0100

    Definition de nagios-hetzner.vm

diff --git a/bind/zones/masters/vm.april-int b/bind/zones/masters/vm.april-int
index d73422e..3dcc04c 100644
--- a/bind/zones/masters/vm.april-int
+++ b/bind/zones/masters/vm.april-int
@@ -13,4 +13,5 @@ $TTL 1D
 controller             IN      A       192.168.4.1
 puppet                 IN      A       192.168.4.2
 jenkins                        IN      A       192.168.4.3
-april-ci        IN  A   192.168.5.1
+nagios-hetzner         IN      A       192.168.4.4
+april-ci               IN      A       192.168.5.1
#3

Mis à jour par Loïc Dachary il y a plus de 11 ans

root@nagios-hetzner:~# hostname nagios-hetzner.vm.april-int
root@nagios-hetzner:~# echo nagios-hetzner.vm.april-int > /etc/hostname
root@nagios-hetzner:~# cat /etc/network/interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
    up ip addr add 192.168.4.4/24 dev eth0
        up ip route add 192.168.0.0/16 via 192.168.4.1 src 192.168.4.4
#4

Mis à jour par Loïc Dachary il y a plus de 11 ans

ssh

vi /etc/dhcp/dhclient.conf
supersede domain-search "vm.april-int";
prepend domain-name-servers 192.168.2.12;

apt-get install -y puppet augeas-tools
augtool << EOT
set /files/etc/puppet/puppet.conf/agent/pluginsync true
save
EOT
puppet agent -vt --waitforcert 60
#5

Mis à jour par Loïc Dachary il y a plus de 11 ans

root@puppet:/etc# grep nagios-hetzner puppet/manifests/site.pp
node 'puppet.vm.april-int','jenkins.vm.april-int','nagios-hetzner.vm.april-int' inherits default {
root@puppet:/etc# ssh root@puppet.vm.april-int puppetca sign nagios-hetzner.vm.april-int
#6

Mis à jour par Loïc Dachary il y a plus de 11 ans

documentation dans http://127.0.0.1:8080/dokuwiki/doku.php?id=sysadm:machines_virtuelles:there:nagios-hetzner
#7

Mis à jour par Loïc Dachary il y a plus de 11 ans

root@nagios-hetzner:/etc# git show
commit dfd0c38aa9b6b6c0276380c7f59bc8cea737d775
Author: Loic Dachary <loic@dachary.org>
Date:   Wed Nov 28 15:08:05 2012 +0000

    autorise l'envoi de mails vers l'extérieur

diff --git a/exim4/update-exim4.conf.conf b/exim4/update-exim4.conf.conf
index 1ed69da..1a0a251 100644
--- a/exim4/update-exim4.conf.conf
+++ b/exim4/update-exim4.conf.conf
@@ -16,7 +16,7 @@
 #
 # This is a Debian specific file

-dc_eximconfig_configtype='local'
+dc_eximconfig_configtype='internet'
 dc_other_hostnames='nagios-hetzner.vm.april-int'
 dc_local_interfaces='127.0.0.1 ; ::1'
 dc_readhost=''
#8

Mis à jour par Loïc Dachary il y a plus de 11 ans

puppet.vm.april-int:/etc/puppet/files/nagios/contacts_nagios2.cfg

define contact{
        contact_name                    admins
        alias                           Admins April
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        email                           admins-auto@april.org
       }

#9

Mis à jour par Loïc Dachary il y a plus de 11 ans

nagios-hetzner.vm.april-int:/etc/nagios3/conf.d/zabbix.cfg

define host {
        host_name zabbix.ns1.april.org
        address 192.168.1.50
        hostgroups debian-servers
        use generic-host
}

#10

Mis à jour par Loïc Dachary il y a plus de 11 ans

  • Statut changé de En cours de traitement à Résolu
  • % réalisé changé de 0 à 100
#11

Mis à jour par Loïc Dachary il y a plus de 11 ans

test d'envoi d'alerte

***** Nagios *****

Notification Type: PROBLEM
Host: zabbix.ns1.april.org
State: DOWN
Address: 192.168.1.50
Info: PING CRITICAL - Packet loss = 100%

Date/Time: Wed Nov 28 16:48:05 CET 2012

#12

Mis à jour par Quentin Gibeaux il y a presque 5 ans

  • Statut changé de Résolu à Fermé

Formats disponibles : Atom PDF