Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Zabbix monitoring different versions of RAID installation and monitoring and MySQL master-slave monitor     - DIY security of Linux platform (Linux)

- Oracle 12c users create (Database)

- Quickly build and install Linux KVM system (Linux)

- redis configuration in detail (English) (Database)

- Log in CentOS 6.5 Multi-user setting VNC (Server)

- How to remove the Linux memory Cache, Buffer and swap space (Linux)

- Linux disk quota-related instruction (Linux)

- CentOS yum source deployment (Linux)

- Convert MySQL date string to a NULL value exception handling (Database)

- SteamOS installation under Ubuntu 14.04 (Linux)

- Zabbix monitoring different versions of RAID installation and monitoring and MySQL master-slave monitor (Server)

- Use the top command (Linux)

- The hash function under OpenSSL (Linux)

- CentOS 6.5 configuration SSDB 1.8.0 (Server)

- PHP generates a random password several ways (Programming)

- Redis application of Sina Weibo (Database)

- You may not know the Linux command-line network monitoring tool (Linux)

- Why do you need close contact Rust 1.0 (Programming)

- Linux / UNIX: Use the dd command to create a 1GB size binary (Linux)

- To install HDRMerge 0.4.3 under ubuntu (Linux)

 
         
  Zabbix monitoring different versions of RAID installation and monitoring and MySQL master-slave monitor
     
  Add Date : 2018-11-21      
         
         
         
 

Installation zabbix client
CentOS installation script:
# / bin / bash
cd / usr / local / src
yuminstall wget -y
wget  ! http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-2.2.0-1.el6.x86_64.rpm
wget   http://repo.zabbix.com/zabbix /2.2/rhel/6/x86_64/zabbix-agent-2.2.0-1.el6.x86_64.rpm
rpm -ivhzabbix-2.2.0-1.el6.x86_64.rpm
rpm -ivhzabbix -agent-2.2.0-1.el6.x86_64.rpm
cd / etc / zabbix
grep '^ Server =' zabbix_agentd.conf | sed -i 's / 127.0.0.1 / xxxx / g 'zabbix_agentd.conf
servicezabbix-agent restart
chkconfig   zabbix-agent on

Ubuntu installation script:!
# / Bin / bash
cd / usr / local / src
wgethttp: //repo.zabbix.com/zabbix/2.2/ubuntu/pool/ main / z / zabbix-release / zabbix-release_2.2-1 + precise_all.debdpkg-i zabbix-release_2.2-1 + precise_all.deb
apt-getupdate
apt-getinstall zabbix-agent - y
cd / etc / zabbix
grep '^ Server =' zabbix_agentd.conf | sed -i 's / 127.0.0.1 / xxxx / g'zabbix_agentd.conf
echo "/ etv / init.d / zabbix-agent "> > /etc/rc.local
 
to give permission to the script and execute the script:
sudo chmod + x   jiaoben.sh
sudo   ./jiaoben.sh
 
Zabbix alarm
script needs to be placed zabbix server script trigger corresponding directory zabbix / share / zabbix / alertscripts /
 
Zabbxi_sms.py use to call the company's SMS gateway:!
# / usr / bin / python
#coding: utf-8
importurllib2
importurllib
importsys
def sendm (phone, subject, content):
  url = 'https: // xxxxxxxxxxxxxx'
  data = urllib.urlencode ({
  "xx": '10004',     # call parameters
        "xxxx": phone,
        "xxxx": content
                         })
    req = urllib2.Request (url, data)    
    res = urllib2.urlopen (req)
print res.read ()
sendm (sys.argv [1] , sys.argv [2], sys.argv [3])   #zabbix calling script will automatically transmit three parameters, account, subject and content
 
use scripts to mail alarms script zabbix_email.sh:
echo "$3" | mail -s $1 $2
 
 
Zabbix custom items
modifications zabbix client zabbit_agentd.conf as:
UnsafeUserParameters = 1   # open active mode zabbix of
UserParameter = http.stat, service httpd status   | grep -c running # define a httpd. the key stat when httpd is running the value is 1, when httpd is not running for 0
 
add items on the corresponding host key value httpd.stat can monitor back to the state of the httpd command
you can also write a script, and add the path to the keys you can
 
Zabbix client fetch key test:
zabbix_agentd -t key
Zabbix server fetch the client's key test:
Zabbix / bin / Zabbix_get -s client ip -k key
 
Note that the custom example:
1: Raid disk custom, you can view MegaCli operation
UserParameter = raid.stat, sudo / usr / bin / MegaCli64 -cfgdsply -aALL | grep "State" | grep -c   "Optimal"
#raid state is a normal state disk 1   0 is not normal
UserParameter = pd.total.disks, sudo / usr / bin / MegaCli64   - cfgdsply -aALL | grep -c "Non coerced Size"
UserParameter = pd.critical.disks, sudo / usr / bin / MegaCli64 -AdpAllInfo   -aALL | grep "Critical Disks" | awk -F: '{print   $ 2} ' 
UserParameter = pd.failed.disks, sudo / usr / bin / MegaCli64 -AdpAllInfo   -aALL | grep "Failed disks" | awk -F:' { print   $ 2} '      number
 
Since MegaCli64 need to use sudo to use, so the script to add sudo, this time also need to zabbix given execution the authority
 
edit / etc / sudoers add:
Defaults: zabbix requiretty
zabbix ALL = (ALL) NOPASSWD: / opt / MegaRAID / MegaCli / MegaCli64

2: mysql master-slave monitor
grant replication client on   * * to 'zabbix' @ 'localhost'; # zabbix account for the authorization
mysql -uzabbix -e 'show slavestatus G'. | grep -E "Slave_IO_Running | Slave_SQL_Running" | awk '{print $ 2}' | grep -c yes
# 2 when the value of time expressed mysql master from a value of 0 is normal when the time indicated is not normal

     
         
         
         
  More:      
 
- Enterprise-class GitHub warehousing environment build (Server)
- PostgreSQL 9.3.5 database installation under Ubuntu Server 14.04 (Database)
- Ubuntu will be written in a command file, executable file, source command (Linux)
- Deploy the project to the server from GitHub (Server)
- Awk include binding capacity larger than the specified size of all files directory (Linux)
- How to make GRub instead of the default Ubuntu software center (Linux)
- Getting Started with Linux system to learn: How to compress JPEG images on the command line (Linux)
- To use slay kill user processes (Linux)
- C language macro definition #define Usage (Programming)
- Cobbler batch install Ubuntu / CentOS system (Linux)
- systemd run levels and service management command Introduction (Linux)
- React Getting Started Tutorial (Linux)
- Linux systems for entry-learning - Install Go language in Linux (Linux)
- Oracle RAC node on the expulsion of the inspection process on OEL6.3 (Database)
- Weld a problem in JDK 8u60 environment (Programming)
- Java object initialization (Programming)
- MySQL root password reset under CentOS (Database)
- A well-known but rarely used skills: object pool (Programming)
- OpenWrt modify flash size (Linux)
- Deploy Apache Spark cluster environment in Ubuntu (Server)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.