/sendmail.log 2>1echo "******" >>/usr/local/zabbix/share/zabbix/alertscripts/sendmail.log 2>1Note that the arguments must be extended in quotation marks, otherwise the parameters will not be fully recognized.send_alert_mail.py Script content:Cat send_alert_mail.py#!/usr/bin/python#coding =utf-8‘‘‘@date 20160808@author LJB‘‘‘Import SysImport SmtplibFrom Email.mime.text import Mimetextmailto_list=[' [email pr
permanentlocal55040072.78 6 rowsselected.The above is taken out of the data, since the data taken out, then the rest is to do is to get the data into the Zabbix.The following two scripts are used to format and value the extracted data:[Email protected] opt]# cat/usr/local/zabbix/scripts/oracle_discovery.sh
#!/bin/bash
tablespace= ' cat/tmp /tablespace.log |awk '
There is a notification queue, if you exceed a certain value, you need to call the policeThe query interface can return the number of queues, in the form of the number of json,data followed by the number of queues{"Code": 0, "message": "Success", "Data": 22}Edit the configuration file in the Zabbix client zabbix_agentd.confVim/usr/local/zabbix-agent/zabbix_agentd.confAdd Blue SectionLogfile=/tmp/zabbix_agen
( Env.software_zabbix_url.split ('/') [ -1][0:-7]): local ("./configure--prefix=%s--enable-server--enable-agent--with-mysql --with-net-snmp--with-libcurl "%env.software_make_ Path) local ("make Makeinstall ") #使用nginx的默认路径, You can modify the local yourself ("Cp-rfrontends /php/%s/zabbix "%env.project_html_path) local ("cpmisc/init.d/fedora/core/*/etc/init.d/") local ("chmod+x/etc/init.d/zabbix_* Chkconfig--addzabbix_server ") local ("chkconfig--
average, divided into and out. If the script executes every 1 minutes, the calculated traffic value is the flat value of 1 minutes. The script has two parameters the first is the name of the network card, such as: Eth0, the second is in or out is in or out of the traffic, the script can calculate the machine on all the network card traffic as long as the first parameter change Eth0,eth1,lo and so on. But it's a pity that the first run will automatically create a temporary file for the *net[io].
Zabbix Monitor nginx,php-fpm and MySQL memory usage and number of processes with custom scriptsFirst, add a script under the Zabbix script directory and write the following code#!/bin/bash#license: GPL#mail: [Email protected]#date: 2015.04.16Top-bn1>/usr/local/zabbix-2.4.4/scripts/process.logLog=/usr/local/
Shell statements that connect data in a scriptMysql_user= ' Zabbix ' mysql_pwd= ' 123456 ' mysql_host= ' 127.0.0.1 "mysql_port= ' 3306 ' mysql_conn= '/usr/local/mysql/bin/ Mysqladmin-u${mysql_user}-p${mysql_pwd}-h${mysql_host} "-p${mysql_port}"It was written in this way, but it will appear warning:using a password on the command line interface can be insecure. This hint, and there is no way to remove it, which causes the
Zabbix text message by script principleand Zabbix e-mail is the same, are configured in action, the way to send text messages by calling SMS Company API to complete, of course, there are many online use 139 mailbox to send, this is actually called a call email, here is to repeat the method called script.Step
Write a script that sends text messages. Plus executable permissions.
Administration->
Zabbix Sending SMS principles via scriptingand Zabbix email is the same, they are the action internal configuration, the Division API to complete. Of course, there are many on the Internet using 139 of mailboxes to send, this is actually called a call email, here is to repeat the method called script.Step
Write a script that sends text messages. Plus the operational permissions.
Administration-
Zabbix Monitoring Windows log Scripts The script is used to monitor the logs on the Windows Server, view the log file at the end of n rows, and if n rows contain a field, output 0, otherwise output 1, and then zabbix the profile empty definition Kye, for monitoring.Text file line break is "\ n"Edit Script log.pyImportsysimportredeflast_lines (filename,lines=1): L
Objective
Zabbix is a very powerful monitoring tool that can monitor server data for Linux and Windows, and can also extend the default monitoring by customizing keys, but the messages provided by your own email alerts are not very friendly. In this paper, we want to send the corresponding image and URL connection at the same time by the custom script.
The steps are as follows:
1. Edit the zabbix_server.conf file and modify the Alertscriptspath param
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.