<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-978998669498567129</id><updated>2024-10-05T04:18:25.633+02:00</updated><title type='text'>Блог компании ITRM</title><subtitle type='html'>Блог компании ITRM</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.itrm.ru/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-8636057476623754544</id><published>2018-11-27T21:55:00.001+02:00</published><updated>2018-11-27T21:58:42.996+02:00</updated><title type='text'>Установка кластера Kubernetes c помощью SaltStack</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Чтобы установить и настроить кластер Kubernetes c помощью SaltStack можно использовать готовую формулу - salt-formula-kubernetes.&lt;br /&gt;
&lt;br /&gt;
1) Скачиваем формулу salt-formula-kubernetes:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;cd /srv/formulas
git clone https://github.com/salt-formulas/salt-formula-kubernetes.git
&lt;/code&gt;&lt;/pre&gt;

2) Для кластера также потребуется установить etcd. Скачиваем формулу salt-formula-etcd:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;cd /srv/formulas
git clone https://github.com/salt-formulas/salt-formula-etcd.git
&lt;/code&gt;&lt;/pre&gt;

3) Добавляем скачанные формулы в конфиг salt-мастера - /etc/salt/master:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;file_roots:
  base:
    - /srv/salt/base
    - /srv/formulas/salt-formula-etcd
    - /srv/formulas/salt-formula-kubernetes
&lt;/code&gt;&lt;/pre&gt;

&lt;b&gt;Примечание: примеры настроек, скриптов и salt-стейтов, используемых в дальнейшем, можно взять из репозитория&lt;/b&gt; https://github.com/itrm/salt-for-kube:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;git clone https://github.com/itrm/salt-for-kube.git
&lt;/code&gt;&lt;/pre&gt;
Содержимое репозитория нужно скопировать в папку /srv.&lt;br /&gt;
&lt;br /&gt;
4) Kubernetes использует TLS для связи между компонентами. TLS-сертификаты создаём с помощью утилит cfssl.&lt;br /&gt;
Примеры настроек и скрипт для генерации сертификатов можно взять из папки https://github.com/itrm/salt-for-kube/tree/master/scripts/k8s-certs&lt;br /&gt;
&lt;br /&gt;
4.1 Скачиваем утилиты cfssl и cfssljson:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;wget --https-only --timestamping https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
chmod +x cfssl_linux-amd64 cfssljson_linux-amd64
mv cfssl_linux-amd64 /usr/local/bin/cfssl
mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
4.2 Создаём файл ca-csr.json по образцу https://github.com/itrm/salt-for-kube/blob/master/scripts/k8s-certs/ca-csr.json&lt;br /&gt;
&lt;br /&gt;
4.3 Создаём ca-сертификат:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;cfssl gencert -initca ca-csr.json | cfssljson -bare ca
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
4.4 Создаём ca-config.json по образцу https://github.com/itrm/salt-for-kube/blob/master/scripts/k8s-certs/ca-config.json&lt;br /&gt;
&lt;br /&gt;
4.5 Создаём файл kubernetes-csr.json по образцу https://github.com/itrm/salt-for-kube/blob/master/scripts/k8s-certs/kubernetes-csr.json&lt;br /&gt;
&lt;br /&gt;
4.6 Создаём остальные сертификаты:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare kubernetes
cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare kubelet-client
cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare kube-controller-manager-client
cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare kube-scheduler-client
cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare kube-proxy-client
cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare etcd-server
cfssl gencert   -ca=ca.pem   -ca-key=ca-key.pem   -config=ca-config.json   -profile=kubernetes   kubernetes-csr.json | cfssljson -bare etcd-client
&lt;/code&gt;&lt;/pre&gt;

4.7 Копируем сертификаты для kubernetes в папку /srv/salt/base/_certs/kubernetes:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;mkdir -p /srv/salt/base/_certs/kubernetes
cp kubernetes-key.pem /srv/salt/base/_certs/kubernetes/kubernetes-server.key
cp kubernetes.pem /srv/salt/base/_certs/kubernetes/kubernetes-server.crt
cp ca.pem /srv/salt/base/_certs/kubernetes/ca-kubernetes.crt
cp ca-key.pem /srv/salt/base/_certs/kubernetes/ca-kubernetes.key
cp kubelet-client-key.pem /srv/salt/base/_certs/kubernetes/kubelet-client.key
cp kubelet-client.pem /srv/salt/base/_certs/kubernetes/kubelet-client.crt
cp kube-controller-manager-client.pem /srv/salt/base/_certs/kubernetes/kube-controller-manager-client.crt
cp kube-controller-manager-client-key.pem /srv/salt/base/_certs/kubernetes/kube-controller-manager-client.key
cp kube-scheduler-client-key.pem /srv/salt/base/_certs/kubernetes/kube-scheduler-client.key
cp kube-scheduler-client.pem /srv/salt/base/_certs/kubernetes/kube-scheduler-client.crt
cp kube-proxy-client.pem /srv/salt/base/_certs/kubernetes/kube-proxy-client.crt
cp kube-proxy-client-key.pem /srv/salt/base/_certs/kubernetes/kube-proxy-client.key
&lt;/code&gt;&lt;/pre&gt;

4.8 Копируем сертификаты для etcd в папку /srv/salt/base/_certs/etcd:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;mkdir /srv/salt/base/_certs/etcd
cp ca.pem /srv/salt/base/_certs/etcd/ca.pem
cp etcd-server.pem /srv/salt/base/_certs/etcd/etcd-server.crt
cp etcd-server-key.pem /srv/salt/base/_certs/etcd/etcd-server.key
cp etcd-client.pem /srv/salt/base/_certs/etcd/etcd-client.crt
cp etcd-client-key.pem /srv/salt/base/_certs/etcd/etcd-client.key
&lt;/code&gt;&lt;/pre&gt;

Шаги 4.6 - 4.8 можно также выполнить с помощью скрипта https://github.com/itrm/salt-for-kube/blob/master/scripts/k8s-certs/generate_ssl.sh&lt;br /&gt;
&lt;br /&gt;
5) Копируем сертификаты kubernetes на все ноды.&lt;br /&gt;
Запускаем стейт:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;salt -C &#39;G@roles:kube-master&#39; state.sls kube-ssl
salt -C &#39;G@roles:kube-node&#39; state.sls kube-ssl
&lt;/code&gt;&lt;/pre&gt;

6) Копируем сертификаты etcd на мастер ноды.&lt;br /&gt;
Запускаем стейт:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;salt -C &#39;G@roles:kube-master&#39; state.sls etcd-ssl
&lt;/code&gt;&lt;/pre&gt;

7) Затем нужно создать pillar файлы соответствующие вашему kubernetes кластеру. Для мастер-нод и для рабочих нод создаём разные файлы.&lt;br /&gt;
&lt;br /&gt;
7.1 pillar-файл для мастер-нод /srv/pillar/kube-master.sls:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;https://github.com/itrm/salt-for-kube/blob/master/pillar/kube-master.sls
&lt;/code&gt;&lt;/pre&gt;

7.2 Создаём pillar-файл для рабочих-нод /srv/pillar/kube-node.sls по образцу https://github.com/itrm/salt-for-kube/blob/master/pillar/kube-node.sls&lt;br /&gt;
&lt;br /&gt;
8) Добавляем в файл /srv/pillar/top.sls строки по образцу https://github.com/itrm/salt-for-kube/blob/master/pillar/top.sls&lt;br /&gt;
&lt;br /&gt;
9) Добавляем в файл /srv/salt/base/top.sls строки по образцу https://github.com/itrm/salt-for-kube/blob/master/salt/base/top.sls&lt;br /&gt;
&lt;br /&gt;
10) Устанавливаем docker на все ноды кластера.&lt;br /&gt;
Запускаем стейт:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;salt -C &#39;G@roles:kube-master&#39; state.sls docker
salt -C &#39;G@roles:kube-node&#39; state.sls docker
&lt;/code&gt;&lt;/pre&gt;

11) Теперь всё готово для установки kubernetes-кластера&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;salt -C &#39;G@roles:kube-master&#39; state.highstate
salt -C &#39;G@roles:kube-node&#39; state.highstate
&lt;/code&gt;&lt;/pre&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/8636057476623754544/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/8636057476623754544' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/8636057476623754544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/8636057476623754544'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2018/11/kubernetes-c-saltstack.html' title='Установка кластера Kubernetes c помощью SaltStack'/><author><name>Rodion</name><uri>http://www.blogger.com/profile/15501389461148823459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-1762012538788075690</id><published>2018-07-13T14:35:00.000+02:00</published><updated>2018-07-13T14:35:46.717+02:00</updated><title type='text'>Создание бесплатного TLS сертификата для сайта</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
С развитием сайта и в случае, если сайт предоставляет сервисы для клиентов, появляется необходимость обеспечения безопасного соединения клиентов с сайтом. Поэтому многие сайты переходят с протокола HTTP на HTTPS.&lt;br /&gt;
Для работы HTTPS версии сайта требуются TLS (SSL) сертификаты. Раньше сертификаты нужно было покупать в специализированных центрах сертификации, но c появлением технологии Let’s Encrypt, сертификаты теперь можно получить бесплатно.&lt;br /&gt;
Расскажем как можно получить такой сертификат, а также как настроить автоматическое продление TLS сертификата, ведь срок действия letsencrypt-сертификата составляет всего 3 месяца.&lt;br /&gt;
&lt;br /&gt;
Перед началом убеждаемся, что у нас установлены python и git.&lt;br /&gt;
&lt;br /&gt;
Затем нужно настроить web-сервер для того, чтобы он смог обработать запрос на 
подтверждение подлинности сайта, т.е. что сертификат запросил именно владелец 
сайта, а не кто-то другой.
Для этого в конфигурационный файл сайта в nginx добавляем такой location:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;location /.well-known/ {
  root /var/www/html;
}
&lt;/code&gt;&lt;/pre&gt;
И перезагружаем nginx:&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;service nginx reload&lt;/code&gt;&lt;/pre&gt;
А для apache такие настройки:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;Alias /.well-known /var/www/html/.well-known
&amp;lt;Directory &quot;/var/www/html&quot;&amp;gt;
 Require all granted
 RewriteEngine off
&amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
И перезагружаем apache:&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;service apache2 reload&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Далее скачиваем специализированное ПО для получения сертификата, называемое certbot:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;cd /root
git clone https://github.com/certbot/certbot
&lt;/code&gt;&lt;/pre&gt;
Теперь всё готово, сертификат получаем такой командой:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;cd /root/certbot/
./certbot-auto certonly --webroot -w /var/www/html -d &amp;lt;ваш_домен&amp;gt; -d www.&amp;lt;ваш_домен&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
Certbot сохранит сделанные сертификаты в папке /etc/letsencrypt/live/&amp;lt;ваш_домен&amp;gt;/&lt;br /&gt;
&lt;br /&gt;
Теперь настраиваем web-сервер для работы сайта по HTTPS.
Для nginx настройки могут быть такие:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;server {
  listen 443 ssl http2;
  server_name &amp;lt;ваш_домен&amp;gt; www.&amp;lt;ваш_домен&amp;gt;;

  ssl on;
  ssl_certificate /etc/letsencrypt/live/&amp;lt;ваш_домен&amp;gt;/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/&amp;lt;ваш_домен&amp;gt;/privkey.pem;

  error_log /var/log/nginx/&amp;lt;ваш_домен&amp;gt;-errors.log;
  access_log /var/log/nginx/&amp;lt;ваш_домен&amp;gt;-access.log;

  location /.well-known/ {
    root /var/www/html;
  }

  location / {
    root /var/www/&amp;lt;ваш_домен&amp;gt;;
  }
}
&lt;/code&gt;&lt;/pre&gt;
Для apache:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&amp;lt;VirtualHost *:443&amp;gt;
 DocumentRoot /var/www/&amp;lt;ваш_домен&amp;gt;
 ServerName &amp;lt;ваш_домен&amp;gt;
 ServerAlias www.&amp;lt;ваш_домен&amp;gt;

 ErrorLog /var/log/apache2/&amp;lt;ваш_домен&amp;gt;-error.log
 CustomLog /var/log/apache2/&amp;lt;ваш_домен&amp;gt;-access.log common

 SSLEngine on
 SSLCertificateFile /etc/letsencrypt/live/&amp;lt;ваш_домен&amp;gt;/fullchain.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/&amp;lt;ваш_домен&amp;gt;/privkey.pem

 Alias /.well-known /var/www/html/.well-known
 &amp;lt;Directory &quot;/var/www/html&quot;&amp;gt;
   Require all granted
   RewriteEngine off
 &amp;lt;/Directory&amp;gt;

 &amp;lt;Directory &quot;/var/www/&lt;ваш_домен&gt;&quot;&amp;gt;
   Require all granted
 &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
Перезагружаем web-сервер для применения настроек.&lt;br /&gt;

Чтобы по истечении срока годности сертификата сertbot продлил его автоматически, добавляем в /etc/crontab строки:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;# Update all TLS certs
22 13 * * * root /root/certbot/certbot-auto renew -q --no-self-upgrade --post-hook &#39;service nginx restart&#39;
&lt;/code&gt;&lt;/pre&gt;
Или, в случае с apache:
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;# Update all TLS certs
22 13 * * * root /root/certbot/certbot-auto renew -q --no-self-upgrade --post-hook &#39;service apache2 restart&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Теперь все готово, можно пользоваться https версией сайта!
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/1762012538788075690/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/1762012538788075690' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/1762012538788075690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/1762012538788075690'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2018/07/tls.html' title='Создание бесплатного TLS сертификата для сайта'/><author><name>Rodion</name><uri>http://www.blogger.com/profile/15501389461148823459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-8720895842564716740</id><published>2017-12-25T17:42:00.002+02:00</published><updated>2017-12-25T17:42:46.731+02:00</updated><title type='text'>Автоматизация администрирования Linux/UNIX серверов (часть 3)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-5e9f4416-2e32-81e2-de1a-4ab35aad9a67&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; font-size: 21.3333px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Рассмотрим автоматизацию настройки веб-сервера Nginx при помощи SaltStack.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b id=&quot;docs-internal-guid-621b9004-2e2f-11b5-18ae-de031747e285&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;

&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Для начала создадим каталог mkdir /srv/salt/base/nginx в которой будут размещаться states и другие файлы для конфигурирования удаленных веб-серверов nginx через minion. После создания каталога нам нужно будет создать в нем init.sls файл (states в Salt имеют расширение .sls). &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;

&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   По умолчанию Salt для файлов states (.sls) использует один из самых простых и доступных форматов сериализации - YAML. Но есть поддержка также таких форматов как:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Jinja + YAML, Mako + YAML, Wempy + YAML, Jinja + json, Mako + json и Wempy + json.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Мы в наших примерах будем использовать формат YAML. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;

&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Создадим файл:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:/srv/salt/base/nginx# vim init.sls 
&lt;/code&gt;&lt;/pre&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; И добавим в него строки:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;nginx:
  pkg:
    - installed
  service:
    - running
    - watch:
      - pkg: nginx
      - file: /etc/logrotate.d/nginx
      - file: /etc/nginx/nginx.conf

/etc/nginx/nginx.conf:
  file:
    - managed
    - source: salt://nginx/nginx.conf
    - user: root
    - group: root
    - mode: 644

/etc/logrotate.d/nginx:
  file.managed:
    - source: salt://nginx/logrotate.nginx
    - mode: 644 
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot;; font-size: 13.3333px; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   Итого у нас в папке такие файлы: &lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:/srv/salt/base/nginx# ls
init.sls  logrotate.nginx  nginx.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot;; font-size: 13.3333px; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   Запустим теперь созданный state на веб-сервер web1: &lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:/srv/salt/base/nginx# salt -v web1 state.sls nginx
Executing job with jid 20151226185841988594
-------------------------------------------
web1:
----------
          ID: nginx
    Function: pkg.installed
      Result: True
     Comment: The following packages were installed/updated: nginx
     Started: 18:58:42.351829
    Duration: 8520.115 ms

----------
          ID: /etc/logrotate.d/nginx
    Function: file.managed
      Result: True
     Comment: File /etc/logrotate.d/nginx updated
     Started: 18:58:50.937424
    Duration: 61.313 ms
 ----------
          ID: /etc/nginx/nginx.conf
    Function: file.managed
      Result: True
     Comment: File /etc/nginx/nginx.conf updated
     Started: 18:58:50.998879
    Duration: 5.475 ms
   ----------
          ID: nginx
    Function: service.running
      Result: True
     Comment: Service restarted
     Started: 18:58:51.050241
    Duration: 1072.89 ms
     Changes:   
              ----------
              nginx:
                  True
Summary
------------
Succeeded: 4 (changed=4)
Failed:    0
------------
Total states run:     4
&lt;/code&gt;&lt;/pre&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Теперь создадим файл top.sls, с которого SaltStack начнет считывать состояния. Создав в корне папки /srv/salt/base/ файл top.sls:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:/srv/salt/base # vim top.sls 
base:
  &#39;roles:web&#39;:
     - match: grain
     - nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Мы сможем применить нашу конфигурацию ко всем узлам у которых grains в файле /etc/salt/minion &amp;nbsp;прописаны настройки роли web:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;grains:
  roles:
    - web
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot;; font-size: 13.3333px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Например, командой:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:/srv/salt/base # salt -G &#39;roles:web&#39; state.highstate
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/8720895842564716740/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/8720895842564716740' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/8720895842564716740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/8720895842564716740'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2017/12/linuxunix-3.html' title='Автоматизация администрирования Linux/UNIX серверов (часть 3)'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-6288217345978963624</id><published>2016-07-25T01:27:00.001+02:00</published><updated>2016-07-28T00:23:35.250+02:00</updated><title type='text'>Автоматизация администрирования Linux/UNIX серверов (часть 2)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Автоматизация настройки служб при помощи Salt master и minions.&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;b id=&quot;docs-internal-guid-acaf805a-1f35-91e7-e9bd-6424e7e7795f&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Для использования основной конфигурации SaltStack необходимо установить master на центральный сервер и minion на управляемые сервера. Рассмотрим установку на Linux Debian\Ubuntu. Информацию по установке на другие системы можно найти на сайте разработчика docs.saltstack.com. &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Для Debian 8 (Jessie) на серверах необходимо импортировать ключ:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;# wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   После этого добавить в /etc/apt/sources.list строку:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot;; font-size: 13.3333px; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   Теперь можно выполнить установку как master, так и minion:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:/ # apt-get update
&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/ # apt-get install salt-master
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.9565217391304346; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;либо на управляемом узле:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;web1:/ # apt-get update
web1:/ # apt-get install salt-minion
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   После установки конфигурационные файлы master &amp;nbsp;и minion лежат в /etc/salt/&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;/etc/salt/master и /etc/salt/minion соответственно. &lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: 13.3333px; line-height: 1.38; white-space: pre-wrap;&quot;&gt;В файле /etc/salt/master для начала работы достаточно только прописать ИП-адрес сервера master в строке:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;interface: 10.10.10.10
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   А также прописать пути file_roots и pillar_roots, об это чуть поже и перезапустить Salt master: &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/ # service salt-master restart
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   На сервере web1, где установлен minion в файле /etc/salt/minion нужно указать адрес хоста master и в разделе grains описать дополнительные сведения о minion, например:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;web1:/ # vim /etc/salt/minion
master: salt
ipv6: True
grains:
  roles:
    - web
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   После перезапуска minion командой:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;web1:/ # service salt-minion restart
salt-minion stop/waiting
salt-minion start/running, process 28554
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Minion вышлет свой открытый ключ на master, где его необходимо будет принять для дальнейшей работы связки master-minion. Просмотреть список всех ключей на мастере можно командой:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/ # salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
web1
Rejected Keys:
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Принять ключ можно командой:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:~# salt-key -a web1
The following keys are going to be accepted:
Unaccepted Keys:
web1
Proceed? [n/Y] Y
Key for minion saltminion accepted.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Либо просто командой:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:~# salt-key -A 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span c=&quot;&quot; master.=&quot;&quot; minion=&quot;&quot; span=&quot;&quot; style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot; web1=&quot;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/# salt -v web1 cmd.run &quot;hostname -s&quot;
Executing job with jid 20151227190052206904
-------------------------------------------
web1:
    web1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   По умолчанию файлы для управления и настройки удаленных узлов (Salt States или дальше просто states) располагаются на master в папке:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/# ls /srv/
formulas  pillar  salt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Эти пути можно переопределить в /etc/salt/master. Пример:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;file_roots:
  base:
    - /srv/salt/base
    - /srv/formulas/sudoers-formula
    - /srv/formulas/timezone-formula

pillar_roots:
  base:
    - /srv/pillar
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   В pillar_roots в отличие от file_roots данные доступны только для конкретных узлов, указанных в файле &amp;nbsp;&amp;nbsp;/srv/pillar/top.sls и недоступны другим управляемым узлам. Это позволяет использовать pillar_roots для настройки пользователей, ключей и тд, требующих повышенной безопасности.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Пример /srv/pillar/top.sls:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;base:
  &#39;*&#39;:
    - locale
  &#39;roles:dev&#39;:
    - match: grain
    - add_dev_users
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Cервер на котором в настройках &amp;nbsp;/etc/salt/minion будет прописан:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;grains:
  roles:
    - dev
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Сможет воспользоваться стейтами /srv/pillar/locale.sls и /srv/pillar/add_dev_users.sls, так как minion входит в группу dev. Другие узлы смогут воспользоваться только /srv/pillar/locale.sls.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   В папке /srv/formulas размещаются уже готовые states которые можно загрузить из репозитария &lt;/span&gt;&lt;a href=&quot;https://github.com/saltstack-formulas&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://github.com/saltstack-formulas&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Данные готовые шаблоны states можно использовать для таких задач, как установка пакетов, настройка и запуск служб, создание пользователей или прав доступа, и многое другое. &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Загрузить готовые formulas можно несколькими способами:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/# cd /srv/formulas
&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/srv/formulas# git clone https://github.com/saltstack-formulas/docker-formula.git
Cloning into &#39;docker-formula&#39;...
remote: Counting objects: 354, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 354 (delta 0), reused 0 (delta 0), pack-reused 352
Receiving objects: 100% (354/354), 56.98 KiB | 0 bytes/s, done.
Resolving deltas: 100% (172/172), done.
Checking connectivity... done.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   После этого в папке docker-formula/docker/ можно увидеть готовые шаблоны для конфигурирования docker-контейнеров:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/srv/formulas# ls docker-formula/docker/
codenamemap.yaml  compose-ng.sls  compose.sls  containers.sls  defaults.yaml  files  init.sls  kernel.sls  map.jinja  registry.sls
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Второй путь загрузить архив и распаковать:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/srv/formulas# wget https://github.com/saltstack-formulas/docker-formula/archive/master.zip
&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/srv/formulas# unzip master.zip
Archive:  master.zip
3e8c4ef0a8f5f7f03b156d199ad3271dc5ac63cd
   creating: docker-formula/
   …
&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/srv/formulas# ls docker-formula/docker/
codenamemap.yaml  compose-ng.sls  compose.sls  containers.sls  defaults.yaml  files  init.sls  kernel.sls  map.jinja  registry.sls
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Дальше нужно путь к новой папке нужно прописать в конфигурационный файл мастера:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;file_roots:
  base:
    - /srv/salt/base
    - /srv/formulas/sudoers-formula
    - /srv/formulas/timezone-formula
   - /srv/formulas/docker-formula
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;И перезапустить Salt Master:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:/srv/formulas# service salt-master restart
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   После этого новые шаблоны states можно использовать для настройки docker-контейнеров.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.714285716; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;verdana&amp;quot;; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   В папке /srv/salt/base мы будем создавать собственные states, вы можете использовать другой путь, предварительно прописав его в конфигурации master в разделе:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;file_roots:
  base:
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/6288217345978963624/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/6288217345978963624' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/6288217345978963624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/6288217345978963624'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2016/07/linuxunix-2.html' title='Автоматизация администрирования Linux/UNIX серверов (часть 2)'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-3336079215447448688</id><published>2016-01-15T15:25:00.002+02:00</published><updated>2016-07-28T00:30:32.987+02:00</updated><title type='text'>Автоматизация администрирования Linux/UNIX серверов (часть 1)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: &amp;quot;verdana&amp;quot;; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Автоматизация администрирования серверов для Веб при помощи Salt.&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: &amp;quot;verdana&amp;quot;; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   S&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;altStack&lt;/span&gt;&lt;span style=&quot;font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; или коротко Salt &amp;nbsp;- это Open Source система &lt;/span&gt;&lt;span style=&quot;font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;централизованного управления конфигурацией &lt;/span&gt;&lt;span style=&quot;font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;операционных систем и программ, установленных на серверах. Система достаточно мощная, масштабируемая и позволяет управлять десятками тысяч серверов одновременно и быстро. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Salt система аналогичная Chef и Puppet, но в отличии от них написан на языке Python, который пока является основным языком автоматизации у Linux администраторов и DevOps. &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Кроме этого, он относительно менее требователен к ресурсам и немного проще в использовании (на наш взгляд). Salt использует на сетевом уровне проверенную библиотеку &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ZeroMQ&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, что позволяет обновлять конфигурацию серверов очень быстро.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   Две основные функции Salt: управление конфигурацией и удаленное выполнение команд. Работать с Salt можно только из командной строки. Благодаря этому систему просто установить и начать использовать даже на слабом оборудовании. &amp;nbsp;В любом случае, &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;большинство Linux или UNIX серверов не включают в себя графический интерфейс.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; white-space: pre-wrap;&quot;&gt;Способы работы с Salt.&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; white-space: pre-wrap;&quot;&gt;Использование Salt без установки Мастера.&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   Основная архитектура Salt состоит в установке централизованного master и Salt minions (клиентов) на удаленные машины. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   Однако, вы можете использовать Salt и для настройки одного единственного сервера. Для этого достаточно установить на сервер только minion. Он содержит широкие функциональные возможности для самостоятельной работы и предназначен для:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.9565217391304346; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Использования команды salt-call &amp;nbsp;в системе без подключения к мастеру&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.9565217391304346; margin-bottom: 8pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Запуска сценариев конфигурирования локально, по аналогии, как это делается с Мастера для удаленных серверов &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;   Конфигурационные файлы при этом расположены также как на Мастере:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;minion# ls /srv
formulas pillar salt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;Только вместо команды:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master# salt remote-host state.highstate 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;Используется команда:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;minion# salt-call state.highstate
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;Выполнение команд Salt через SSH без установки minion. &lt;/span&gt;&lt;/h4&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   Вы можете использовать Salt для автоматизации работы с серверами при помощи SSH без установки minion на управляемые узлы. Для этого нужно установить пакет salt-ssh на Мастер сервер Salt. Для Debian и Ubuntu это можно сделать так:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;master:~$ sudo add-apt-repository ppa:saltstack/salt
&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:~$ sudo apt-get install salt-ssh

&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;:~$ sudo dpkg -l | grep salt-ssh
ii  salt-ssh    2015.5.3+ds-1trusty1    all     remote manager to administer servers via salt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; line-height: 1.38; white-space: pre-wrap;&quot;&gt;Далее включить в конфигурационный файл salt-ssh требуемые для управления узлы:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span style=&quot;line-height: 1.38;&quot;&gt;master&lt;/span&gt;# cat /etc/salt/roster
web1:
  host: web1 
  user: useradmin
  passwd: admin_pass
  sudo: True
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;   При включенной опции &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&amp;nbsp;sudo: True &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;nbsp;пользователь на удаленном узле websrv1 должен быть прописан в sudoers c опцией NOPASSWD.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;web1:~$ cat /etc/sudoers | grep useradmin
useradmin ALL=(ALL) NOPASSWD: ALL
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;span style=&quot;background-color: white; font-family: &amp;quot;verdana&amp;quot; , sans-serif; line-height: 1.38; white-space: pre-wrap;&quot;&gt;   После этого мы можем выполнять команды на удаленном узле:&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;root@master:~# salt-ssh -i &#39;*&#39; cmd.run &quot;service nginx status&quot;
Executing job with jid 20151224154255487679
-------------------------------------------
web1:
    * nginx is running

Или:

root@master:~# salt-ssh -v web1 cmd.run &quot;du -sch /var/log&quot;
Executing job with jid 20151218192723210705
-------------------------------------------

web1:
    11G /var/log
    11G total
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/3336079215447448688/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/3336079215447448688' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/3336079215447448688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/3336079215447448688'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2016/01/linuxunix-1.html' title='Автоматизация администрирования Linux/UNIX серверов (часть 1)'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-1204853193348561869</id><published>2015-12-31T13:03:00.000+02:00</published><updated>2015-12-31T13:11:52.904+02:00</updated><title type='text'>Установка системы управления docker-контейнерами kubernetes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-23f48435-f360-d4c6-2a45-0f8a1cc420cf&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;/h2&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;С развитием инфраструктуры docker-контейнеров появляется необходимость управления большим числом docker-контейнеров. Для этой цели служат системы:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Kubernetes развиваемый компанией Google&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Mesos развиваемый в сообществе Apache&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Docker Swarm от создателей Docker.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Компания Google утверждает, что уже более 9-ти лет использует в своей работе контейнеры. Поэтому разрабатываемая ими система Kubernetes является на сегодня стабильной и продвинутой.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;С помощью этой статьи вы сможете легко развернуть кластер kubernetes из мастера и двух нод. И легко добавлять node-машины в дальнейшем. Мастер нода имеет API для управления кластером и дирежирует контейнерами. Ноды получают команды от мастера и запускают контейнеры.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt; Для начала нужно иметь 2 сервера и установить на них Docker.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Мы будем использовать 2 Docker-демона на каждом сервере:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.6667px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Docker начальной загрузки для запуска flanneld и etcd;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.6667px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Основной Docker для запуска инфраструктуры Kubernetes и запуска наших контейнеров.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Потребность в двух docker-демонах необходима по той причине, что для объединения всех контейнеров в единую сеть, будет использоваться демон flannel. Он должен запускаться не в основном Docker.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;Настройка мастера&lt;/b&gt; &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Мастер настраивается в 2 этапа:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;установка flanneld и etcd&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;запуск компонент мастера&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Для простоты, инициализируем переменную с IP адресом мастера:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;export MASTER_IP=&amp;lt;IP адрес мастера, например 1.2.3.4&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем вспомогательный docker&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;sudo sh -c &#39;docker -d -H unix:///var/run/docker-bootstrap.sock \
  -p /var/run/docker-bootstrap.pid \
  --iptables=false \
  --ip-masq=false \
  --bridge=none \
  --graph=/var/lib/docker-bootstrap \
  2&amp;gt; /var/log/docker-bootstrap.log 1&amp;gt; /dev/null &amp;amp;&#39;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Этот docker запускается с опцией --iptables=false, чтобы запускаемые им контейнеры работали только с опцией --net=host.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем etcd для flannel и API &lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker -H unix:///var/run/docker-bootstrap.sock run  \
  --restart=always \
  --net=host 
  -d gcr.io/google_containers/etcd:2.0.12 \
  /usr/local/bin/etcd --addr=127.0.0.1:4001 \
  --bind-addr=0.0.0.0:4001 \
  --data-dir=/var/etcd/data&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;u&gt;Прописываем в etcd сеть для flannel&lt;/u&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Сеть не должна пересекаться с уже имеющимися сетями:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker -H unix:///var/run/docker-bootstrap.sock run \
  --net=host \
  gcr.io/google_containers/etcd:2.0.12 \
  etcdctl set /coreos.com/network/config &#39;{ &quot;Network&quot;: &quot;10.1.0.0/16&quot; }&#39;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Устанавливаем flannel на мастер-ноде&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Flannel перенастраивает bridge, который настроил Docker. Поэтому надо остановить основной Docker, запустить Flannel и снова запустить Docker.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Останавливаем Docker&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;sudo service docker stop&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем flannel&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker -H unix:///var/run/docker-bootstrap.sock run \
  -d \
  --restart=always \
  --net=host \
  --privileged \
  -v /dev/net:/dev/net \
  quay.io/coreos/flannel:0.5.0&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Эта команда выведет длинный хеш, который будет использоваться в следующей команде. Скопируйте его.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Получаем настройки flannel-сети&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker -H unix:///var/run/docker-bootstrap.sock \
  exec &amp;lt;длинный-хеш&amp;gt; cat /run/flannel/subnet.env&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Пример вывода этой команды:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;FLANNEL_SUBNET=10.1.10.1/24
FLANNEL_MTU=1472
FLANNEL_IPMASQ=false&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Добавляем вспомогательный Docker в автозагрузку&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Создаём файл /lib/systemd/system/docker-bootstrap.socket с таким содержимым:&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;ini&quot;&gt;[Unit]
Description=Docker Socket for the API
PartOf=docker-bootstrap.service

[Socket]
ListenStream=/var/run/docker-bootstrap.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;И файл /lib/systemd/system/docker-bootstrap.service с таким содержимым:&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;ini&quot;&gt;[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker-bootstrap.socket
Requires=docker-bootstrap.socket

[Service]
ExecStart=/usr/bin/docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

[Install]
WantedBy=multi-user.target&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;В файл /lib/systemd/system/docker.service после After=network.target docker.socket&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;добавляем docker-bootstrap.service&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;После этого перечитываем конфиги systemctl&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;systemctl daemon-reload&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;systemctl enable docker-bootstrap&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Настраиваем основной Docker&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;В конфиругационном файле или в скрипте запуска (для Ubuntu это /etc/default/docker или /etc/systemd/service/docker.service) нужно добавить:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;--bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Вместо FLANNEL_SUBNET и FLANNEL_MTU нужно прописать параметры из вывода предыдущей команды.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Команда запуска основного докера должа получится примерно такой:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;/usr/bin/docker -d -H fd:// --bip=&quot;10.1.10.1/24&quot; --mtu=1472&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Удаляем существующий Docker bridge&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;По-умолчанию Docker создаёт bridge и именем docker0. Удалим его&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo /sbin/ifconfig docker0 down
sudo brctl delbr docker0&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем запускаем основной Docker&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo service docker start&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем kubernetes мастер&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker run \
  --volume=/:/rootfs:ro \
  --volume=/sys:/sys:ro \
  --volume=/dev:/dev \
  --volume=/var/lib/docker/:/var/lib/docker:rw \
  --volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
  --volume=/var/run:/var/run:rw \
  --net=host \
  --privileged=true \
  --pid=host \
  --restart=always \
  -d \
  gcr.io/google_containers/hyperkube:v1.1.3 /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests-multi --cluster-dns=10.0.0.10 --cluster-domain=cluster.local&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Примечание: --cluster-dns и --cluster-domain нужны для запуска внутреннего DNS сервера. Можно исключить их из команды запуска мастера.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Примечание 2: если при запуске этого контейнера появляется ошибка &quot;System error: The minimum allowed cpu-shares is 1024&quot;, то лечится она добавлением параметра --exec-opt native.cgroupdriver=cgroupfs в команду запуска основого Docker.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем service proxy для kubernetes&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Service proxy обеспечивает балансировку нагрузку между группами контейнеров объединёных в Kubernetes services&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker run -d --restart=always \
  --net=host \
  --privileged \
  gcr.io/google_containers/hyperkube:v1.1.3 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Теперь у нас есть настроенный кластер из одной &amp;nbsp;ноды и мастера. Можем протестировать это.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Скачаем утилиту kubectl &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;wget -O /usr/bin/kubectl http://storage.googleapis.com/kubernetes-release/release/v1.1.3/bin/linux/amd64/kubectl
chmod +x /usr/bin/kubectl &lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запустим команду&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;kubectl get nodes&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Пример вывода этой команды:
&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;NAME        LABELS                             STATUS
127.0.0.1   kubernetes.io/hostname=127.0.0.1   Ready&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;b&gt;Добавление ноды в кластер&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Добавление ноды во многом повторяет настройку мастера. Процесс состоит из 3 шагов&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;запуск flanneld&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;запуск kubernetes&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;добавление ноды в кластер&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Инициализируем 2 переменные:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;export MASTER_IP=&amp;lt;IP адрес мастера, например 1.2.3.4&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;export NODE_IP=&amp;lt;IP адрес ноды, например 4.3.2.1&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запуск flanneld&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем Docker &amp;nbsp;для начальной загрузки&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo sh -c &#39;docker -d -H unix:///var/run/docker-bootstrap.sock \
  -p /var/run/docker-bootstrap.pid \
  --iptables=false \
  --ip-masq=false \
  --bridge=none \
  --graph=/var/lib/docker-bootstrap \
  2&amp;gt; /var/log/docker-bootstrap.log 1&amp;gt; /dev/null &amp;amp;&#39;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Останавливаем основной Docker&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo service docker stop&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем flannel&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker -H unix:///var/run/docker-bootstrap.sock run \
  -d \
  --net=host \
  --privileged \
  -v /dev/net:/dev/net \
  quay.io/coreos/flannel:0.5.0 /opt/bin/flanneld --etcd-endpoints=http://${MASTER_IP}:4001&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Эта команда выведет длинный хеш, который будет использоваться в следующей команде. Скопируйте его.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Получаем настройки flannel-сети&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker -H unix:///var/run/docker-bootstrap.sock \
  exec &amp;lt;длинный-хеш&amp;gt; cat /run/flannel/subnet.env&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Пример вывода этой команды:
&lt;/span&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;FLANNEL_SUBNET=10.1.90.1/24
FLANNEL_MTU=1472
FLANNEL_IPMASQ=false&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Настраиваем основной Docker&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;В конфиругационном файле или в скрипте запуска (для Ubuntu это /etc/default/docker или /etc/systemd/service/docker.service) нужно добавить:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;--bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Вместо FLANNEL_SUBNET и FLANNEL_MTU нужно прописать параметры из вывода предыдущей команды.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Команда запуска основного докера должа получится примерно такой:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;/usr/bin/docker -d -H fd:// --bip=&quot;10.1.90.1/24&quot; --mtu=1472&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Удаляем существующий Docker bridge&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo /sbin/ifconfig docker0 down
sudo brctl delbr docker0&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем запускаем основной Docker&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo service docker start&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запуск kubernetes для ноды&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запускаем &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;kubelet&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker run \
    --volume=/:/rootfs:ro \
    --volume=/sys:/sys:ro \
    --volume=/dev:/dev \
    --volume=/var/lib/docker/:/var/lib/docker:rw \
    --volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
    --volume=/var/run:/var/run:rw \
    --net=host \
    --privileged=true \
    --pid=host \
    -d \
    gcr.io/google_containers/hyperkube:v1.1.3 /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests-multi --cluster-dns=10.0.0.10 --cluster-domain=cluster.local&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Примечание: --cluster-dns и --cluster-domain можно исключить из этой команды&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Запуск service proxy&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;bash&quot;&gt;sudo docker run -d \
  --net=host \
  --privileged \
  gcr.io/google_containers/hyperkube:v1.1.3 /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Теперь, выполнив на мастере команду kubectl get nodes, мы увидим, что новая нода включена в кластер.&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;NAME              LABELS                                   STATUS
127.0.0.1         kubernetes.io/hostname=127.0.0.1         Ready
NODE_IP           kubernetes.io/hostname=NODE_IP           Ready&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;Сделано на основе документации:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;https://github.com/kubernetes/kubernetes/blob/release-1.1/docs/getting-started-guides/docker-multinode/master.md&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;&quot;&gt;https://github.com/kubernetes/kubernetes/blob/release-1.1/docs/getting-started-guides/docker-multinode/worker.md&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/1204853193348561869/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/1204853193348561869' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/1204853193348561869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/1204853193348561869'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2015/12/docker-kubernetes-docker.html' title='Установка системы управления docker-контейнерами kubernetes'/><author><name>Rodion</name><uri>http://www.blogger.com/profile/15501389461148823459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-3612001380885264089</id><published>2013-08-02T19:19:00.001+03:00</published><updated>2014-01-22T13:03:21.292+03:00</updated><title type='text'>Мониторинг веб-сервера Nginx c помощью zabbix trapper</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-567873d4-3fc9-6516-6e2e-412e498bc530&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 19px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рассмотрим случай, когда требуется настроить мониторинг сервера по множеству однотипных или динамических метрик, которые отсутствуют в zabbix-агенте. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;В такой ситуации в zabbix-агенте можно создавать ключи для проверки с помощью параметра конфигурации - UserParameter. Для каждого параметра в zabbix_agentd.conf создаётся строка вида:&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;UserParameter=&amp;lt;key&amp;gt;,&amp;lt;shell command&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Однако, если значений слишком много, такой способ может оказаться не удобным.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Второй способ заключается в использовании элемента данных zabbix типа trapper (zabbix-ловушки). Принцип очень простой: в zabbix-сервере создаются элементы данных этого типа с произвольным именем ключа. Затем, с помощью утилиты zabbix_sender формируется специальный запрос, в котором указывается ключ ловушки, значение параметра и имя хоста. Если параметров много, то можно сформировать файл в формате zabbix_sender и отправить все значения из файла за одно соединение с сервером. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Строки в файле должны быть оформлены в таком виде:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;- &amp;lt;ключ&amp;gt; &amp;lt;значение&amp;gt; (дефис в начале строки обязателен)&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;или&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;lt;имя_хоста&amp;gt; &amp;lt;ключ&amp;gt; &amp;lt;значение&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Рассмотрим, как использовать эту возможность на примере мониторинга популярного веб-сервера Nginx. &amp;nbsp;Для этого веб-сервера есть возможнось использовать модуль stub_status, который показывает в цифрах текущую нагрузку на Nginx примерно в таком виде:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Active connections: 26&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;server accepts &amp;nbsp;&amp;nbsp;&amp;nbsp;handled &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;requests&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; 1344375 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1344375 &amp;nbsp;&amp;nbsp;&amp;nbsp;3208201&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Reading: 0 Writing: 2 Waiting: 24&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Из этих данных мы можем получить, например, такие метрики для мониторинга:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.active &amp;nbsp;&amp;nbsp;- &amp;nbsp;количество всех открытых соединений&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.reading - &amp;nbsp;количество запросов, у которых nginx читает заголовки запроса&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.writing - количество запросов, у которых в данный момент сервер читает тело запроса, обрабатывает запрос или пишет ответ клиенту&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.waiting &amp;nbsp;- &amp;nbsp;количество неактивных(keep-alive) соединений&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.accepts - количество принятых запросов в секунду&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.handled - количество обрабатываемых запросов в секунду&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;nginx_status.requests &amp;nbsp;- количество запросов в секунду&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp; Благодаря этим параметрам можно оценить нагрузку на сервер (в течении дня, недели и т.д.) , а также оценить узкие места в его работе (медленный ли канал у сервера, медленные ли каналы у клиентов, медленно ли обрабабатываются запросы и т.д.).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Скрипт, формирующий файл для zabbix_sender-а и запускающий zabbix_sender, может запускаться zabbix-агентом. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Для этого в конфигурационном файле агента zabbix_agentd.conf создадим ключ nginx_status:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;UserParameter=nginx_status,/home/zabbix/nginx.sh 127.0.0.1&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Содержимое /home/zabbix/nginx.sh примерно такое:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;# this script tries to collect nginx data&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;########################################&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;# Active connections: 768 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;# server accepts handled requests &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;# &amp;nbsp;133844 133844 601894 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;# Reading: 63 Writing: 21 Waiting: 684 #&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;########################################&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
WGET=&quot;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/usr/local/bin/wget&quot;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ZBX_STATS_FILE=&quot;/var/log/zabbix/ZabbixStats.txt&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ZBX_SENDER=&quot;/home/zabbix/bin/zabbix_sender&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ZBX_CONFIG=&quot;/home/zabbix/conf/zabbix_agentd.conf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ZBX_HOSTNAME=`grep &quot;^Hostname&quot; ${ZBX_CONFIG} | cut -f2 -d&quot;=&quot;`&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;NGX_STATS_FILE=&quot;/var/log/zabbix/NginxStats.txt&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;if [ -z $1 ]; then&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;NGX_HOSTNAME=&quot;localhost&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;NGX_HOSTNAME=&quot;${1}&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;$WGET -q -O ${NGX_STATS_FILE} -t3 -T5 http://${NGX_HOSTNAME}/nginx-status&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;if [ $? == 0 ]; then&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cat ${NGX_STATS_FILE} | awk -v myhost=$ZBX_HOSTNAME &#39;/Active connections/ {active = int($NF)}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/\W*([0-9]+)\W*([0-9]+)\W*([0-9]+)/ {accepts = int($1); handled = int($2); requests = int($3)}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/Reading:/ {reading = int($2); writing = int($4); waiting = int($NF)}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.active&quot;, active;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.reading&quot;, reading;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.writing&quot;, writing;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.waiting&quot;, waiting;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.accepts&quot;, accepts;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.handled&quot;, handled;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print myhost, &quot;nginx_status.requests&quot;, requests;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&#39; &amp;gt; ${ZBX_STATS_FILE}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;${ZBX_SENDER} -i ${ZBX_STATS_FILE} -c ${ZBX_CONFIG} &amp;gt;/dev/null&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo 1;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit 0&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;0&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit 1&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;При запросе сервером zabbix ключа nginx_status, скрипт вышлет данные серверу.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Создаем в zabbix-сервере шаблон - Template App Nginx. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Создаём в шаблоне элемент данных типа zabbix agent, запускающий скрипт /home/zabbix/nginx.sh (Рис. 1).&lt;/span&gt;&lt;img height=&quot;382px;&quot; src=&quot;https://lh3.googleusercontent.com/ZpvYS3mkP7FHrN32cFkLHQQL4UbUR-5VuEZ_53MfCHOh8Rl3RK6zrcbaaOP6RKgq2rOn7ySLGjmI7aoumkwvWnMYTQibcvGSTGQsn75sqylXgO30BYruENXV5A&quot; width=&quot;672px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок. 1 Элемент данных, запускающий скрипт /home/zabbix/nginx.sh&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Скрипт в случае успешного получения страницы nginx-status возвращает 1 и 0 - в противном случае. Полезно создать триггер отслеживающий эту ситуацию (Рис. 2).&lt;/span&gt;&lt;img height=&quot;389px;&quot; src=&quot;https://lh6.googleusercontent.com/V4YOsy42kcVSrog3jUI3Wnlv5r-xWKdIh2uiQks7IypVEigo2IRcMR0e7of0MrmFEI_smfFhl2bFEbVkwH7klCm6RICQ0djPHhMRTL3l6l9BhcVKfhKwdnppDg&quot; width=&quot;669px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 2. Тригер, отслеживаюший возможность получения статуса с Nginx.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Далее для каждого параметра создаем элемент данных типа zabbix trapper. На Рис.2 &amp;nbsp;пример для метритки nginx active connections.&lt;/span&gt;&lt;img height=&quot;360px;&quot; src=&quot;https://lh5.googleusercontent.com/VZbZNuQeBejMIEOB0j49LVd0z-OseGyDIkg0HiQ7sj8nicZjlYAw61n_Y21gRBZrkSnehnBIOgG38apcu5tR4E__IVo1Tc9MEiVlD4aKN0Yf8191QHXWtCu9_A&quot; width=&quot;655px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 3. Создание элемента данных для метрики nginx active connections.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;По аналогии делаем элементы для остальных метрик. Изменяется только название элемента данных (Name) и ключ (Key).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;После объединения графиков в группы получаются графики как на Рис. 4 и Рис. 5.&lt;/span&gt;&lt;img height=&quot;233px;&quot; src=&quot;https://lh6.googleusercontent.com/Z9eGe-XvIM_cpb_hFBalnMclB1fcBWzL8xkekpfeFhyeBzqAY4PH4NpGvKyPdyOdn3YEMYxsy51O-1pizy03KWz3NFB_uFJi6XFt17uniQ3bQ29u3BG_-9hHSw&quot; width=&quot;661px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 4. Статус соединений.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;img height=&quot;227px;&quot; src=&quot;https://lh6.googleusercontent.com/NmyrYkGOA6UMRjVqyRf7ePX4DBO7B3lvP3CN33iKp3DLcMK7uU-nZR2X-0XACIzxtYgFTdQsf2FRDg133YLGa5D07R8v_rtAGc0554ERG0dzRvfqknQfqFv6Nw&quot; width=&quot;668px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 5. Нагрузка на сервер.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Шаблон для мониторинга nginx можно скачать отсюда: &lt;a href=&quot;http://forum.itrm.ru/t/94/&quot;&gt;http://forum.itrm.ru/t/94/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/3612001380885264089/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/3612001380885264089' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/3612001380885264089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/3612001380885264089'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2013/08/nginx-c-zabbix-trapper.html' title='Мониторинг веб-сервера Nginx c помощью zabbix trapper'/><author><name>Rodion</name><uri>http://www.blogger.com/profile/15501389461148823459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh3.googleusercontent.com/ZpvYS3mkP7FHrN32cFkLHQQL4UbUR-5VuEZ_53MfCHOh8Rl3RK6zrcbaaOP6RKgq2rOn7ySLGjmI7aoumkwvWnMYTQibcvGSTGQsn75sqylXgO30BYruENXV5A=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-313273779091228563</id><published>2013-06-03T16:01:00.003+03:00</published><updated>2013-06-04T13:40:08.044+03:00</updated><title type='text'>Мониторинг и управление ИТ</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Общий взгляд на ИТ-мониторинг&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Для понимания, какое место занимает ИТ-мониторинг в управлении ИТ, необходимо понимать, как вообще управляются технические (и не только) системы. А для управления ими, как правило, используются либо замкнутый, либо разомкнутый контур передачи воздействия. Тут все зависит от того, какой информацией о системе мы уже обладаем или можем получить в процессе &amp;nbsp;управления.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Если у нас есть статистическая информация по ИТ-системе, что за квартал объем данных возрастает на 10 Тб, и данные надо собирать и хранить год, а в течение этого времени у нас не будет возможности контролировать дисковое пространство, мы можем заранее купить и установить диски на 40 Тб, чтобы система работала стабильно в требуемом временном интервале. Это пример управления ИТ при помощи разомкнутого контура на основе заранее собранной и проанализированной информации.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Другой пример, если у нас есть возможность контролировать определенные параметры ИТ-системы в реальном режиме времени и сразу реагировать на них. Например, свободное место на том же диске. Как только будет превышен определенный порог, это станет нам сразу же известно, и мы сможем удалить ненужные данные или перенести часть из них в резервное хранилище, чтобы система продолжала работать стабильно. Это пример управления с замкнутым контуром. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  ИТ-Мониторинг выполняет роль &amp;nbsp;датчиков в системе управления ИТ. Примерно так же, как датчики на приборной панели в автомобиле сообщают нам о состоянии различных устройств, чтобы мы могли вовремя принять меры для стабильной работы машины.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; text-align: center; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-weight: bold; line-height: 1.15;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; text-align: center; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-weight: bold; line-height: 1.15;&quot;&gt;ИТ-Мониторинг с точки зрения ITIL&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;

&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;  В ITIL (&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;библиотека, описывающая лучшие практики управления IT&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;) ИТ-Мониторинг играет одну из ключевых ролей в управлении ИТ-услугами.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Из глоссария ITIL:&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Мониторинг - &amp;nbsp;это постоянное наблюдение за Конфигурационной единицей, ИТ-услугой или Процессом с целью обнаружения Событий и обеспечения информированности о текущем состоянии.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  А вот управление Событиями, о которых информирует ИТ-мониторинг уже является основным процессом в управлении ИТ-услугами. ITIL классифицирует События в зависимости от значимости на Инциденты, Проблемы и Изменения и далее по каждому из видов Событий рекомендует использовать соответственно процессы управления Инцидентами, управления Проблемами и управления Изменениями, что в конечном итоге позволяет значительно повысить качество ИТ-услуг.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; font-weight: bold; line-height: 1.15; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; font-weight: bold; line-height: 1.15; white-space: pre-wrap;&quot;&gt;ИТ-Мониторинг с точки зрения COBIT&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: black; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;  В COBIT Мониторинг выведен в отдельный домен &quot;Мониторинг и оценка&quot;. Всего доменов в последней 5-ой версии пять, они схематически изображены на рисунке ниже. &amp;nbsp;&lt;/span&gt;&lt;img height=&quot;573px;&quot; src=&quot;https://lh6.googleusercontent.com/q_xVT3rYTYrKoqFt6zGuCb2FCJ4xJxnWBRdbIogHCu2AdFN5xHpJUEjE6ZzQCtrk70Q5qjRVGRIrZLQbPIGATS8rg8ImQhw4gCd_nF4Sbu5-DzDYcuBkWSsnEQ&quot; style=&quot;line-height: 1.0714285714285714;&quot; width=&quot;680px;&quot; /&gt;&lt;br /&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.0714285714285714; margin-bottom: 0pt; margin-top: 8pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.0714285714285714; margin-bottom: 0pt; margin-top: 8pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Рисунок 1. &lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Домены процессов в COBIT 5&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.0714285714285714; margin-bottom: 0pt; margin-top: 8pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Домен &quot;Мониторинг и оценка&quot;состоит из 4-х процессов:&lt;/span&gt;&lt;/h3&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.25; margin-bottom: 4pt; margin-top: 4pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;- Мониторинг и оценка эффективности ИТ;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.25; margin-bottom: 4pt; margin-top: 4pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;- Мониторинг и оценка системы внутреннего контроля&lt;/span&gt;&lt;/h3&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.25; margin-bottom: 4pt; margin-top: 4pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;- Обеспечение соответствия внешним требованиям&lt;/span&gt;&lt;/h3&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.25; margin-bottom: 4pt; margin-top: 4pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;- Обеспечение корпоративного управления ИТ&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;color: black; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;  По COBIT &lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Мониторинг необходим для уверенности в том, что все делается правильно, в соответствии с принятыми направлениями и политиками.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Так как COBIT специализируется на контроле и аудите ИТ, то в отличии от ITIL, специализирующегося в основном на управлении ИТ, &amp;nbsp;для COBIT более важное значение имеют не События, а статистическая информация. Этот вид информации, который Мониторинг собирает и хранит в базе, позволяет руководству компании делать текущие выводы на основе исторических данных, принимать стратегические управленческие решения, прогнозировать затраты и эффективность информационных технологий для организации. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; font-weight: bold; line-height: 1.15; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; font-weight: bold; line-height: 1.15; white-space: pre-wrap;&quot;&gt;Какую систему мониторинга выбрать&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: black; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;  Когда ставится вопрос о системе мониторинга, то выбор стоит между системами с открытым программным обеспечением (Open Source Software) и &amp;nbsp;платным (требующим оплату за лицензии)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. В большинстве случаев выбор сводится к четырем вариантам. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Две системы c открытым исходным кодом:&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Nagios&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Zabbix&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  И две, требующие оплаты за использование ПО:&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;IBM Tivoli&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Verdana; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;HP Software (в прошлом HP OpenView)&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;  Платные системы мониторинга имеет смысл использовать, если есть наличие промышленных приложений уровня SAP, Oracle, возможность интеграции с системами поддержки и управления ИТ-услугами (ServiceDesk), системами управления бизнес-услугами &lt;/span&gt;&lt;span style=&quot;color: #1f1e1d; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(Business Service Management, BSM)&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, требование гарантированной технической поддержки от разработчиков данного программного обеспечения, а также возможность платить за лицензии.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Open Source системы мониторинга можно использовать в тех случаях, когда вы готовы своими силами дописывать скрипты для мониторинга каких-либо специфических метрик, нет необходимости в короткие сроки настроить мониторинг редких промышленных приложений, так как под них вы скорее всего не найдете готовых шаблонов, и придется их разрабатывать самостоятельно. А также у вас нет необходимости интеграции с ServisDesk, BSM, и в случае возникновения проблем с системой мониторинга вы готовы решать их самостоятельно.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; line-height: 1.15; white-space: pre-wrap;&quot;&gt;  Большой плюс систем мониторинга с открытым программным обеспечением в том, что, в принципе, вы можете самостоятельно настроить мониторинг практически любых метрик при возможности их получения каким-либо способом. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: 15px; line-height: 21px; white-space: pre-wrap;&quot;&gt;C уважением,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: 15px; line-height: 21px; white-space: pre-wrap;&quot;&gt;Андрей&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://itrm.ru/page/monitoring_i_upravlenie_it&quot; style=&quot;background-color: white; font-family: Verdana, Geneva, sans-serif; font-size: 13px; line-height: 15px; text-decoration: none;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;Компания ITRM&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/313273779091228563/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/313273779091228563' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/313273779091228563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/313273779091228563'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2013/06/blog-post.html' title='Мониторинг и управление ИТ'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/q_xVT3rYTYrKoqFt6zGuCb2FCJ4xJxnWBRdbIogHCu2AdFN5xHpJUEjE6ZzQCtrk70Q5qjRVGRIrZLQbPIGATS8rg8ImQhw4gCd_nF4Sbu5-DzDYcuBkWSsnEQ=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-4757088907617600505</id><published>2013-05-20T12:10:00.000+03:00</published><updated>2013-05-20T12:26:22.554+03:00</updated><title type='text'>Автоматизация мониторинга доступности динамического списка серверов и сетевых устройств в системе мониторинга Zabbix</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В
 вычислительных сетях с большим количеством устройств (например, сеть 
банкоматов или сетевых устройств) часто требуется мониторинг доступности
 узлов с возможностью сбора и графического отображения статистической 
информации по задержкам и потерям пакетов в канале до данных узлов. 
Иногда список устройств для которого требуется мониторинг доступности 
бывает динамическим, то есть может периодически меняться как сам список 
устройств, так и их ИП-адреса или названия.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В данной статье мы решили описать решение этой задачи при помощи системы мониторинга Zabbix.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В Zabbix-е начиная с версии 2.0 доступна новая функция: низкоуровневое обнаружение. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Низкоуровневое
 обнаружение предоставляет возможность автоматического создания 
элементов данных, триггеров и графиков для разных ресурсов на 
компьютере. Так, в дистрибутив включена возможность автоматического 
обнаружения сетевых интерфейсов и дисков на сервере. Рассмотрим, как ещё
 можно применять данную возможность.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Есть
 задача осуществлять мониторинг доступности серверов - порядка 200-300 
единиц. Допустим, что требуется раз в 2 минуты с серверов клиента 
проверять их доступность по сети, время отклика и потери пакетов. По 
всем параметрам должна собираться и графически отображаться статистика. 
При этом список серверов обновляется динамически в текстовом файле 
выглядящем следующим образом::&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;имя_сервера1 192.168.1.11&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;имя_сервера2 192.168.2.22&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;и т.д.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Для решения этой задачи удобно использовать низкоуровневое обнаружение. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Создаем
 скрипт, который будет запрашиваться с сервера, где работает система 
мониторинга Zabbix. Его результатом будет текст в формате json, который 
требуется для низкоуровневого обнаружения:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#!/usr/bin/perl&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;$latest_file=`ip.servers.lst`; &amp;nbsp;# Текстовый файл с динамическим списком узлов&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;print &quot;{\n&quot;;&lt;br class=&quot;kix-line-break&quot; /&gt;print &quot;\t\&quot;data\&quot;:[\n\n&quot;;&lt;br class=&quot;kix-line-break&quot; /&gt; &lt;br class=&quot;kix-line-break&quot; /&gt;for (`cat $latest_file`)&lt;br class=&quot;kix-line-break&quot; /&gt;{&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;($clname, $clip) = m/\S_(\S+) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/; # $clname - имя сервера, $clip - его IP-адрес&lt;br class=&quot;kix-line-break&quot; /&gt; &lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;\t{\n&quot;;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;\t\t\&quot;{#CLNAME}\&quot;:\&quot;$clname\&quot;,\n&quot;;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;\t\t\&quot;{#CLIP}\&quot;:\&quot;$clip\&quot;\n&quot;;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print &quot;\t},\n&quot;;&lt;br class=&quot;kix-line-break&quot; /&gt;}&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;print &quot;\t]\n&quot;; &lt;br class=&quot;kix-line-break&quot; /&gt;print &quot;}\n&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Вывод этого скрипта будет примерно таким:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;data&quot;:[&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;{#CLNAME}&quot;:&quot;server_name1&quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;{#CLIP}&quot;:&quot;192.168.1.11&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;{#CLNAME}&quot;:&quot;server_name2&quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;{#CLIP}&quot;:&quot;192.168.2.22&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Добавляем скрипт в конфигурацию агента Zabbix zabbix_agentd.conf &amp;nbsp;в разделе UserParameter:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;UserParameter=cl.discovery,/home/zabbix/cl.discovery.pl&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В
 web-интерфейсе Zabbix-сервера создаем правило “create discovery rule” 
(Рис. 1) для хоста, с которого осуществляется мониторинг серверов и 
сети:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Name discovery clients&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Type zabbix agent&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Key такой же, что указан в UserParameter (cl.discovery)&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Keep lost resources period (in days) 0 (если не хотим хранить информацию о серверах, которые не требуется мониторить)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img height=&quot;319px;&quot; src=&quot;https://lh4.googleusercontent.com/oA-9oqbGG_R2fuGs5wMUpCesE6zr6cbBU08I6XAFa8spK6xxqTtJ8xiCgV6uoQeHG9yZNAkUx02mIa38EZsEtCE-7TkPudH9G1UW_X9NqLwSHpQrQiyk70HG0g&quot; width=&quot;442px;&quot; /&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 1. Правило “create discovery rule”&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В разделе Item prototypes (Рис. 2) создаем прототипы требуемых элементов данных (create item prototype): &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Для времени отклика:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Name ICMP ping response time to {#CLNAME} {#CLIP}&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Type Zabbix trapper&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Key cl.icmppingsec[{#CLIP}]&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Type of information Numeric(float)&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Units ms&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;img height=&quot;223px;&quot; id=&quot;docs-internal-guid-41b9ac2a-c13d-bf24-1f54-22651cde621b&quot; src=&quot;https://lh3.googleusercontent.com/2n4vHV5bMamhiyXSp6i7hMXGzuqTZ4gTfjWc3CyiIE9GQwwPQVb6VWQv0Z14B6OGA7Vha2GswoQME40RlPyu5yCCVoaBsmILVKpzxoK5VFrS9j9GdfOTMAbcTw&quot; width=&quot;500px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 2. Раздел Item prototypes.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Для потерь пакетов:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ICMP ping percentage of loss packets {#CLNAME} {#CLIP}&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Type Zabbix trapper&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Key cl.icmppingloss[{#CLIP}]&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Type of information Numeric(float)&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Units %&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В
 разделе Graph prototypes (Рис. 3) создаем (create graph prototype) 
прототип графиков привязанные к созданным прототипаv элементов данных.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;img height=&quot;303px;&quot; src=&quot;https://lh5.googleusercontent.com/te52uG5QJmWL69ILMi1Stt2G4AbSIZ2Eh-_hz0Pu0cOEuf1DQmLgb7zL4B8y2ldvUsg9aHDzJUi8WkOxm4QHgm7zQ3w8ypcUV8UxLVQo98NRsRQuNj7AcPB5CQ&quot; width=&quot;690px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 3. Разделе Graph prototypes.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;В разделе Trigger prototypes создаём прототипы тригеров к созданным прототипам элементов данных.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Теперь
 при изменении списка с серверами в zabbix-сервере автоматически будут 
создаваться и удаляться соответствующие элементы данных и графики (Рис. 
4).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;img height=&quot;220px;&quot; src=&quot;https://lh6.googleusercontent.com/IfLH8-DFDwJzD-c2okHJ9Hv42tQKY-C3RkAcYybaMs8jOhhMp1-BEM_BKh1qhSmsKeoH5jEWjO71pa5wAqzTV_kqn6OTu39174F10n__ohP0iXd_Vp6EV6y9fg&quot; width=&quot;669px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Рисунок 4. Графики по задержкам и потерям пакетов в канале до определенного узла.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;br /&gt;
C уважением,&lt;br /&gt;
&lt;a href=&quot;http://itrm.ru/page/monitoring_i_upravlenie_it&quot;&gt;Компания ITRM&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/4757088907617600505/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/4757088907617600505' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/4757088907617600505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/4757088907617600505'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2013/05/zabbix.html' title='Автоматизация мониторинга доступности динамического списка серверов и сетевых устройств в системе мониторинга Zabbix'/><author><name>Rodion</name><uri>http://www.blogger.com/profile/15501389461148823459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh4.googleusercontent.com/oA-9oqbGG_R2fuGs5wMUpCesE6zr6cbBU08I6XAFa8spK6xxqTtJ8xiCgV6uoQeHG9yZNAkUx02mIa38EZsEtCE-7TkPudH9G1UW_X9NqLwSHpQrQiyk70HG0g=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-646821361943372677</id><published>2012-06-22T14:28:00.001+03:00</published><updated>2013-06-03T16:27:13.815+03:00</updated><title type='text'>Облачные вычисления</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b id=&quot;internal-source-marker_0.12739685620181262&quot; style=&quot;font-weight: normal; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Облачные вычисления&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Сейчас очень много говорят о вычислениях в “облаках”. Попробую высказать свою точку зрения на это. Если где-то ошибусь - буду рад, если меня поправят.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Во-первых, облачные вычисления - это не какая-то новая идея, и даже не новая технология. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Пользуюсь облачными сервисами уже больше 10 лет - это и электронная почта, онлайн-переводчик, сервисы создания и редактирования документов, онлайн-мониторинга и многое другое. Даже блог нашей компании создан и размещается в облаке.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Что касается технологий, то и тут нет ничего нового. Провайдеры предоставляющие облачные услуги используют известные уже давно технологии виртуализации: XEN, KVM, VirtualBox, VmWare.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Все это позволяет скептикам заявлять, что облака - это всего лишь очередной маркетинговый ход для продажи того же самого, но только в профиль, а энтузиастам заявлять о появлении в мире чего-то сверх нового.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Попробуем разобраться.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Немного истории. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;В самом начале развития информационных технологий доминировали майнфреймы (высокопроизводительные сервера). Еще до эпохи Интернета, чтобы воспользоваться вычислительными ресурсами майнфрейма, надо было заранее договориться о времени и физически присутствовать там, где находилось оборудование. Заранее - так как хоть это и мощный компьютер, но и он ограничен в вычислительных ресурсах. Но в тоже время с высокопроизводительным сервером могли работать одновременно несколько человек.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Плюсы майнфреймов были мощные вычислительные ресурсы, возможность одновременно обрабатывать несколько вычислительных задач, консолидация управления и технической поддержки.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Минусы - необходимость заранее договариваться о времени использования вычислительных ресурсов, физическое присутствие в том же месте, возможность использования только того программного обеспечения, которое разрешалось и могло использоваться на майнфрейме.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Со временем и развитием ИТ эта жесткая модель уступила место сперва персональным компьютерам, когда каждый человек мог позволить себе иметь дома свой небольшой вычислительный ресурс и иметь к нему доступ в любое удобное время. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Затем, с развитием вычислительных сетей появилась клиент-серверная архитектура, когда ИТ-приложения, требующие непрерывной работы и больших вычислительных ресурсов располагались на более мощных по сравнению с персональными компьютерами серверах, а люди со своих ПК подключались по каналам связи через различные интерфейсы к этим приложениям. При этом основные вычисления производились серверами, а человек через свой ПК только вводил данные и получал уже готовые результаты вычислений.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Вы спросите, какое это имеет отношение к облакам? Дело в том, что на мой взгляд, вычислительные облака - это то к чему привела сегодня эволюция ИТ-технологий и облачные технологии &amp;nbsp;содержат в себе компоненты предыдущих моделей, из которых они эволюционировали.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Облака - это возможность использования майнфреймов при помощи клиент-серверной архитектуры с большей эффективностью и удобством. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Этой возможности послужили три фактора. Перечислю их по мере значимости.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Первый и, по моему, основной - пропускная способность каналов связи за последние годы значительно возросла, стала стабильнее и дешевле. Это позволило выносить из частных сетей в публичные большие объемы информации с небольшими затратами, но еще важнее - иметь стабильный и скоростной доступ в любое время для работы с этой информацией.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Второй фактор - появились технологии виртуализации позволяющие просто и эффективно ограничивать ресурсы потребляемые пользователями, расширять и уменьшать их при необходимости. Причем этот фактор также повысил безопасность и SLA. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;И в третий - сами вычислительные ресурсы бысто растут при уменьшении стоимости на них и, например, сегодня обычный персональный компьютер по мощности можно сравнить с сервером 2-3 летней давности. Это позволило снизить стоимость владения и, соответственно, использования ресурсов супер-компьютеров для пользователей.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: transparent; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;И в заключении, мне хочется спрогнозировать пару важных &amp;nbsp;событий, которые произойдут, когда популярность облачных технологий достигнет своего пика - это переход на новую версию протокола IPv6 и освобождение большинства ИТ-специалистов от привязки к рабочему месту. &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 15px; white-space: pre-wrap;&quot;&gt;C уважением,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 15px; white-space: pre-wrap;&quot;&gt;Андрей&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;http://itrm.ru/&quot;&gt;&lt;b&gt;Компания ITRM&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/646821361943372677/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/646821361943372677' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/646821361943372677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/646821361943372677'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2012/06/blog-post.html' title='Облачные вычисления'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-4235477918851275157</id><published>2011-07-04T16:33:00.002+03:00</published><updated>2011-07-04T16:33:44.336+03:00</updated><title type='text'>SRV-записи для Jabber-сервера</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;MsgBodyText&quot;&gt;Настройки ДНС для Jabber-сервера:&lt;br /&gt;
&lt;br /&gt;
_xmpp-server._tcp.your_domain.ru. 3600 SRV 20 0 5269 jabber.your_domain.ru.&lt;br /&gt;
_xmpp-client._tcp.your_domain.ru. 3600  SRV 20 0 5222 jabber.your_domain.ru.&lt;br /&gt;
_jabber._tcp.your_domain.ru. 3600  SRV 20 1 5269 jabber.your_domain.ru.&lt;br /&gt;
&lt;br /&gt;
Данные SRV записи нужны для связи вашего jabber-сервера с другими, например gtalk.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/4235477918851275157/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/4235477918851275157' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/4235477918851275157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/4235477918851275157'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2011/07/srv-jabber.html' title='SRV-записи для Jabber-сервера'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-7835917089052249227</id><published>2010-06-16T14:52:00.002+03:00</published><updated>2010-06-16T14:55:29.669+03:00</updated><title type='text'>HP ANM - Automated Network Management</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;HP ANM&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Новый программный продукт от компании HP - Automated Network Management (HP ANM) представляет из себя интеграцию новой версии NNM - NNMi 9 с Network Automation (NA), а также с нескольких SPI:&lt;br /&gt;&lt;br /&gt;- iSPI Performance for Quality Assurance 9&lt;br /&gt;- iSPI Performance for Metrics 9&lt;br /&gt;- iSPI Performance for Traffic 9&lt;br /&gt;- iSPI NET&lt;br /&gt;&lt;br /&gt;В связке это предоставляет единую среду для мониторинга ошибок в сети и управления доступностью, анализа производительности и управления конфигурацией, а также диагностические возможности. Это обеспечивается за счет единого интерфейса.&lt;br /&gt;&lt;br /&gt;NNMi9 обеспечивает автоматический непрерывный поиск и обнаружение физических и виртуальных устройств, построение карты сети с дальнейшей возможностью экспорта карты в формат Visio, генерацию сообщений и прием трапов на основе правил, а также их корреляцию.&lt;br /&gt;&lt;br /&gt;В NA также присутствует возможность автоматического обнаружение физических и виртуальных сетевых устройств, помимо этого реализована возможность импорта устройств из NNMi9. NA автоматизирует изменения на тысячах устройств, а также передачу информации об изменениях в NNMi9, например SNMP community string. Автоматизирует операции с сетевыми устройствами, хранит конфигурацию устройств в базе и генерирует сообщения об изменениях в конфигурации на основе правил и политик.&lt;br /&gt;&lt;br /&gt;Перечисленные iSPI собирают статистическую информацию с сетевых устройств и сохраняют ее в базе данных, интегрируются с NNMi9. Это предоставляет единый интерфейс для просмотра и анализа статистики.</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/7835917089052249227/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/7835917089052249227' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/7835917089052249227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/7835917089052249227'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2010/06/hp-anm-automated-network-management.html' title='HP ANM - Automated Network Management'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-2634694649054153053</id><published>2009-12-16T13:12:00.009+02:00</published><updated>2009-12-16T17:28:14.206+02:00</updated><title type='text'>Jabber</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;font-family:&amp;quot;;font-size:180%;&quot;  &gt;Сети мгновенной передачи сообщений как средство связи в бизнесе.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;br /&gt;Помимо традиционных средств связи, таких как телефон, факс, электронная почта рассмотрим еще одно - посредством сетей мгновенной передачи сообщений.&lt;br /&gt;&lt;br /&gt;В последнее время набирает популярность открытый протокол XMPP (также известный как Jabber), в настоящее время используемый в таких сервисах как Я.Онлайн, Google Talk, LiveJournal.&lt;br /&gt;&lt;br /&gt;Помимо открытости протокола, Jabber имеет еще одно преимущество - при помощи шлюзов клиенты Jabber могут работать также с такими популярными сетями, как ICQ, MSN и др.&lt;br /&gt;&lt;br /&gt;Jabber по своей функции является чем-то средним между телефоном и электронной почтой. Когда проблема не столь срочна для звонка по телефону, но и ждать пару часов на ответ по электронной почте нет смысла.&lt;br /&gt;&lt;br /&gt;Взято отсюда:&lt;br /&gt;http://forum.itrm.ru/index.php?t=msg&amp;amp;th=178&amp;amp;start=0&amp;amp;rid=21&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/2634694649054153053/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/2634694649054153053' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/2634694649054153053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/2634694649054153053'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2009/12/jabber.html' title='Jabber'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-8801677070599457967</id><published>2009-05-23T21:32:00.008+03:00</published><updated>2009-05-29T15:48:55.733+03:00</updated><title type='text'>Резервное копирование (Backup)</title><content type='html'>&lt;p style=&quot;TEXT-ALIGN: left;font-family:arial;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В данной статье описывается система резервного копирования на основе программы с открытым исходным кодом - Bacula.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Общее описание системы и ее компонентов&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Общая схема системы бекапирования представлена на рис. 1.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В систему входят: директор (&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;Director&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;хранилище (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;Storage Daemon&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;клиент &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;(File Daemon), &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;каталог &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;(Catalog) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;и консоль (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;Console).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoM8Sza6Spe2N4KvWSopVm4WoLMtiaXvRotPJauo2EWZ5HXb_u-VLsDW76kWrCV8S3F8RNhtEhGeRuoCrQt9z90X-JC16CxioIV7xpY0f40A2zppp8Gp95bUHcpv4diuE2C8WwfCoMbpk/s1600-h/%D0%9A%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82%D1%8B+%D0%B1%D0%B0%D0%BA%D1%83%D0%BB%D0%B0.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5339096899839634386&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 262px; CURSOR: pointer; HEIGHT: 320px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoM8Sza6Spe2N4KvWSopVm4WoLMtiaXvRotPJauo2EWZ5HXb_u-VLsDW76kWrCV8S3F8RNhtEhGeRuoCrQt9z90X-JC16CxioIV7xpY0f40A2zppp8Gp95bUHcpv4diuE2C8WwfCoMbpk/s320/%D0%9A%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82%D1%8B+%D0%B1%D0%B0%D0%BA%D1%83%D0%BB%D0%B0.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Директор - это программа, которая курирует все операции резервного копирования и восстановления. Администратор использует директор для планирования бекапов и восстановления. &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;Консоль — это программа, которая позволяет администратору или пользователю подключаться к директору. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p lang=&quot;ru-RU&quot; align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Клиент — это программа, которая устанавливается на компьютере, которому требуется резервное копирование. Отвечает за сбор информации о бекапируемых файлах и передачи их атрибутов директору, а также отвечает за передачу данных в хранилище.&lt;/span&gt;&lt;/p&gt;&lt;p lang=&quot;ru-RU&quot; align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Хранилище представляет собой программу, которая обеспечивает хранение и восстановление данных, другими словами эта программа позволяет читать и записывать данные на физических носителях.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;ru-RU&quot;&gt;Каталог представляет собой программу для связывания файловых индексов с базой данных физических носителей для всех забекапленых файлов. Каталог позволяет администратору быстро найти и восстановить любой файл. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В качестве каталога может использоваться одна из трех баз данных &lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;MySQL, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;PostgreSQL и &lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;SQLite. &lt;/span&gt;В наше примере использована БД PostgreSQL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;Файлы конфигурации системы, запускаемые процессы. &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family:arial;font-size:100%;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZJ2qmZkh9pzlGWnK5HK4p7QL2OCJiWZWw5JyVudORSMIjU697RXxJJnbgEo-mhUShzFzQTon3ccteT17hDuPNFWNVgflYP15hSjJ7GMMtRDIlyWoCEoHsuLUIPFOQHxd63meAwNVeZ38/s1600-h/Bacula+%D0%BF%D1%80%D0%BE%D1%86%D0%B5%D1%81%D1%81%D1%8B.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5339099238311241458&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 231px; CURSOR: pointer; HEIGHT: 320px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZJ2qmZkh9pzlGWnK5HK4p7QL2OCJiWZWw5JyVudORSMIjU697RXxJJnbgEo-mhUShzFzQTon3ccteT17hDuPNFWNVgflYP15hSjJ7GMMtRDIlyWoCEoHsuLUIPFOQHxd63meAwNVeZ38/s320/Bacula+%D0%BF%D1%80%D0%BE%D1%86%D0%B5%D1%81%D1%81%D1%8B.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Директор - самый важный компонент. Он ведает всеми клиентами, сторожами, пулами (Pool), планирует (Schedule) и инициирует начало работ (Job), создает список файлов и каталогов для бекапирования (FileSet). Через директора осуществляется взаимодействие с каталогом. &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Основной конфигурационный файл — bacula-dir.conf. &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Основной конфиг делится на несколько секций:&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция &lt;b&gt;Director&lt;/b&gt; - описание директора. &lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Здесь задается имя директора, порт, который он будет слушать, задается пароль, для авторизации консолей. &lt;b&gt;WorkingDirectory&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt; назначает директорию для хранения бутстрапов (Bootstrap) работ.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция &lt;/u&gt;&lt;u&gt;&lt;b&gt;Storage&lt;/b&gt;&lt;/u&gt;&lt;u&gt; — секция подключения сторожей.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В секции описаны сторожи, где bacula может сохранять бекапы. Задаются имя сторожа, IP адрес или DNS-имя сервера со storage-демоном (SD), порт, пароль от демона, устройство (Device) который предоставляет для записи SD, тип устройства (File или Лента). &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция &lt;/u&gt;&lt;u&gt;&lt;b&gt;Pool&lt;/b&gt;&lt;/u&gt;&lt;u&gt; — описание пулов.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В этой секции проводится описание пулов. Пулы служат для управления томами (Volume). В этой секции описывается тип пула (Backup, Scratch, Migration), задается формат имени тома - LabelFormat, Volume Retention - время, в течении которого, том гарантировано не будет использован другими работами (данные не будут перезаписаны), после этого времени том освобождается для новых работ.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция &lt;b&gt;JobDefs&lt;/b&gt; - шаблоны работ.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В этой секции задаются значения по умолчанию, с которыми будет стартовать та или иная работа. Это существенно сокращает в дальнейшем описание опций самой работы. Здесь заданы имя шаблона, тип работы.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция &lt;/u&gt;&lt;u&gt;&lt;b&gt;Job&lt;/b&gt;&lt;/u&gt;&lt;u&gt; — описание работ.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В этой секции описывается: какого клиента бекапить и где сохранять бекапы, назначается расписание запуска ful- и incremental-бекапа, а также назначается fileset — список бекапируемых и не бекапируемых файлов. Для unix серверов стандартный fileset - /usr/local/bacula/etc/filelist/unix.conf, а для windows - /usr/local/bacula/etc/filelist/windows.conf. Так как работы в основном стандартные, то описание работы можно строить на основе шаблонов JobDefs.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция Messages — система отчетов.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Bacula ведет журнал всех выполняемых работ. Отчеты отсылаются по трем направлениям: консоль оператора, файл логов и электронная почта. Соответственно, в этой секции описывается какие сообщения отсылать на консоль оператора — console, какую информацию записывать в журнальный файл - append, на какой почтовый ящик отсылать email отчеты mail = &lt;a href=&quot;mailto:bacula-report@exmple.com&quot;&gt;bacula-report@exmple.com&lt;/a&gt;&lt;a href=&quot;mailto:bacula-mnt@rbc.ru&quot;&gt;. &lt;/a&gt;Команды отправки писем определяются директивами mailcommand и operatorcommand.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция Catalog.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Здесь даются параметры подключения к БД.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;Секция Client — клиенты bacula.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot; face=&quot;arial&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;В этой секции определяются параметры подключения к файловому демону (FD) клиента bacula. Задается IP адрес или DNS имя клиента, порт и пароль. Можно также поменять БД, в которой сохранять данные по файлам и работам этого клиента. Директивами File Retention и Job Retention задаются сроки хранения данных о файлах и работах клиента, соответственно. Bacula хранит информацию о всех работах, файлах и томах 15 дней.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;FONT-FAMILY: arial&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Управление директором осуществляется с помощью консоли &lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span lang=&quot;en-US&quot;&gt;- bconsole.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt; Существует также ряд GUI-консолей: bgnome-console, bwxconsole, а также BAT - &lt;em&gt;Bacula&lt;/em&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt; Administration Tool&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family:arial;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;FONT-FAMILY: arial&quot;&gt;&lt;/p&gt;&lt;p style=&quot;FONT-FAMILY: arial&quot; align=&quot;justify&quot;&gt;&lt;/p&gt;&lt;p style=&quot;FONT-FAMILY: arial&quot;&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/8801677070599457967/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/8801677070599457967' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/8801677070599457967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/8801677070599457967'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2009/05/blog-post.html' title='Резервное копирование (Backup)'/><author><name>rodion</name><uri>http://www.blogger.com/profile/14373628687144920096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoM8Sza6Spe2N4KvWSopVm4WoLMtiaXvRotPJauo2EWZ5HXb_u-VLsDW76kWrCV8S3F8RNhtEhGeRuoCrQt9z90X-JC16CxioIV7xpY0f40A2zppp8Gp95bUHcpv4diuE2C8WwfCoMbpk/s72-c/%D0%9A%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82%D1%8B+%D0%B1%D0%B0%D0%BA%D1%83%D0%BB%D0%B0.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-3116118729134766278</id><published>2009-05-08T16:22:00.004+03:00</published><updated>2009-05-29T15:49:45.186+03:00</updated><title type='text'>Network Automation (Автоматизируем работу в сети)</title><content type='html'>Network Automation&lt;br /&gt;&lt;br /&gt;Недавно познакомился с ПО для управления конфигурациями сетевых устройств - HP Network Automation, в сокращении NA. Попробую в кратце описать его назначение и возможности.&lt;br /&gt;&lt;br /&gt;NA предназначен для управления конфигурациями сетевых устройств. Основные возможности это:&lt;br /&gt;&lt;br /&gt;• Управление по протоколам: snmp, telnet, ssh, tftp, scp, rlogin&lt;br /&gt;• Создание инвентаризационной информации и активных карт сети&lt;br /&gt;• Отслеживание всех изменений и хранение истории изменений конфигурации&lt;br /&gt;• Одновременное конфигурирование сотен и тысяч устройств&lt;br /&gt;&lt;br /&gt;Задачи, решаемые при помощи NA:&lt;br /&gt;&lt;br /&gt;- Автоматизация большого объема задач и изменений используя шаблоны, а также автоматизация обновлений ПО при помощи анализа образа и рекомендаций по обновлению;&lt;br /&gt;- Определение кто и когда может произвести изменения;&lt;br /&gt;- Возможна автоматическая интеграция с системой диспетчерской службы для получения подтверждений и автоматическая сортировка и группировка событий и сбор дополнительных данных;&lt;br /&gt;- Проверка сложных изменений для исключения ошибок.</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/3116118729134766278/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/3116118729134766278' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/3116118729134766278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/3116118729134766278'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2009/05/network-automation-hp-network.html' title='Network Automation (Автоматизируем работу в сети)'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-1038057427443756170</id><published>2009-03-13T18:55:00.001+02:00</published><updated>2009-05-29T15:47:12.115+03:00</updated><title type='text'>Network Node Manager (ИТ мониторинг)</title><content type='html'>Настройка NNM для оповещения посредством электронной почты.&lt;br /&gt;&lt;br /&gt;В NNM нет встроенных средств для работы с электронной почтой, но есть возможность запуска программы либо скрипта при возникновении определенного события.&lt;br /&gt;&lt;br /&gt;Отсылать письма из операционной системы Windows можно несколькими способами, например при помощи скрипта, написанного на Perl, который инсталлируется вместе с дистрибутивом NNM. &lt;br /&gt;Рассмотрю способ оповещения по email при помощи утилиты blat, которую можно скачать с сайта www.blat.nеt. Сценарий отправки сообщения при помощи данной утилиты выглядет следующим образом:&lt;br /&gt;&lt;br /&gt;D:\&gt;type mail.bat&lt;br /&gt;&lt;br /&gt;&lt;p&gt;blat - -to admin@itrm.ru -s &quot;Node down&quot; -server mail.itrm.ru -f helpdesk@itrm.ru -body &quot; Node webforce.itrm.ru down &lt;/p&gt;&lt;p&gt; - ключ –to указывает, что будет в поле From в сообщении; -f – указывает, кому доставить сообщение; -server – адрес почтового relay.&lt;br /&gt;&lt;br /&gt;Настройка NNM состоит из 3 пунктов.&lt;br /&gt;&lt;br /&gt;1. Заходим в папку D:\Program Files\HP OpenView\conf\trustedCmds.conf и создаем простой файл:&lt;br /&gt;&lt;br /&gt;Directory of D:\Program Files\HP OpenView\conf\trustedCmds.conf&lt;br /&gt;&lt;br /&gt;11.03.2009 13:08 17 mail&lt;br /&gt;&lt;br /&gt;В котором прописываем строку:&lt;br /&gt;&lt;br /&gt;D:\Program Files\HP OpenView\conf\trustedCmds.conf&gt;type mail&lt;br /&gt;mail=D:\\mail.bat&lt;br /&gt;&lt;br /&gt;и сохраняем.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  2. Настраиваем событие, при возникновении которого мы бы хотели получить сообщение по email. Автоматическое действие можно настроить двумя путями: через редактирование файла trapd.conf, либо через контрольную панель NNM.&lt;br /&gt;В контрольной панели надо пройти по пути: Options -&gt; Event Configuration, выбираем событие и Edit -&gt; Events -&gt; Modify -&gt; Actions. В поле Command for Automatic Action прописываем:&lt;br /&gt;&lt;br /&gt;OVHIDESHELL mail &lt;br /&gt;&lt;br /&gt;где mail – это запись в файле D:\Program Files\HP OpenView\conf\trustedCmds.conf\mail. &lt;br /&gt;После этого все сохраняем.&lt;br /&gt;&lt;br /&gt;В файле trapd.conf появится запись:&lt;br /&gt;&lt;br /&gt;EVENT Event_3 .1.3.6.1.4.1.11.2.17.1.0.50790415 &quot;Problem Diagnosis Alarms&quot; Normal&lt;br /&gt;FORMAT Received event $E. $# args: $*&lt;br /&gt;EXEC OVHIDESHELL mail&lt;br /&gt;SDESC&lt;br /&gt;Add text to describe what this event means.&lt;br /&gt;EDESC&lt;br /&gt;&lt;br /&gt; И теперь при возникновении события Event_3 .1.3.6.1.4.1.11.2.17.1.0.50790415 на почтовый ящик helpdesk@itrm.ru будет приходить сообщение.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;C уважением, компания ITRM&lt;br /&gt;&lt;/p&gt;&lt;p&gt;http://itrm.ru&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/1038057427443756170/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/1038057427443756170' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/1038057427443756170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/1038057427443756170'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2009/03/network-node-manager.html' title='Network Node Manager (ИТ мониторинг)'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-6968389437725131836</id><published>2009-02-24T01:35:00.001+02:00</published><updated>2009-05-29T15:48:13.062+03:00</updated><title type='text'>IT Monitoring</title><content type='html'>&lt;p&gt;Функция мониторинга в системах управления ИТ-ресурсами.&lt;/p&gt;&lt;p&gt;Методы управления, рассматриваемые теорией управления техническими системами и другими объектами, базируются на трех фундаментальных принципах: принцип разомкнутого управления, принцип компенсации или точнее принцип упреждающего воздействия (кстати, на мой взгляд самый интеллектуальный и эффективный), принцип обратной связи.&lt;br /&gt;&lt;br /&gt;Наиболее часто используемый - это принцип обратной связи. Его смысл заключается в том, что мы отслеживаем состояние всех выходных параметров системы и передаем их по каналу обратной связи на вход системы, где далее на основе этих данных мы корректируем входящее воздействие.&lt;br /&gt;&lt;br /&gt;Управление присуще только системным объектам. Общим в процессах является его антиэнтропийный характер, направленность на упорядочение системы. &lt;br /&gt;Процесс управления можно разделить на несколько этапов:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Сбор и обработка информации. &lt;br /&gt;Анализ, систематизация, синтез. &lt;br /&gt;Постановка на этой основе целей. Выбор метода управления, прогноз. &lt;br /&gt;Внедрение выбранного метода управления. &lt;br /&gt;Оценка эффективности выбранного метода управления (обратная связь). &lt;br /&gt;Конечной целью теории управления является универсализация, а значит согласованность, оптимизация и наибольшая эффективность функционирования систем.&lt;br /&gt;&lt;br /&gt;Система управления ИТ-ресурсами состоит из следующих блоков-подсистем:&lt;br /&gt;&lt;br /&gt;Подсистема сервисного обслуживания &lt;br /&gt;Подсистема управления конфигурациями &lt;br /&gt;Подсистема управления хранением данных &lt;br /&gt;Подсистема мониторинга &lt;br /&gt;Подсистема информационной безопасности &lt;br /&gt;Мониторинг нам нужен именно для отслеживания состояния как можно большего числа параметров на выходе из системы. &lt;/p&gt;&lt;p&gt;Делаем вывод: Мониторинг в входит в состав системы управления ИТ-инфраструктурой и ИТ-сервисами. И его место - это обратная связь.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/6968389437725131836/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/6968389437725131836' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/6968389437725131836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/6968389437725131836'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2009/02/monitoring.html' title='IT Monitoring'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-978998669498567129.post-4254864197932494010</id><published>2008-12-16T19:01:00.001+02:00</published><updated>2009-04-11T09:51:54.284+03:00</updated><title type='text'>Мониторинг и управление. HP Operations</title><content type='html'>HP OpenView Operations for UNIX, если быть точными.&lt;br /&gt;&lt;br /&gt;Кто первый придумал сервис-ориентированную модель мониторинга не знаю, но впервые я с этой концепцией познакомился при работе с HP Openview.&lt;br /&gt;&lt;br /&gt;Установка самого юниксового Operations - это отдельный разговор. Рассмотрю в данной статье установку агента Operations на сервер с WinXP.&lt;br /&gt;OVOU установленный на HP-UX содержит следующие папки:&lt;br /&gt;&lt;br /&gt;# pwd&lt;br /&gt;/var/opt/OV/share/databases/OpC/mgd_node/vendor/ms/x86/winnt&lt;br /&gt;# ls&lt;br /&gt;A.08.10.160 AgentPlatform req.dat require.dat&lt;br /&gt;&lt;br /&gt;A.08.10.160 - это и есть агент Operations для MS Windows. Я вошел в папку x86/winnt, так как мне нужен был агент под патформу x86, а версия MSW у меня XP.&lt;br /&gt;&lt;br /&gt;Конечно, агенты можно установить из консоли самого Operations, но в данной статье я рассмотрю вариант установки пошагово вручную.&lt;br /&gt;Закачиваем всю папку с агентом A.08.10.160 на WinXP, заходим в эту папку с помощью консоли DOS и выполняем команду:&lt;br /&gt;&lt;br /&gt;C:\openview\OVO\x86\winnt\A.08.10.160\RPC_BBC&gt;cscript opc_inst.vbs -srv ovosrv&lt;br /&gt;&lt;br /&gt;где ovosrv - это название сервера Operations в ДНС.&lt;br /&gt;&lt;br /&gt;После того как инсталлируется агент запускаем:&lt;br /&gt;&lt;br /&gt;ovcert -certreq&lt;br /&gt;&lt;br /&gt;Эта команда пошлет запрос на сертификат серверу OVO.&lt;br /&gt;&lt;br /&gt;Заодно можно проверить работу агента командой:&lt;br /&gt;&lt;br /&gt;C:\Program Files\HP\HP BTO Software\bin&gt;&lt;br /&gt;ovcovcd OV Control CORE (3140) Running&lt;br /&gt;coda OV Performance Core COREXT (2156) Running&lt;br /&gt;opcacta OVO Action Agent AGENT,EA (3748) Running&lt;br /&gt;ovbbccb OV Communication Broker CORE (480) Running&lt;br /&gt;opcmsgi OVO Message Interceptor AGENT,EA (2836) Running&lt;br /&gt;opcmsga OVO Message Agent AGENT,EA (3760) Running&lt;br /&gt;ovconfd OV Config and Deploy COREXT (2728) Running&lt;br /&gt;&lt;br /&gt;Далее на сервере Оperations выполняем:&lt;br /&gt;&lt;br /&gt;# opccsa -list_pending_cr&lt;br /&gt;Hostname Request ID Mapped Host ------------------------------------------------------------------------------------------------&lt;br /&gt;winxp-host b59gf272-26eb-7534-1d88-c096f5189be5 winxp-host&lt;br /&gt;&lt;br /&gt;# opccsa -grant b59gf272-26eb-7534-1d88-c096f5189be5&lt;br /&gt;&lt;br /&gt;И проверяем на сервере работу агента:&lt;br /&gt;&lt;br /&gt;# /opt/OV/bin/OpC/call_sqlplus.sh cert_state&lt;br /&gt;OVO Report ----------&lt;br /&gt;Report Date: 11-2008&lt;br /&gt;Report Time: 17:16:20&lt;br /&gt;Report Definition:&lt;br /&gt;User: opc_adm Report Name: Certificate State Report Rpt. Script: /etc/opt/OV/share/conf/OpC/mgmt_sv/reports/C/cert_state.sql&lt;br /&gt;Node Certificate Inst&lt;br /&gt;------------------------------------ ------------------------------------ ----&lt;br /&gt;winxp-host 259467ca-9a5e-7529-174f-f66389ab5f1f YES&lt;br /&gt;&lt;br /&gt;И еще можно так проверить:&lt;br /&gt;&lt;br /&gt;# opcragt -status winxp-host&lt;br /&gt;Node winxp-host:&lt;br /&gt;OVO Managed Node status :&lt;br /&gt;-------------------------&lt;br /&gt;OV Control ovcd (3140) is running&lt;br /&gt;OV Performance Core coda (2156) is running&lt;br /&gt;OV Communication Broker ovbbccb (480) is running&lt;br /&gt;OV Config and Deploy ovconfd (2728) is running&lt;br /&gt;Subagent EA:Action Agent opcacta (3748) is running&lt;br /&gt;Message Interceptor opcmsgi (2836) is running&lt;br /&gt;Message Agent opcmsga (3760) is running&lt;br /&gt;Done.&lt;br /&gt;&lt;br /&gt;И еще вот так:&lt;br /&gt;&lt;br /&gt;/opt/OV/bin/OpC/install/opcdeploy -node winxp-host -cmd &quot;dir&quot;&lt;br /&gt;C . : 4CBD-F33F&lt;br /&gt;&lt;br /&gt;C:\Documents and Settings\All Users\Application Data\HP\HP BTO Software\installation\incoming\files&lt;br /&gt;&lt;br /&gt;C уважением, exist&lt;br /&gt;Компания ITRM</content><link rel='replies' type='application/atom+xml' href='http://blog.itrm.ru/feeds/4254864197932494010/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/978998669498567129/4254864197932494010' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/4254864197932494010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/978998669498567129/posts/default/4254864197932494010'/><link rel='alternate' type='text/html' href='http://blog.itrm.ru/2008/12/hp-operations.html' title='Мониторинг и управление. HP Operations'/><author><name>exist</name><uri>http://www.blogger.com/profile/06940722863894731587</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>