разные инструменты для разных задач
1 2 3 |
триггерный реал тайм мониторинг, тут мы смотрим что происходит прямо сейчас - nagios много графиков чтобы посмотреть данные за вчера, неделю назад год назад - zabbix агрегатор логов - какой нибудь комбайн типа fluentd или graylog |
установка nagios3
1 2 3 4 |
apt-get update apt-get upgrade apt-get install nagios3 php5-fpm htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin - смена пароля |
настройка apache2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
0. nano /etc/apache2/sites-available/nagios.conf --------------------------------------------------- <VirtualHost *:80> ServerName nagios.b14esh.com ServerAlias www.nagios.b14esh.com DocumentRoot /var/www/html <Directory "/var/www/html"> Options FollowSymLinks AllowOverride All </Directory> </VirtualHost> ---------------------------------------------------- 1. a2dissite *default* 2. a2ensite nagios 3. /etc/init.d/apache2 reload 4. /etc/init.d/apache2 restart 5. a2enmod rewrite |
конфиг switches.cfg
1 2 3 4 5 6 7 8 9 10 |
0. cd /etc/nagios3/conf.d/ 1. nano switches.cfg ----------------------------------------------------- define host { use generic-host host_name switch alias Backbone Switch address 192.168.0.21 } ------------------------------------------------------ |
конфиг routers.cfg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
0. nano routers.cfg ------------------------------------------------------ define host { use generic-host host_name microtik1 alias Group 1 Gateway Router address 192.168.0.1 } define host { use generic-host host_name mikrotik0 alias Group 2 Gateway Router address 192.168.0.2 } ------------------------------------------------------ |
конфиг все устройства
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
nano pcs.cfg ------------------------------------------------------ define host { use generic-host host_name nagios alias Nagios server address 192.168.0.100 } # # Linux KVM # define host { use generic-host host_name hp-proliant8 alias hp-proliant8 address 192.168.0.101 } define host { use generic-host host_name zserver alias zserver address 192.168.0.102 } # # Windows Hosts # vdomz.local # define host { use generic-host host_name dc alias dc address 192.168.0.103 } define host { use generic-host host_name wds alias wds address 192.168.0.104 } define host { use generic-host host_name mywin alias mywin address 192.168.0.105 } # # PrinterKm1028 # define host { use generic-host host_name printer alias printer address 192.168.0.105 } # # Mobile Device # define host { use generic-host host_name XiaomiRedmi3s alias XioomiRedmi3s address 192.168.0.13 } define host { use generic-host host_name raspberry alias raspberry address 192.168.0.11 } define host { use generic-host host_name pda-a7 alias pda-a7 address 192.168.0.12 } # # Linux servers # define host { use generic-host host_name lynux alias lynux address 192.168.0.254 } ------------------------------------------------------ |
перезапуск nagios после редактирования конфигов
1 2 |
0. nagios3 -v /etc/nagios3/nagios.cfg проверка конфигов 1. service nagios3 restart |