Objective
Zabbix is a very powerful monitoring tool that can monitor Linux and Windows Server data, and can extend the default monitor by customizing keys, but the message alerts you bring are not very friendly. In this paper, we want to make a custom script to send the corresponding image and URL connection at the same time as the alarm message.
The steps are as follows:
1. Edit the zabbix_server.conf file and modify the Alertscriptspath parameter
zabbix3.0.4 add monitoring of the process:
method One: Monitor with custom commands
Main idea: Through Ps-ef|grep sdk-push-1.0.0.jar |grep-v grep|wc-l This command to determine whether the process Sdk-push is running, if not equal to 1 means the process hangs, triggering the alarmMonitored zabbix-agent side:To add monitoring parameters:# vim/etc/zabbix/zabbix_agentd.confUserparameter=sdk_push,ps-ef|gre
More and more machines are being monitored over time, and the amount of data being stored will be more and more, and the response rate will be slower when the data is at a certain time; so we need to clean up some historical data.
#!/bin/bash user= "root" passwd= "xxxxxx" his_date= ' date-d $ (date-d "-90 Day "+%y%m%d" +%s ' #取90天之前的时间戳 tre_date= ' date-d $ (date-d " -365 Day" +%y%m%d) +%s ' #取365天之前的时间戳 $ (which MySQL)-u${user}-p${passwd}-e use
#!/bin/bash
#this script is used to get TCP and UDP connetion status
#tcp status
Metric=$1
Tmp_file=/tmp/tcp_status.txt
Touch $tmp _file
Chown Zabbix. $tmp _file
/usr/bin/netstat-an|awk '/^tcp/{++s[$NF]}end{for (A in S) print A,s[a]} ' > $tmp _file
Case $metric in
Closed
output=$ (awk '/closed/{print ' $tmp _file)
If ["$output" = = ""];then
Echo 0
Else
Echo $output
Fi
;;
Listen
output=$ (awk '/listen/{print ' $tmp _file)
If ["$output" = = ""];the
Share an optimization script for the Zabbix database, suitable for version 2.0.To History,hostory_uint by day division, trends,trends_uint by month partition;Close Houserkeeper:Vim zabbix_server.confDisablehousekeeper=1Create a partition for the second day of History,hostory_uint daily and delete the partition 45 days agoCreate a partition for the next one months on Trends,trends_uint 20th per month and delete the partition 12 months agoTime can be ch
2.4.7 's agent does not have the built-in MySQL monitoring function (but the server side provides the corresponding template configuration), so we need to use Zabbix's user parameters function to add monitoring scripts for MySQL.Trapper working principle:Monitored hosts periodically push data to Zabbix Server based on user-defined intervals. Here are the main agents.How the Agent works:
The Agent
mv/etc/Muttrc. back
Sudo vim/etc/Muttrc
Set sendmail = "/usr/bin/msmtp" # path of your msmtp command
Set use_from = yes
Set realname = "cl0554@126.com"
Set editor = "vim"
Test email
Echo "hello zabbix" | mutt-s "zabbix test" chenlong0554@qq.com
[Zabbix configuration]
Modify the path of zabbix script
Sudo vim/e
zabbix-2.0.3./configure --prefix=/usr/local/zabbix/ --sysconfdir=/etc/zabbix/ --enable-agentmake make install
To facilitate IO monitoring, install sysstat and execute the following command:
yum install sysstat -y
Sed-I s/10.71.xx.xx/$ HOST_IP/g/etc/zabbix/zabbix_agentd.conf: Change the Hostname = 10.71.xx.xx in the co
mariadb after manually create Zabbix database and authorize Zabbix account access, according to the actual situation authorized IP login MySQL, only native login with localhost.You can then initialize the database based on the SQL scripts that are carried with the Zabbix packageMariaDB [(None)]> CREATE Database
B-Install startup scripts
The code is as follows
Copy Code
cp/root/zabbix*/misc/init.d/fedora/core/*/etc/init.d-p
C-Edit Startup script
# Modify Basedir=/usr/local to Basedir=/usr/local/zabbix in/etc/init.d/zabbix_server file
Modify Basedir=/usr/local to B
be applied to monitor the fast start of virtual components.CustomThink market data is very professional and requires customized monitoring tools? Zabbix can make you think again. Zabbix's extensive customization capabilities allow data acquisition, environmental control systems or more complex research equipment to be integrated into any environment and financial system. In the use of scripts or programmin
Zabbix server installation and deployment of enterprise-level monitoring software zabbix
Zabbix has been applied online for more than half a year. I want to write down my experiences on zabbix's use in the production environment and some experiences, so that you can learn from them without detours!
Environment:Server: CentOS6.3 _ X86.64Zabbix:
I. Environment Introduction
Zabbix depends on the LAMP (Apache, Mysql, and PhP) environment. Apache can also be replaced by Nginx. To save time, there are many one-click installation scripts on the Internet. download and execute the installation.
System: rhel 5.5 X86_64Software: nginx-0.8.53Mysql-5.1.56Php-5.2.17Zabbix 2.0.3
LNMP one-key: http://bbs.linuxtone.org/docs/autoinstall/lemp_auto_v1.0.6.tar.gz
-installation scripts, This script will automatically add the Zabbix user at the time of installation, and automatically add a boot boot if you have to install chkconfig[emailprotected]:~ #vim /tmp/install_after.sh#!/bin/ bashuseradd-m-d/home/zabbix-s/bin/bashzabbixecho ' zabbix All= (All:all) nopasSwd:all ' >>/etc/sud
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.