Commit 30d336d6 by 刘航

完善zabbix部署文档

1 parent 64dd4f5c
...@@ -322,4 +322,5 @@ if __name__ == "__main__": ...@@ -322,4 +322,5 @@ if __name__ == "__main__":
for i in range(intstart,intend+1): for i in range(intstart,intend+1):
hostip = "{}.{}".format(ipbase,i) hostip = "{}.{}".format(ipbase,i)
print(hostip) print(hostip)
test.host_create( hostip,hostip,hostip, hostgroup, proxyname, template1, template2) hostname = proxyname+'_'+hostip
test.host_create( hostname,hostname,hostip, hostgroup, proxyname, template1, template2)
zabbix监测系统 zabbix监测系统
=============== ===============
安装 服务端安装
-------------------------------- --------------------------------
使用docker安装/运行方式(建议使用此方式) 使用docker安装/运行方式(建议使用此方式)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
离线安装包: smb://192.168.9.1/公共模块/繁星/繁星二代/自检系统/(zabbix_agent_proxy_tx1、zabbix_docker) 离线安装包: smb://192.168.9.1/公共模块/繁星/繁星二代/自检系统/zabbix_docker .
有docker离线包zabbix_docker,拷贝到有docker的主机上,加载镜像: 镜像加载
::::::::::::::::::::::::::
有docker离线包zabbix_docker,拷贝到有docker的主机上,加载镜像:
.. code-block:: shell .. code-block:: shell
...@@ -32,6 +35,20 @@ zabbix监测系统 ...@@ -32,6 +35,20 @@ zabbix监测系统
zabbix/zabbix-server-pgsql ubuntu-3.4.13 af4434f6332b 4 weeks ago 224 MB zabbix/zabbix-server-pgsql ubuntu-3.4.13 af4434f6332b 4 weeks ago 224 MB
postgres 9.6 4023a747a01a 20 months ago 265 MB postgres 9.6 4023a747a01a 20 months ago 265 MB
postgres数据库客户端安装
::::::::::::::::::::::::::::::::::::::::::::::
离线包里有libpq5_9.5.23-0ubuntu0.16.04.1_amd64.deb postgresql-client-9.5_9.5.23-0ubuntu0.16.04.1_amd64.deb
.. code-block:: shell
dpkg -i ./*.deb
运行docker,创建数据库
::::::::::::::::::::::::::::::::
本地安装/运行方式(坑多) 本地安装/运行方式(坑多)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
...@@ -77,8 +94,61 @@ sudo cp -r zabbix-3.4.13/frontends/php/ /var/www/html/zabbix ...@@ -77,8 +94,61 @@ sudo cp -r zabbix-3.4.13/frontends/php/ /var/www/html/zabbix
server主动获取,在zabbix_agent.conf增加的item的type是Zabbix trapper server主动获取,在zabbix_agent.conf增加的item的type是Zabbix trapper
配置
---------------------------- 节点端安装
---------------------------
离线安装包: smb://192.168.9.1/公共模块/繁星/繁星二代/自检系统/tx1_离线包/watchmen_tx1.tar.gz
主节点安装
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.. code-block:: shell
tar zxvf watchmen_tx1.tar.gz
cd watchmen_tx1
./watchmen_install_tx1.sh master
# --server_ip平台ip。 --zabbix_proxy_name代理名称,必须和web上创建的一致
./watchmen_config_tx1.sh --server_ip=192.168.9.62 --zabbix_proxy_name=190master
子节点安装
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
确保主节点已安装了ansible
假如当前主节点管理的子节点组命名tx2
.. code-block:: shell
ansible -b tx2 -m copy -a "src=watchmen_tx1.tar.gz dest=/root/UserApp/"
ansible -b tx2 -m raw -a "cd /root/UserApp/; tar zxvf watchmen_tx1.tar.gz; cd watchmen_tx1; ./watchmen_install_tx1.sh slave"
进入web配置
>>>>>>>>>>>>>>>>>>>>>>>>>
1. 导入模版(参考使用章节)
2. 添加代理(参考使用章节)
每个主节点都需要添加代理
使用脚本添加host
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.. code-block:: shell
# --baseurl zabbix web地址
# --ipstart 批量ip开始
# --ipsend 批量ip结束
# --hostgroup 在zabbix创建的group名。如果没有特殊要求填写starnet_tx1_slave_group
# --proxyname 代理名称,必须和web添加的代理名一致
# --template1模版名,监控项都在模版里
# 下面的命令会添加192.168.8.2/3/4/5/6 五个子节点
python2 zabbix_addhost.py --baseurl=http://192.168.9.62:9210 --ipstart=192.168.8.2 --ipend=192.168.8.6 --hostgroup=starnet_tx1_slave_group --proxyname=190master --template1=starnet_tx1_slave_tp
手动配置(前面安装章节已包含自动化配置,没有特殊需求可略过本章节)
------------------------------------------------------------------------------
zabbix_agent配置 zabbix_agent配置
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
<li class="toctree-l1"><a class="reference internal" href="20-ansible.html">2. ansible集群管理工具</a></li> <li class="toctree-l1"><a class="reference internal" href="20-ansible.html">2. ansible集群管理工具</a></li>
<li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li> <li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li> <li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">5. 修订历史</a></li> <li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li>
</ul> </ul>
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li> <li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li> <li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html#item">5. 动态item</a></li> <li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li> <li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li>
</ul> </ul>
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li> <li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html#item">5. 动态item</a></li> <li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li> <li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li>
</ul> </ul>
......
...@@ -88,41 +88,54 @@ ...@@ -88,41 +88,54 @@
<li class="toctree-l1"><a class="reference internal" href="20-ansible.html">2. ansible集群管理工具</a></li> <li class="toctree-l1"><a class="reference internal" href="20-ansible.html">2. ansible集群管理工具</a></li>
<li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li> <li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">4. zabbix监测系统</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">4. zabbix监测系统</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">4.1. 安装</a><ul> <li class="toctree-l2"><a class="reference internal" href="#id1">4.1. 服务端安装</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#docker">4.1.1. 使用docker安装/运行方式(建议使用此方式)</a></li> <li class="toctree-l3"><a class="reference internal" href="#docker">4.1.1. 使用docker安装/运行方式(建议使用此方式)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">4.1.2. 本地安装/运行方式(坑多)</a></li> <li class="toctree-l4"><a class="reference internal" href="#id2">4.1.1.1. 镜像加载</a></li>
<li class="toctree-l4"><a class="reference internal" href="#postgres">4.1.1.2. postgres数据库客户端安装</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">4.1.1.3. 运行docker,创建数据库</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#id5">4.2. 配置</a><ul> <li class="toctree-l3"><a class="reference internal" href="#id4">4.1.2. 本地安装/运行方式(坑多)</a></li>
<li class="toctree-l3"><a class="reference internal" href="#zabbix-agent">4.2.1. zabbix_agent配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="#zabbix-proxy">4.2.2. zabbix_proxy配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="#zabbix-server">4.2.3. zabbix_server配置</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#id6">4.3. 使用</a><ul> <li class="toctree-l2"><a class="reference internal" href="#id7">4.2. 节点端安装</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#quick-start">4.3.1. quick start</a></li> <li class="toctree-l3"><a class="reference internal" href="#id8">4.2.1. 主节点安装</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id7">4.3.2. 模板</a></li> <li class="toctree-l3"><a class="reference internal" href="#id9">4.2.2. 子节点安装</a></li>
<li class="toctree-l3"><a class="reference internal" href="#web">4.2.3. 进入web配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="#host">4.2.4. 使用脚本添加host</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#id8">4.4. 自定义监测项</a><ul> <li class="toctree-l2"><a class="reference internal" href="#id10">4.3. 手动配置(前面安装章节已包含自动化配置,没有特殊需求可略过本章节)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id9">4.4.1. 繁星增加自定义监测项典型流程</a></li> <li class="toctree-l3"><a class="reference internal" href="#zabbix-agent">4.3.1. zabbix_agent配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="#vproc">4.4.2. vproc</a></li> <li class="toctree-l3"><a class="reference internal" href="#zabbix-proxy">4.3.2. zabbix_proxy配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="#zabbix-server">4.3.3. zabbix_server配置</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#id10">4.5. 自定义监测项列表</a><ul> <li class="toctree-l2"><a class="reference internal" href="#id11">4.4. 使用</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#vaserver">4.5.1. VAServer</a></li> <li class="toctree-l3"><a class="reference internal" href="#quick-start">4.4.1. quick start</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id12">4.4.2. 模板</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#item">4.6. 动态item</a><ul> <li class="toctree-l2"><a class="reference internal" href="#id13">4.5. 自定义监测项</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id11">4.6.1. 概述</a></li> <li class="toctree-l3"><a class="reference internal" href="#id14">4.5.1. 繁星增加自定义监测项典型流程</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id14">4.6.2. 操作教程</a><ul> <li class="toctree-l3"><a class="reference internal" href="#vproc">4.5.2. vproc</a></li>
<li class="toctree-l4"><a class="reference internal" href="#web">4.6.2.1. web上的配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id15">4.6.2.2. 设备上配置文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id16">4.6.2.3. 运作流程简述</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#id15">4.6. 自定义监测项列表</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#vaserver">4.6.1. VAServer</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#item">4.7. 动态item</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id16">4.7.1. 概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id19">4.7.2. 操作教程</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id20">4.7.2.1. web上的配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id21">4.7.2.2. 设备上配置文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id22">4.7.2.3. 运作流程简述</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id23">4.8. 监控docker</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li> <li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li>
...@@ -194,11 +207,13 @@ ...@@ -194,11 +207,13 @@
<div class="section" id="zabbix"> <div class="section" id="zabbix">
<h1>4. zabbix监测系统<a class="headerlink" href="#zabbix" title="Permalink to this headline"></a></h1> <h1>4. zabbix监测系统<a class="headerlink" href="#zabbix" title="Permalink to this headline"></a></h1>
<div class="section" id="id1"> <div class="section" id="id1">
<h2>4.1. 安装<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2> <h2>4.1. 服务端安装<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<div class="section" id="docker"> <div class="section" id="docker">
<h3>4.1.1. 使用docker安装/运行方式(建议使用此方式)<a class="headerlink" href="#docker" title="Permalink to this headline"></a></h3> <h3>4.1.1. 使用docker安装/运行方式(建议使用此方式)<a class="headerlink" href="#docker" title="Permalink to this headline"></a></h3>
<p>离线安装包: <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/(zabbix_agent_proxy_tx1、zabbix_docker)</p> <p>离线安装包: <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/zabbix_docker .</p>
<p>有docker离线包zabbix_docker,拷贝到有docker的主机上,加载镜像:</p> <div class="section" id="id2">
<h4>4.1.1.1. 镜像加载<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h4>
<p>有docker离线包zabbix_docker,拷贝到有docker的主机上,加载镜像:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>docker load &lt; postgres9.6.docker.images <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>docker load &lt; postgres9.6.docker.images
<span class="c1"># 屏幕会返回镜像的id,假设是:id-1</span> <span class="c1"># 屏幕会返回镜像的id,假设是:id-1</span>
<span class="c1"># 给镜像命名</span> <span class="c1"># 给镜像命名</span>
...@@ -220,9 +235,20 @@ postgres <span class="m">9</span>.6 4023a ...@@ -220,9 +235,20 @@ postgres <span class="m">9</span>.6 4023a
</pre></div> </pre></div>
</div> </div>
</div> </div>
<div class="section" id="id2"> <div class="section" id="postgres">
<h3>4.1.2. 本地安装/运行方式(坑多)<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3> <h4>4.1.1.2. postgres数据库客户端安装<a class="headerlink" href="#postgres" title="Permalink to this headline"></a></h4>
<p><a href="#id3"><span class="problematic" id="id4">**</span></a>此方法不同的机器上可能遇到不同的问题,下面的说明只能作为参考。 **</p> <p>离线包里有libpq5_9.5.23-0ubuntu0.16.04.1_amd64.deb postgresql-client-9.5_9.5.23-0ubuntu0.16.04.1_amd64.deb</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>dpkg -i ./*.deb
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h4>4.1.1.3. 运行docker,创建数据库<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h4>
</div>
</div>
<div class="section" id="id4">
<h3>4.1.2. 本地安装/运行方式(坑多)<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h3>
<p><a href="#id5"><span class="problematic" id="id6">**</span></a>此方法不同的机器上可能遇到不同的问题,下面的说明只能作为参考。 **</p>
<p>我用网上说的apt-get方式装,无法成功。web界面使用不正常,所以采用源码方式装。zabbix-3.4.13.tar.gz</p> <p>我用网上说的apt-get方式装,无法成功。web界面使用不正常,所以采用源码方式装。zabbix-3.4.13.tar.gz</p>
<p>环境依赖安装按照以下步骤: <p>环境依赖安装按照以下步骤:
<a class="reference external" href="https://blog.csdn.net/yannanxiu/article/details/54924198">https://blog.csdn.net/yannanxiu/article/details/54924198</a></p> <a class="reference external" href="https://blog.csdn.net/yannanxiu/article/details/54924198">https://blog.csdn.net/yannanxiu/article/details/54924198</a></p>
...@@ -252,10 +278,54 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -252,10 +278,54 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
<p>server主动获取,在zabbix_agent.conf增加的item的type是Zabbix trapper</p> <p>server主动获取,在zabbix_agent.conf增加的item的type是Zabbix trapper</p>
</div> </div>
</div> </div>
<div class="section" id="id5"> <div class="section" id="id7">
<h2>4.2. 配置<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h2> <h2>4.2. 节点端安装<a class="headerlink" href="#id7" title="Permalink to this headline"></a></h2>
<p>离线安装包: <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/tx1_离线包/watchmen_tx1.tar.gz</p>
<div class="section" id="id8">
<h3>4.2.1. 主节点安装<a class="headerlink" href="#id8" title="Permalink to this headline"></a></h3>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>tar zxvf watchmen_tx1.tar.gz
<span class="nb">cd</span> watchmen_tx1
./watchmen_install_tx1.sh master
<span class="c1"># --server_ip平台ip。 --zabbix_proxy_name代理名称,必须和web上创建的一致</span>
./watchmen_config_tx1.sh --server_ip<span class="o">=</span><span class="m">192</span>.168.9.62 --zabbix_proxy_name<span class="o">=</span>190master
</pre></div>
</div>
</div>
<div class="section" id="id9">
<h3>4.2.2. 子节点安装<a class="headerlink" href="#id9" title="Permalink to this headline"></a></h3>
<p>确保主节点已安装了ansible</p>
<p>假如当前主节点管理的子节点组命名tx2</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>ansible -b tx2 -m copy -a <span class="s2">&quot;src=watchmen_tx1.tar.gz dest=/root/UserApp/&quot;</span>
ansible -b tx2 -m raw -a <span class="s2">&quot;cd /root/UserApp/; tar zxvf watchmen_tx1.tar.gz; cd watchmen_tx1; ./watchmen_install_tx1.sh slave&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="web">
<h3>4.2.3. 进入web配置<a class="headerlink" href="#web" title="Permalink to this headline"></a></h3>
<ol class="arabic simple">
<li>导入模版(参考使用章节)</li>
<li>添加代理(参考使用章节)</li>
</ol>
<p>每个主节点都需要添加代理</p>
</div>
<div class="section" id="host">
<h3>4.2.4. 使用脚本添加host<a class="headerlink" href="#host" title="Permalink to this headline"></a></h3>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># --baseurl zabbix web地址</span>
<span class="c1"># --ipstart 批量ip开始</span>
<span class="c1"># --ipsend 批量ip结束</span>
<span class="c1"># --hostgroup 在zabbix创建的group名。如果没有特殊要求填写starnet_tx1_slave_group</span>
<span class="c1"># --proxyname 代理名称,必须和web添加的代理名一致</span>
<span class="c1"># --template1模版名,监控项都在模版里</span>
<span class="c1"># 下面的命令会添加192.168.8.2/3/4/5/6 五个子节点</span>
python2 zabbix_addhost.py --baseurl<span class="o">=</span>http://192.168.9.62:9210 --ipstart<span class="o">=</span><span class="m">192</span>.168.8.2 --ipend<span class="o">=</span><span class="m">192</span>.168.8.6 --hostgroup<span class="o">=</span>starnet_tx1_slave_group --proxyname<span class="o">=</span>190master --template1<span class="o">=</span>starnet_tx1_slave_tp
</pre></div>
</div>
</div>
</div>
<div class="section" id="id10">
<h2>4.3. 手动配置(前面安装章节已包含自动化配置,没有特殊需求可略过本章节)<a class="headerlink" href="#id10" title="Permalink to this headline"></a></h2>
<div class="section" id="zabbix-agent"> <div class="section" id="zabbix-agent">
<h3>4.2.1. zabbix_agent配置<a class="headerlink" href="#zabbix-agent" title="Permalink to this headline"></a></h3> <h3>4.3.1. zabbix_agent配置<a class="headerlink" href="#zabbix-agent" title="Permalink to this headline"></a></h3>
<p><strong>需要在系统配置开机启动</strong></p> <p><strong>需要在系统配置开机启动</strong></p>
<p>zabbix_agentd安装包是在tx1上编译的。zabbix_agent_proxy_tx1的install.sh会将配置文件拷贝到 <p>zabbix_agentd安装包是在tx1上编译的。zabbix_agent_proxy_tx1的install.sh会将配置文件拷贝到
/usr/local/etc/zabbix_agent.conf</p> /usr/local/etc/zabbix_agent.conf</p>
...@@ -271,7 +341,7 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -271,7 +341,7 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
<p>修改完重启进程</p> <p>修改完重启进程</p>
</div> </div>
<div class="section" id="zabbix-proxy"> <div class="section" id="zabbix-proxy">
<h3>4.2.2. zabbix_proxy配置<a class="headerlink" href="#zabbix-proxy" title="Permalink to this headline"></a></h3> <h3>4.3.2. zabbix_proxy配置<a class="headerlink" href="#zabbix-proxy" title="Permalink to this headline"></a></h3>
<p><strong>需要在系统配置开机启动</strong></p> <p><strong>需要在系统配置开机启动</strong></p>
<p>zabbix_proxy安装包是在tx1上编译的。zabbix_agent_proxy_tx1的install.sh会将配置文件拷贝到 <p>zabbix_proxy安装包是在tx1上编译的。zabbix_agent_proxy_tx1的install.sh会将配置文件拷贝到
/usr/local/etc/zabbix_proxy.conf</p> /usr/local/etc/zabbix_proxy.conf</p>
...@@ -289,17 +359,17 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -289,17 +359,17 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
</div> </div>
</div> </div>
<div class="section" id="zabbix-server"> <div class="section" id="zabbix-server">
<h3>4.2.3. zabbix_server配置<a class="headerlink" href="#zabbix-server" title="Permalink to this headline"></a></h3> <h3>4.3.3. zabbix_server配置<a class="headerlink" href="#zabbix-server" title="Permalink to this headline"></a></h3>
<p><strong>需要在系统配置开机启动</strong></p> <p><strong>需要在系统配置开机启动</strong></p>
<p>zabbix_server在docker运行,在每次启动容器的时候会将必要参数传入,zabbix_docker/dockerrun_zabbix.sh已写好,运行即可</p> <p>zabbix_server在docker运行,在每次启动容器的时候会将必要参数传入,zabbix_docker/dockerrun_zabbix.sh已写好,运行即可</p>
</div> </div>
</div> </div>
<div class="section" id="id6"> <div class="section" id="id11">
<h2>4.3. 使用<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h2> <h2>4.4. 使用<a class="headerlink" href="#id11" title="Permalink to this headline"></a></h2>
<p>访问路径: <a class="reference external" href="http://ip:9210">http://ip:9210</a></p> <p>访问路径: <a class="reference external" href="http://ip:9210">http://ip:9210</a></p>
<p>第一次运行会有一些额外步骤,按照提示下一步即可</p> <p>第一次运行会有一些额外步骤,按照提示下一步即可</p>
<div class="section" id="quick-start"> <div class="section" id="quick-start">
<h3>4.3.1. quick start<a class="headerlink" href="#quick-start" title="Permalink to this headline"></a></h3> <h3>4.4.1. quick start<a class="headerlink" href="#quick-start" title="Permalink to this headline"></a></h3>
<p>添加proxy,注意Proxy name必须和 zabbix_proxy配置中的Hostname相同。其他配置默认即可。点add添加成功</p> <p>添加proxy,注意Proxy name必须和 zabbix_proxy配置中的Hostname相同。其他配置默认即可。点add添加成功</p>
<img alt="_images/zabbix-01.png" src="_images/zabbix-01.png" /> <img alt="_images/zabbix-01.png" src="_images/zabbix-01.png" />
<p>添加host,Configuration-&gt;Hosts-&gt;Create host</p> <p>添加host,Configuration-&gt;Hosts-&gt;Create host</p>
...@@ -318,13 +388,13 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -318,13 +388,13 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
<img alt="_images/zabbix-07.png" src="_images/zabbix-07.png" /> <img alt="_images/zabbix-07.png" src="_images/zabbix-07.png" />
<p>这是最基本的使用,后续添加如何自定义监测项,利用api批量添加主机、动态管理监测项等功能。</p> <p>这是最基本的使用,后续添加如何自定义监测项,利用api批量添加主机、动态管理监测项等功能。</p>
</div> </div>
<div class="section" id="id7"> <div class="section" id="id12">
<h3>4.3.2. 模板<a class="headerlink" href="#id7" title="Permalink to this headline"></a></h3> <h3>4.4.2. 模板<a class="headerlink" href="#id12" title="Permalink to this headline"></a></h3>
<p>繁星2代模板已放在sdv上 <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/zabbix_template</p> <p>繁星2代模板已放在sdv上 <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/zabbix_template</p>
</div> </div>
</div> </div>
<div class="section" id="id8"> <div class="section" id="id13">
<h2>4.4. 自定义监测项<a class="headerlink" href="#id8" title="Permalink to this headline"></a></h2> <h2>4.5. 自定义监测项<a class="headerlink" href="#id13" title="Permalink to this headline"></a></h2>
<p>zabbix的监测项有两种:</p> <p>zabbix的监测项有两种:</p>
<ol class="arabic simple"> <ol class="arabic simple">
<li>上报型</li> <li>上报型</li>
...@@ -341,8 +411,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -341,8 +411,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
<li>应用程序写状态的操作与zabbix解耦。即使没有zabbix,我们在调试程序时也可以使用vproc,可以用命令行查询检测项的值。有助于调试</li> <li>应用程序写状态的操作与zabbix解耦。即使没有zabbix,我们在调试程序时也可以使用vproc,可以用命令行查询检测项的值。有助于调试</li>
</ul> </ul>
<p>vproc后面章节有详细介绍</p> <p>vproc后面章节有详细介绍</p>
<div class="section" id="id9"> <div class="section" id="id14">
<h3>4.4.1. 繁星增加自定义监测项典型流程<a class="headerlink" href="#id9" title="Permalink to this headline"></a></h3> <h3>4.5.1. 繁星增加自定义监测项典型流程<a class="headerlink" href="#id14" title="Permalink to this headline"></a></h3>
<p>细节可以自行百度“zabbix增加自定义item”</p> <p>细节可以自行百度“zabbix增加自定义item”</p>
<p>界面上操作可参考:<a class="reference external" href="https://blog.csdn.net/u012062455/article/details/53257059">https://blog.csdn.net/u012062455/article/details/53257059</a></p> <p>界面上操作可参考:<a class="reference external" href="https://blog.csdn.net/u012062455/article/details/53257059">https://blog.csdn.net/u012062455/article/details/53257059</a></p>
<p>zabbix_agentd端操作可参考:<a class="reference external" href="https://www.cnblogs.com/mingerlcm/p/7754076.html">https://www.cnblogs.com/mingerlcm/p/7754076.html</a></p> <p>zabbix_agentd端操作可参考:<a class="reference external" href="https://www.cnblogs.com/mingerlcm/p/7754076.html">https://www.cnblogs.com/mingerlcm/p/7754076.html</a></p>
...@@ -382,7 +452,7 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -382,7 +452,7 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
</ol> </ol>
</div> </div>
<div class="section" id="vproc"> <div class="section" id="vproc">
<h3>4.4.2. vproc<a class="headerlink" href="#vproc" title="Permalink to this headline"></a></h3> <h3>4.5.2. vproc<a class="headerlink" href="#vproc" title="Permalink to this headline"></a></h3>
<p>vproc是python编写的工具</p> <p>vproc是python编写的工具</p>
<p>类似linux proc系统,应用程序调用vproc脚本将监测项状态值持续更新到指定文件中。外部可读取文件值,得知应用程序的运行情况。</p> <p>类似linux proc系统,应用程序调用vproc脚本将监测项状态值持续更新到指定文件中。外部可读取文件值,得知应用程序的运行情况。</p>
<p>vproc工具有5种用法。</p> <p>vproc工具有5种用法。</p>
...@@ -450,10 +520,10 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -450,10 +520,10 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
</div> </div>
</div> </div>
</div> </div>
<div class="section" id="id10"> <div class="section" id="id15">
<h2>4.5. 自定义监测项列表<a class="headerlink" href="#id10" title="Permalink to this headline"></a></h2> <h2>4.6. 自定义监测项列表<a class="headerlink" href="#id15" title="Permalink to this headline"></a></h2>
<div class="section" id="vaserver"> <div class="section" id="vaserver">
<h3>4.5.1. VAServer<a class="headerlink" href="#vaserver" title="Permalink to this headline"></a></h3> <h3>4.6.1. VAServer<a class="headerlink" href="#vaserver" title="Permalink to this headline"></a></h3>
<table border="1" class="docutils"> <table border="1" class="docutils">
<colgroup> <colgroup>
<col width="41%" /> <col width="41%" />
...@@ -528,9 +598,9 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -528,9 +598,9 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
</div> </div>
</div> </div>
<div class="section" id="item"> <div class="section" id="item">
<h2>4.6. 动态item<a class="headerlink" href="#item" title="Permalink to this headline"></a></h2> <h2>4.7. 动态item<a class="headerlink" href="#item" title="Permalink to this headline"></a></h2>
<div class="section" id="id11"> <div class="section" id="id16">
<h3>4.6.1. 概述<a class="headerlink" href="#id11" title="Permalink to this headline"></a></h3> <h3>4.7.1. 概述<a class="headerlink" href="#id16" title="Permalink to this headline"></a></h3>
<p>动态item的官方说法叫做 Low-level discovery(LLD)</p> <p>动态item的官方说法叫做 Low-level discovery(LLD)</p>
<p>之前我们使用zabbix时需要手动、明确的添加一个个item,对于某些特殊需求,这种方式无法优雅的实现。比如我们想监测所有正在点播的摄像机状态,我们无法预知有多少摄像机,无法预知摄像机id从而定义key值,这时LLD功能派上用场。</p> <p>之前我们使用zabbix时需要手动、明确的添加一个个item,对于某些特殊需求,这种方式无法优雅的实现。比如我们想监测所有正在点播的摄像机状态,我们无法预知有多少摄像机,无法预知摄像机id从而定义key值,这时LLD功能派上用场。</p>
<p>参考资料:</p> <p>参考资料:</p>
...@@ -538,8 +608,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -538,8 +608,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
<p><a class="reference external" href="http://www.zphj1987.com/2016/10/28/zabbix%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%AE%9A%E4%B9%89%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E7%9A%84%E6%B5%81%E7%A8%8B/">zabbix实现自定义自动发现的流程</a></p> <p><a class="reference external" href="http://www.zphj1987.com/2016/10/28/zabbix%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%AE%9A%E4%B9%89%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E7%9A%84%E6%B5%81%E7%A8%8B/">zabbix实现自定义自动发现的流程</a></p>
<p><a class="reference external" href="http://blog.51cto.com/cuidehua/1766027">zabbix 自定义自动发现的key! low level discovery</a></p> <p><a class="reference external" href="http://blog.51cto.com/cuidehua/1766027">zabbix 自定义自动发现的key! low level discovery</a></p>
</div> </div>
<div class="section" id="id14"> <div class="section" id="id19">
<h3>4.6.2. 操作教程<a class="headerlink" href="#id14" title="Permalink to this headline"></a></h3> <h3>4.7.2. 操作教程<a class="headerlink" href="#id19" title="Permalink to this headline"></a></h3>
<p>摄像机状态这个监控项有几个特点:</p> <p>摄像机状态这个监控项有几个特点:</p>
<ol class="arabic simple"> <ol class="arabic simple">
<li>摄像机有多少不固定</li> <li>摄像机有多少不固定</li>
...@@ -547,8 +617,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -547,8 +617,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
<li>每个设备点播的摄像机不同,能够监控的摄像机也就不同</li> <li>每个设备点播的摄像机不同,能够监控的摄像机也就不同</li>
</ol> </ol>
<p>下面演示如何利用LLD功能满足摄像机状态的监控需求</p> <p>下面演示如何利用LLD功能满足摄像机状态的监控需求</p>
<div class="section" id="web"> <div class="section" id="id20">
<h4>4.6.2.1. web上的配置<a class="headerlink" href="#web" title="Permalink to this headline"></a></h4> <h4>4.7.2.1. web上的配置<a class="headerlink" href="#id20" title="Permalink to this headline"></a></h4>
<p>打开zabbix web,点开模板配置,点击指定模板的Discovery,如图:</p> <p>打开zabbix web,点开模板配置,点击指定模板的Discovery,如图:</p>
<img alt="_images/zabbix-lld-01.png" src="_images/zabbix-lld-01.png" /> <img alt="_images/zabbix-lld-01.png" src="_images/zabbix-lld-01.png" />
<p>此时进入了Discovery rules页面,点击右上角的Create discovery rule,填写相关内容:</p> <p>此时进入了Discovery rules页面,点击右上角的Create discovery rule,填写相关内容:</p>
...@@ -567,8 +637,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco ...@@ -567,8 +637,8 @@ info from server: <span class="s2">&quot;processed: 0; failed: 1; total: 1; seco
</ul> </ul>
<img alt="_images/zabbix-lld-04.png" src="_images/zabbix-lld-04.png" /> <img alt="_images/zabbix-lld-04.png" src="_images/zabbix-lld-04.png" />
</div> </div>
<div class="section" id="id15"> <div class="section" id="id21">
<h4>4.6.2.2. 设备上配置文件<a class="headerlink" href="#id15" title="Permalink to this headline"></a></h4> <h4>4.7.2.2. 设备上配置文件<a class="headerlink" href="#id21" title="Permalink to this headline"></a></h4>
<p>总结在zabbix web上的操作,我们创建了一个Discovery,在Discovery中创建了一个Item prototypes,涉及到两个key: cameras和cameras.fps[{#CAMERAID}]</p> <p>总结在zabbix web上的操作,我们创建了一个Discovery,在Discovery中创建了一个Item prototypes,涉及到两个key: cameras和cameras.fps[{#CAMERAID}]</p>
<p>在/usr/local/etc/zabbix_agentd.conf.d/test.conf中增加两行</p> <p>在/usr/local/etc/zabbix_agentd.conf.d/test.conf中增加两行</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nv">UserParameter</span><span class="o">=</span>cameras,vproc lld --path<span class="o">=</span>cameras --macro<span class="o">=</span>CAMERAID <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nv">UserParameter</span><span class="o">=</span>cameras,vproc lld --path<span class="o">=</span>cameras --macro<span class="o">=</span>CAMERAID
...@@ -604,8 +674,8 @@ vproc write --key=cameras.id1.playok --value=1 ...@@ -604,8 +674,8 @@ vproc write --key=cameras.id1.playok --value=1
</div> </div>
<p>所以比88.2少了 vax1、vax2的监测项。我们在设备上继续添加其他其他摄像机状态,在web上会自动创建监测项。 设备上删除摄像机后,1小时后,web上会删除对应的监测项。</p> <p>所以比88.2少了 vax1、vax2的监测项。我们在设备上继续添加其他其他摄像机状态,在web上会自动创建监测项。 设备上删除摄像机后,1小时后,web上会删除对应的监测项。</p>
</div> </div>
<div class="section" id="id16"> <div class="section" id="id22">
<h4>4.6.2.3. 运作流程简述<a class="headerlink" href="#id16" title="Permalink to this headline"></a></h4> <h4>4.7.2.3. 运作流程简述<a class="headerlink" href="#id22" title="Permalink to this headline"></a></h4>
<ul class="simple"> <ul class="simple">
<li>创建Discovery后,zabbix server会每隔n秒,向设备拉取macro的value集合。 拉取动作有自己的key,在zabbix_agentd上配置这个key对应的command,command收集macro的value集合,生成json返回给zabbix server。 zabbix server解析json,保存macro的value集合。</li> <li>创建Discovery后,zabbix server会每隔n秒,向设备拉取macro的value集合。 拉取动作有自己的key,在zabbix_agentd上配置这个key对应的command,command收集macro的value集合,生成json返回给zabbix server。 zabbix server解析json,保存macro的value集合。</li>
<li>在Discovery中创建的Item prototypes可以使用macro,创建带参数的key值,根据macro的value集合自动创建的item集合。</li> <li>在Discovery中创建的Item prototypes可以使用macro,创建带参数的key值,根据macro的value集合自动创建的item集合。</li>
...@@ -616,6 +686,13 @@ vproc write --key=cameras.id1.playok --value=1 ...@@ -616,6 +686,13 @@ vproc write --key=cameras.id1.playok --value=1
</div> </div>
</div> </div>
</div> </div>
<div class="section" id="id23">
<h2>4.8. 监控docker<a class="headerlink" href="#id23" title="Permalink to this headline"></a></h2>
<p>已有开源项目https://github.com/monitoringartist/Zabbix-Docker-Monitoring</p>
<p>平台端运行zabbix_agentd定制版docker,离线包中已添加zabbix_docker/dockbix-agent-xxl-limited_3.4-3.images</p>
<p>dockerrun_zabbix.sh中有运行命令</p>
<p>zabbix web增加Zabbix-Template-App-Docker.xml模板。创建主机,关联此模板</p>
</div>
</div> </div>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li> <li class="toctree-l1"><a class="reference internal" href="30-elk.html">3. elk日志系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li> <li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">5. watchmen在繁星的应用与开发</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">5. watchmen在繁星的应用与开发</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">5.1. 20181128整理需求以及实现</a><ul> <li class="toctree-l2"><a class="reference internal" href="#id1">5.1. 20181128整理需求以及设计</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">5.1.1. 原始需求以及应对方案</a></li> <li class="toctree-l3"><a class="reference internal" href="#id2">5.1.1. 原始需求以及应对方案</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">5.1.2. 会话日志</a></li> <li class="toctree-l3"><a class="reference internal" href="#id3">5.1.2. 会话日志</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">5.1.3. 相机状态</a></li> <li class="toctree-l3"><a class="reference internal" href="#id4">5.1.3. 相机状态</a></li>
...@@ -107,6 +107,10 @@ ...@@ -107,6 +107,10 @@
</li> </li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#id10">5.2. 20181128整理需求实现</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#tcp">5.2.1. tcp长连接状态</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li> <li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a></li>
...@@ -177,7 +181,7 @@ ...@@ -177,7 +181,7 @@
<div class="section" id="watchmen"> <div class="section" id="watchmen">
<h1>5. watchmen在繁星的应用与开发<a class="headerlink" href="#watchmen" title="Permalink to this headline"></a></h1> <h1>5. watchmen在繁星的应用与开发<a class="headerlink" href="#watchmen" title="Permalink to this headline"></a></h1>
<div class="section" id="id1"> <div class="section" id="id1">
<h2>5.1. 20181128整理需求以及实现<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2> <h2>5.1. 20181128整理需求以及设计<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<div class="section" id="id2"> <div class="section" id="id2">
<h3>5.1.1. 原始需求以及应对方案<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3> <h3>5.1.1. 原始需求以及应对方案<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>一.视频点播问题:点播不出来、点播耗时长 、点播的视频质量差等 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>一.视频点播问题:点播不出来、点播耗时长 、点播的视频质量差等
...@@ -451,6 +455,12 @@ ...@@ -451,6 +455,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="section" id="id10">
<h2>5.2. 20181128整理需求实现<a class="headerlink" href="#id10" title="Permalink to this headline"></a></h2>
<div class="section" id="tcp">
<h3>5.2.1. tcp长连接状态<a class="headerlink" href="#tcp" title="Permalink to this headline"></a></h3>
</div>
</div>
</div> </div>
......
...@@ -89,11 +89,12 @@ ...@@ -89,11 +89,12 @@
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li> <li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li> <li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">6. 修订历史</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">6. 修订历史</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id2">6.1. 2018.11.23</a></li> <li class="toctree-l2"><a class="reference internal" href="#id2">6.1. 2018.12.04</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">6.2. 2018.10.24</a></li> <li class="toctree-l2"><a class="reference internal" href="#id3">6.2. 2018.11.23</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">6.3. 2018.10.17</a></li> <li class="toctree-l2"><a class="reference internal" href="#id4">6.3. 2018.10.24</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">6.4. 2018.10.10</a></li> <li class="toctree-l2"><a class="reference internal" href="#id5">6.4. 2018.10.17</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id6">6.5. 2018.10.09</a></li> <li class="toctree-l2"><a class="reference internal" href="#id6">6.5. 2018.10.10</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id7">6.6. 2018.10.09</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
...@@ -163,15 +164,22 @@ ...@@ -163,15 +164,22 @@
<div class="section" id="id1"> <div class="section" id="id1">
<h1>6. 修订历史<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h1> <h1>6. 修订历史<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h1>
<div class="section" id="id2"> <div class="section" id="id2">
<h2>6.1. 2018.11.23<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2> <h2>6.1. 2018.12.04<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>增加zabbix 监控docker说明</li>
<li>增加《20181128整理需求以及实现》章节</li>
</ol>
</div>
<div class="section" id="id3">
<h2>6.2. 2018.11.23<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h2>
<ol class="arabic simple"> <ol class="arabic simple">
<li>增加zabbix动态item功能( Low-level discovery ),简称lld的操作文档。见章节4.6</li> <li>增加zabbix动态item功能( Low-level discovery ),简称lld的操作文档。见章节4.6</li>
<li>vproc脚本增加生成lld所需json串功能。</li> <li>vproc脚本增加生成lld所需json串功能。</li>
<li>vproc脚本根目录修改为/root/Log</li> <li>vproc脚本根目录修改为/root/Log</li>
</ol> </ol>
</div> </div>
<div class="section" id="id3"> <div class="section" id="id4">
<h2>6.2. 2018.10.24<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h2> <h2>6.3. 2018.10.24<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h2>
<ol class="arabic simple"> <ol class="arabic simple">
<li>错别字修改,ansible的脚本叫playbook不是playback</li> <li>错别字修改,ansible的脚本叫playbook不是playback</li>
<li>增加4.4 4.5自定义监测项相关说明</li> <li>增加4.4 4.5自定义监测项相关说明</li>
...@@ -186,21 +194,21 @@ ...@@ -186,21 +194,21 @@
<li>增加zabbix监控模板: <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/zabbix_template 。新部署的zabbix将模板导入即可</li> <li>增加zabbix监控模板: <a class="reference external" href="smb://192.168.9.1">smb://192.168.9.1</a>/公共模块/繁星/繁星二代/自检系统/zabbix_template 。新部署的zabbix将模板导入即可</li>
</ol> </ol>
</div> </div>
<div class="section" id="id4"> <div class="section" id="id5">
<h2>6.3. 2018.10.17<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h2> <h2>6.4. 2018.10.17<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h2>
<ol class="arabic simple"> <ol class="arabic simple">
<li>zabbix agent和proxy配置文件增加 AllowRoot=1,使其可以用root账户运行</li> <li>zabbix agent和proxy配置文件增加 AllowRoot=1,使其可以用root账户运行</li>
<li>错别字修改,watchman改成watchmen,明明是想用DC漫画的watchmen :)</li> <li>错别字修改,watchman改成watchmen,明明是想用DC漫画的watchmen :)</li>
</ol> </ol>
</div> </div>
<div class="section" id="id5"> <div class="section" id="id6">
<h2>6.4. 2018.10.10<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h2> <h2>6.5. 2018.10.10<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h2>
<ol class="arabic simple"> <ol class="arabic simple">
<li>修改了zabbix_agent安装方法。由deb包安装改成编译安装。deb版本较低,一些定义好的item不支持。改成3.4版本源码编译的,与zabbix_proxy一起安装</li> <li>修改了zabbix_agent安装方法。由deb包安装改成编译安装。deb版本较低,一些定义好的item不支持。改成3.4版本源码编译的,与zabbix_proxy一起安装</li>
</ol> </ol>
</div> </div>
<div class="section" id="id6"> <div class="section" id="id7">
<h2>6.5. 2018.10.09<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h2> <h2>6.6. 2018.10.09<a class="headerlink" href="#id7" title="Permalink to this headline"></a></h2>
<ol class="arabic simple"> <ol class="arabic simple">
<li>新建文档,增加了watchmen各组件最基本的安装、配置、quickstart文档</li> <li>新建文档,增加了watchmen各组件最基本的安装、配置、quickstart文档</li>
</ol> </ol>
......
zabbix监测系统 zabbix监测系统
=============== ===============
安装 服务端安装
-------------------------------- --------------------------------
使用docker安装/运行方式(建议使用此方式) 使用docker安装/运行方式(建议使用此方式)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
离线安装包: smb://192.168.9.1/公共模块/繁星/繁星二代/自检系统/(zabbix_agent_proxy_tx1、zabbix_docker) 离线安装包: smb://192.168.9.1/公共模块/繁星/繁星二代/自检系统/zabbix_docker .
有docker离线包zabbix_docker,拷贝到有docker的主机上,加载镜像: 镜像加载
::::::::::::::::::::::::::
有docker离线包zabbix_docker,拷贝到有docker的主机上,加载镜像:
.. code-block:: shell .. code-block:: shell
...@@ -32,6 +35,20 @@ zabbix监测系统 ...@@ -32,6 +35,20 @@ zabbix监测系统
zabbix/zabbix-server-pgsql ubuntu-3.4.13 af4434f6332b 4 weeks ago 224 MB zabbix/zabbix-server-pgsql ubuntu-3.4.13 af4434f6332b 4 weeks ago 224 MB
postgres 9.6 4023a747a01a 20 months ago 265 MB postgres 9.6 4023a747a01a 20 months ago 265 MB
postgres数据库客户端安装
::::::::::::::::::::::::::::::::::::::::::::::
离线包里有libpq5_9.5.23-0ubuntu0.16.04.1_amd64.deb postgresql-client-9.5_9.5.23-0ubuntu0.16.04.1_amd64.deb
.. code-block:: shell
dpkg -i ./*.deb
运行docker,创建数据库
::::::::::::::::::::::::::::::::
本地安装/运行方式(坑多) 本地安装/运行方式(坑多)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
...@@ -77,8 +94,61 @@ sudo cp -r zabbix-3.4.13/frontends/php/ /var/www/html/zabbix ...@@ -77,8 +94,61 @@ sudo cp -r zabbix-3.4.13/frontends/php/ /var/www/html/zabbix
server主动获取,在zabbix_agent.conf增加的item的type是Zabbix trapper server主动获取,在zabbix_agent.conf增加的item的type是Zabbix trapper
配置
---------------------------- 节点端安装
---------------------------
离线安装包: smb://192.168.9.1/公共模块/繁星/繁星二代/自检系统/tx1_离线包/watchmen_tx1.tar.gz
主节点安装
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.. code-block:: shell
tar zxvf watchmen_tx1.tar.gz
cd watchmen_tx1
./watchmen_install_tx1.sh master
# --server_ip平台ip。 --zabbix_proxy_name代理名称,必须和web上创建的一致
./watchmen_config_tx1.sh --server_ip=192.168.9.62 --zabbix_proxy_name=190master
子节点安装
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
确保主节点已安装了ansible
假如当前主节点管理的子节点组命名tx2
.. code-block:: shell
ansible -b tx2 -m copy -a "src=watchmen_tx1.tar.gz dest=/root/UserApp/"
ansible -b tx2 -m raw -a "cd /root/UserApp/; tar zxvf watchmen_tx1.tar.gz; cd watchmen_tx1; ./watchmen_install_tx1.sh slave"
进入web配置
>>>>>>>>>>>>>>>>>>>>>>>>>
1. 导入模版(参考使用章节)
2. 添加代理(参考使用章节)
每个主节点都需要添加代理
使用脚本添加host
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.. code-block:: shell
# --baseurl zabbix web地址
# --ipstart 批量ip开始
# --ipsend 批量ip结束
# --hostgroup 在zabbix创建的group名。如果没有特殊要求填写starnet_tx1_slave_group
# --proxyname 代理名称,必须和web添加的代理名一致
# --template1模版名,监控项都在模版里
# 下面的命令会添加192.168.8.2/3/4/5/6 五个子节点
python2 zabbix_addhost.py --baseurl=http://192.168.9.62:9210 --ipstart=192.168.8.2 --ipend=192.168.8.6 --hostgroup=starnet_tx1_slave_group --proxyname=190master --template1=starnet_tx1_slave_tp
手动配置(前面安装章节已包含自动化配置,没有特殊需求可略过本章节)
------------------------------------------------------------------------------
zabbix_agent配置 zabbix_agent配置
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
...@@ -499,3 +569,14 @@ web上的配置 ...@@ -499,3 +569,14 @@ web上的配置
- macro的value集合json利用vproc lld功能生成 - macro的value集合json利用vproc lld功能生成
监控docker
---------------------
已有开源项目https://github.com/monitoringartist/Zabbix-Docker-Monitoring
平台端运行zabbix_agentd定制版docker,离线包中已添加zabbix_docker/dockbix-agent-xxl-limited_3.4-3.images
dockerrun_zabbix.sh中有运行命令
zabbix web增加Zabbix-Template-App-Docker.xml模板。创建主机,关联此模板
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
watchmen在繁星的应用与开发 watchmen在繁星的应用与开发
********************************** **********************************
20181128整理需求以及实现 20181128整理需求以及设计
=============================== ===============================
原始需求以及应对方案 原始需求以及应对方案
...@@ -223,3 +223,10 @@ OperateServer ...@@ -223,3 +223,10 @@ OperateServer
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
- 长连接状态 - 长连接状态
20181128整理需求实现
===============================
tcp长连接状态
--------------------
修订历史 修订历史
================ ================
2018.12.04
-----------------------------
1. 增加zabbix 监控docker说明
2. 增加《20181128整理需求以及实现》章节
2018.11.23 2018.11.23
------------------ ------------------
1. 增加zabbix动态item功能( Low-level discovery ),简称lld的操作文档。见章节4.6 1. 增加zabbix动态item功能( Low-level discovery ),简称lld的操作文档。见章节4.6
......
...@@ -186,45 +186,58 @@ ...@@ -186,45 +186,58 @@
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a><ul> <li class="toctree-l1"><a class="reference internal" href="40-zabbix.html">4. zabbix监测系统</a><ul>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id1">4.1. 安装</a><ul> <li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id1">4.1. 服务端安装</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#docker">4.1.1. 使用docker安装/运行方式(建议使用此方式)</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#docker">4.1.1. 使用docker安装/运行方式(建议使用此方式)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id2">4.1.2. 本地安装/运行方式(坑多)</a></li> <li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id2">4.1.1.1. 镜像加载</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#postgres">4.1.1.2. postgres数据库客户端安装</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id3">4.1.1.3. 运行docker,创建数据库</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id5">4.2. 配置</a><ul> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id4">4.1.2. 本地安装/运行方式(坑多)</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#zabbix-agent">4.2.1. zabbix_agent配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#zabbix-proxy">4.2.2. zabbix_proxy配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#zabbix-server">4.2.3. zabbix_server配置</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id6">4.3. 使用</a><ul> <li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id7">4.2. 节点端安装</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#quick-start">4.3.1. quick start</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id8">4.2.1. 主节点安装</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id7">4.3.2. 模板</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id9">4.2.2. 子节点安装</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#web">4.2.3. 进入web配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#host">4.2.4. 使用脚本添加host</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id8">4.4. 自定义监测项</a><ul> <li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id10">4.3. 手动配置(前面安装章节已包含自动化配置,没有特殊需求可略过本章节)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id9">4.4.1. 繁星增加自定义监测项典型流程</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#zabbix-agent">4.3.1. zabbix_agent配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#vproc">4.4.2. vproc</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#zabbix-proxy">4.3.2. zabbix_proxy配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#zabbix-server">4.3.3. zabbix_server配置</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id10">4.5. 自定义监测项列表</a><ul> <li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id11">4.4. 使用</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#vaserver">4.5.1. VAServer</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#quick-start">4.4.1. quick start</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id12">4.4.2. 模板</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#item">4.6. 动态item</a><ul> <li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id13">4.5. 自定义监测项</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id11">4.6.1. 概述</a></li> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id14">4.5.1. 繁星增加自定义监测项典型流程</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id14">4.6.2. 操作教程</a><ul> <li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#vproc">4.5.2. vproc</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#web">4.6.2.1. web上的配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id15">4.6.2.2. 设备上配置文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id16">4.6.2.3. 运作流程简述</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id15">4.6. 自定义监测项列表</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#vaserver">4.6.1. VAServer</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#item">4.7. 动态item</a><ul>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id16">4.7.1. 概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="40-zabbix.html#id19">4.7.2. 操作教程</a><ul>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id20">4.7.2.1. web上的配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id21">4.7.2.2. 设备上配置文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="40-zabbix.html#id22">4.7.2.3. 运作流程简述</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="40-zabbix.html#id23">4.8. 监控docker</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a><ul> <li class="toctree-l1"><a class="reference internal" href="80-starnet-dev.html">5. watchmen在繁星的应用与开发</a><ul>
<li class="toctree-l2"><a class="reference internal" href="80-starnet-dev.html#id1">5.1. 20181128整理需求以及实现</a><ul> <li class="toctree-l2"><a class="reference internal" href="80-starnet-dev.html#id1">5.1. 20181128整理需求以及设计</a><ul>
<li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#id2">5.1.1. 原始需求以及应对方案</a></li> <li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#id2">5.1.1. 原始需求以及应对方案</a></li>
<li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#id3">5.1.2. 会话日志</a></li> <li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#id3">5.1.2. 会话日志</a></li>
<li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#id4">5.1.3. 相机状态</a></li> <li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#id4">5.1.3. 相机状态</a></li>
...@@ -242,14 +255,19 @@ ...@@ -242,14 +255,19 @@
</li> </li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="80-starnet-dev.html#id10">5.2. 20181128整理需求实现</a><ul>
<li class="toctree-l3"><a class="reference internal" href="80-starnet-dev.html#tcp">5.2.1. tcp长连接状态</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a><ul> <li class="toctree-l1"><a class="reference internal" href="99-history.html">6. 修订历史</a><ul>
<li class="toctree-l2"><a class="reference internal" href="99-history.html#id2">6.1. 2018.11.23</a></li> <li class="toctree-l2"><a class="reference internal" href="99-history.html#id2">6.1. 2018.12.04</a></li>
<li class="toctree-l2"><a class="reference internal" href="99-history.html#id3">6.2. 2018.10.24</a></li> <li class="toctree-l2"><a class="reference internal" href="99-history.html#id3">6.2. 2018.11.23</a></li>
<li class="toctree-l2"><a class="reference internal" href="99-history.html#id4">6.3. 2018.10.17</a></li> <li class="toctree-l2"><a class="reference internal" href="99-history.html#id4">6.3. 2018.10.24</a></li>
<li class="toctree-l2"><a class="reference internal" href="99-history.html#id5">6.4. 2018.10.10</a></li> <li class="toctree-l2"><a class="reference internal" href="99-history.html#id5">6.4. 2018.10.17</a></li>
<li class="toctree-l2"><a class="reference internal" href="99-history.html#id6">6.5. 2018.10.09</a></li> <li class="toctree-l2"><a class="reference internal" href="99-history.html#id6">6.5. 2018.10.10</a></li>
<li class="toctree-l2"><a class="reference internal" href="99-history.html#id7">6.6. 2018.10.09</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!