Zabbix------Surveillance Tips

Source: Internet
Author: User

1 Zabbix Agent installation can write the following script

#!/bin/sh# description: try to install zabbix_agent with source  package.                                      v1 20151019 by liuliancao# usage: two installation styles: #  1.zabbix-server checks you ,both you and the zabbix_server must  have a public ip (but our server do not have  ^_^)  or  you have direct way to the Zabbix-Server by Router or  Switch.please set the zabbix_installation ' s value to 0 # 2.you  Communicate with zabbix_server actively when you are not in the  same subnet,especiaLly when you do not have a public ip ( i mean the  Zabbix-server cannot find you.).  please set the zabbix_installation ' s value to 1zabbix_package= ' Zabbix-2.4.6.tar.gz ' zabbix_server= ' your_server_ip ' zabbix_server_subip= ' your_server_in_ip ' ZABBIX_INSTALLATION=1      #you  need set this,0 (serverchecks), 1 (activechecks). #unpacktar  XF  ~/$ZABBIX _package# for gcc and gcc-c++yum -y install gcc gcc-c++  1>/dev/null#install echo  "Installing ..." "cd ${zabbix_package%.tar.gz}./."----" Configure --prefix=/usr/local/zabbix --enable-agent --sysconfdir=/etc/zabbix &>/dev /nullmake &>/dev/null && make install &>/dev/nullecho  " Export path= $PATH:/usr/local/zabbix/bin:/usr/local/zabbix/sbin " >> /etc/profile && source /etc/profilecp misc/init.d/tru64/zabbix_agentd    /etc/init.d/chmod 755 /etc/init.d/zabbix_agentdsed -i  ' 1a # chkconfig:  2345 90 10 '  /etc/init.d/zabbix_agentdsed -i  ' 2a # description:  Zabbix_agentd service. '  /etc/init.d/zabbix_agentdsed -i  ' s%daemon=/usr/local/sbin/zabbix_agentd%daemon=/usr/local/ zabbix/sbin/zabbix_agentd% '  /etc/init.d/zabbix_agentdchkconfig --add zabbix_agentd & & chkconfig zabbix_agentd on#add zabbix groupgroupadd -g 201  Zabbix && useradd -g zabbix -u 201 zabbix#modify zabbix_ agentd.confif [  $ZABBIX _installation -eq  1 ];thensed -i  ' s%Server= 127.0.0.1% #Server =127.0.0.1% '  /etc/zabbix/zabbix_agentd.confsed -i  "s%serveractive=127.0.0.1% Serveractive=$ZABBIX _server:10053% " /etc/zabbix/zabbix_agentd.confsed -i " s%# startagents=3%startagents =0% '  /etc/zabbix/zabbix_agentd.conf#else#if you can ping zabbix_server with  subnet ip,use thissed -i  "s%server=127.0.0.1%server= $ZABBIX _server_subip%"  /etc /zabbix/zabbix_agentd.confsed -i  "s%serveractive=127.0.0.1%# serveractive=127.0.0.1%"  /etc /zabbix/zabbix_agentd.conffi#all need to be done sed -i  ' s%#  unsafeuserparameters=0%unsafeuserparameters=1% '  /etc/zabbix/zabbix_agentd.confsed -i  ' s%#  include=$%include=/etc/zabbix/zabbix_agentd.conf.d% '  /etc/zabbix/zabbix_agentd.confsed -i  ' s% hostname=zabbix server%# hostname=zabbix server% '  /etc/zabbix/zabbix_agentd.conf# #try  to run zabbix_agentdecho  "Now starting zabbix_agentd service ..." service  zabbix_agentd start && echo  "start successfully."  | |  echo  "Start failed.please check the log file /tmp/zabbix_agentd.log"  && exit 3

2 Debugging of Zabbix alarm system

2.0 General idea: First your action action can be null condition, so that your enabled will trigger, avoid the trigger or the action set improperly caused by an error

2.1 If not script, then direct debugging, set up media media, user, and permissions, directly take Administration-audit-actionlog to see if there is any error

2.2 If you use a script (recommended to use SendEmail, before the introduction), the local first execution to see if there are errors, there may be a return or prompt, and so on, you need to go to the mail set up SNMP services such as the opening, or add white list, etc., here can also prevent problems such as password filling.

2.3 Test the script and press 2.1 to go to the web to add, view the log processing situation

3 Zabbix XML file

First Zabbix can be the template and screen, such as exported to an XML file, Zabbix XML file has a lot of similarities, here we can be lazy, to achieve a multi-item or the addition of many screen source, specifically can write scripts, I am usually lazy, and then update the script, But usually a sed is enough.

For example I want to add screen, I already have a network information of all my hosts, then I want to monitor the CPU and memory of these hosts as well, certainly not an add, we can put the network XML export, and then execute

Sed ' s#<name>.*</name>#<name>cpu utilization</name> #g ' Downloads/zbx_export_screens.xml > Cpu_monitor.xml

Then modify the name of the first screen.

4 may be very few people still do not know monitoring-latestdata can see the specific data, in configuration-hosts there can see those added item is qualified, whether there is a problem

This article is from the "Learning Path of Kai Learning" blog, please make sure to keep this source http://qixue.blog.51cto.com/7213178/1729033

Zabbix------Surveillance Tips

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.