温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

zabbix监控客户端安装

发布时间:2020-08-10 05:30:35 来源:ITPUB博客 阅读:138 作者:dbasdk 栏目:建站服务器
<div> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:0px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> 添加zabbix用户 </h4> <pre style="orphans:2;text-align:-webkit-auto;margin-top:15px;margin-bottom:15px;padding:6px 10px;border:1px solid #CCCCCC;font-size:13px;font-family:Consolas, 'Liberation Mono', Courier, monospace;line-height:19px;overflow:auto;border-radius:3px;color:#333333;background-color:#F8F8F8;"><code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas, 'Liberation Mono', Courier, monospace;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:transparent;">zabbix客户端程序会以该用户的身份启动 shell&gt; groupadd zabbix shell&gt; useradd -r -g zabbix zabbix</code></pre> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> zabbix 编译安装 </h4> <pre style="orphans:2;text-align:-webkit-auto;margin-top:15px;margin-bottom:15px;padding:6px 10px;border:1px solid #CCCCCC;font-size:13px;font-family:Consolas, 'Liberation Mono', Courier, monospace;line-height:19px;overflow:auto;border-radius:3px;color:#333333;background-color:#F8F8F8;"><code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas, 'Liberation Mono', Courier, monospace;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:transparent;">解压zabbix安装包 shell&gt; tar zxvf zabbix-2.4.5.tar.gz shell&gt; cd zabbix-2.4.5/ 编译安装zabbix shell&gt; ./configure --prefix=/usr/local/zabbix_agent --enable-agent shell&gt; make &amp;&amp; make install shell&gt; ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/ shell&gt; ln -s /usr/local/zabbix/bin/* /usr/local/bin/</code></pre> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> zabbix 配置 </h4> <pre style="orphans:2;text-align:-webkit-auto;margin-top:15px;margin-bottom:15px;padding:6px 10px;border:1px solid #CCCCCC;font-size:13px;font-family:Consolas, 'Liberation Mono', Courier, monospace;line-height:19px;overflow:auto;border-radius:3px;color:#333333;background-color:#F8F8F8;"><code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas, 'Liberation Mono', Courier, monospace;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:transparent;">添加zabbix server端口 shell&gt; grep zabbix /etc/services zabbix-agent 10050/tcp # Zabbix Agent zabbix-agent 10050/udp # Zabbix Agent zabbix-trapper 10051/tcp # Zabbix Trapper zabbix-trapper 10051/udp # Zabbix Trapper shell&gt; vi /usr/local/zabbix_agent/etc/zabbix_agentd.conf ============================================================== Server=192.168.56.210 ServerActive=192.168.56.211:10051 DebugLevel=2 Include=/usr/local/etc/zabbix_agentd.conf.d/ UnsafeUserParameters=1 #允许自定义脚本 ==============================================================</code></pre> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> 启动zabbix客户端 </h4> <pre style="orphans:2;text-align:-webkit-auto;margin-top:15px;margin-bottom:15px;padding:6px 10px;border:1px solid #CCCCCC;font-size:13px;font-family:Consolas, 'Liberation Mono', Courier, monospace;line-height:19px;overflow:auto;border-radius:3px;color:#333333;background-color:#F8F8F8;"><code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas, 'Liberation Mono', Courier, monospace;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:transparent;">添加zabbix到开机启动脚本并修改 shell&gt; cp misc/init.d/fedora/zabbix_agentd /etc/init.d/ shell&gt; /etc/init.d/zabbix_agentd start Starting zabbix_agentd: [确定] zabbix服务器端执行 shell&gt; zabbix_get -s192.168.56.211 -p10050 -k"system.uptime" 8748</code></pre> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> 添加自定义监控 </h4> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:10px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> 1、在配置文件里面添加如下监控项: </p> <pre style="orphans:2;text-align:-webkit-auto;margin-top:15px;margin-bottom:15px;padding:6px 10px;border:1px solid #CCCCCC;font-size:13px;font-family:Consolas, 'Liberation Mono', Courier, monospace;line-height:19px;overflow:auto;border-radius:3px;color:#333333;background-color:#F8F8F8;"><code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas, 'Liberation Mono', Courier, monospace;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:transparent;">UserParameter=mysql.status[*],mysql -u$1 -p$2 -e 'show global status' | grep Com_select | awk '{printf $$2}' 注意$$表示原shell含义</code></pre> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:15px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> 2、重新启动 zabbix_agentd服务 </p> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:15px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> 3、zabbix服务器端check服务 </p> <pre style="orphans:2;text-align:-webkit-auto;margin-top:15px;margin-bottom:15px;padding:6px 10px;border:1px solid #CCCCCC;font-size:13px;font-family:Consolas, 'Liberation Mono', Courier, monospace;line-height:19px;overflow:auto;border-radius:3px;color:#333333;background-color:#F8F8F8;"><code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas, 'Liberation Mono', Courier, monospace;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:transparent;">/usr/local/zabbix/bin/zabbix_get -s 192.168.56.211 -k mysql.status['zabbix','123@qwe'] 116611</code></pre> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> 服务器web配置Item </h4> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:10px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> Hosts --&gt; items --&gt; Create item<br /> Name : mysql.status<br /> Type :Zabbix agent<br /> Key : mysql.status['zabbix','123@qwe']<br /> 其他根据需要做修改,保存 </p> <h4 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border:0px;-webkit-font-smoothing:antialiased;font-size:18px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;"> 配置graph </h4> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:10px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> Hosts --&gt; graph --&gt; Create graph<br /> Name : mysql.status<br /> Items: 选择刚配置的Item </p> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:15px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> 其他根据需要做修改,保存 </p> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:15px;margin-bottom:15px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> 此时zabbix就可以生成出界面了 </p> <h3 style="line-height:normal;orphans:2;text-align:-webkit-auto;white-space:normal;margin:20px 0px 10px;padding:0px;border-width:0px 0px 1px;border-bottom-style:solid;border-bottom-color:#CCCCCC;-webkit-font-smoothing:antialiased;font-size:24px;font-family:Helvetica, arial, freesans, clean, sans-serif;"> 整理自网络 </h3> <p style="orphans:2;text-align:-webkit-auto;white-space:normal;margin-top:10px;margin-bottom:0px;border:0px;color:#333333;font-family:Helvetica, arial, freesans, clean, sans-serif;font-size:14px;line-height:22.3999996185303px;"> <strong style="margin:0px;padding:0px;border:0px;"><em style="margin:0px;padding:0px;border:0px;">Svoid</em></strong><br /> <strong style="margin:0px;padding:0px;border:0px;"><em style="margin:0px;padding:0px;border:0px;">2015-07-02</em></strong> </p> </div>
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI