Project

General

Profile

Anomalie #1053

installation d'un serveur nagios externe

Added by Loïc Dachary over 9 years ago. Updated about 3 years ago.

Status:
Fermé
Priority:
Normale
Assignee:
Category:
Task
Target version:
Start date:
11/27/2012
Due date:
11/28/2012
% Done:

100%

Estimated time:
Spent time:
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

Associated revisions

Revision 5efbe807 (diff)
Added by Loïc Dachary over 9 years ago

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

History

#1

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

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

Updated by Loïc Dachary over 9 years ago

  • Status changed from En cours de traitement to Résolu
  • % Done changed from 0 to 100
#11

Updated by Loïc Dachary over 9 years ago

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

Updated by Quentin Gibeaux about 3 years ago

  • Status changed from Résolu to Fermé

Also available in: Atom PDF