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     - Ten SCP transfer command example (Linux)

- Oracle how to assess the true concurrent session (Database)

- Linux-du and df command (Linux)

- httpd-2.4 feature (Server)

- OpenJDK 7 compiled under Ubuntu 14.04.3 64-bit (Linux)

- How to merge two pictures in Cacti (Linux)

- To explore the caching mechanism for Android ListView (Programming)

- Kali Linux virtualbox rc = Error 1908 workaround (Linux)

- Detailed PHP code optimization [section] (explain reasons) (Programming)

- lack of SWAP space during installation of Oracle (Database)

- Python decorators to learn and practice the actual usage scenarios (Programming)

- Linux operating system, the internal and external security overview (Linux)

- Linux host system monitoring implement the cgi (Server)

- How to use the DM-Crypt encryption Linux File System (Linux)

- To install and configure the Jetty server and JDK under Ubuntu 14.04.2 (Server)

- Lucene Getting Started Tutorial (Server)

- grep command output highlighted word (Linux)

- MongoDB slice simple example (Database)

- Internet proxy workaround can not be used under Linux YUM (Linux)

- How to network to share files between Windows, MAC and Linux (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:      
 
- Read the official GNU Make manual one (chapter 1-2) (Programming)
- PL / SQL data types (Database)
- Simple to use Linux GPG (Linux)
- Drawing from the Android source code analysis View (Programming)
- Troubleshooting Linux virtual machine device id and the letter of inconsistencies (Linux)
- Compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4 in (Linux)
- DataGuard a hardware issue warnings found (Database)
- ASM Management - How to Rename diskgroup (Database)
- Go performed using iOS and Android programming (Programming)
- 10 really interesting Linux command (Linux)
- 20 Advanced Java interview questions summary (Programming)
- RedHat Linux 5.5 installation process SVN Service Notes (Server)
- VMware virtual machine can not start VMnet0 no Internet access and other issues (Linux)
- Linux system monitoring, top command of the diagnostic tool Detailed (Linux)
- Detailed LVM2 (Linux)
- Fatal: unable to connect to github.com problem solving (Linux)
- To create and manage virtual machines on Ubuntu Redhat (Linux)
- The signature can not be verified under Debian (Linux)
- OpenSSL to generate public and private key (Linux)
- Offline (local) Yum source structures (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.