Zabbix and zabbix

Source: Internet
Author: User
Tags ibm db2 snmp oid

Zabbix and zabbix
What is Zabbix?

Zabbix was created by Alexei vladisev and is currently under development and support by Zabbix SIA.

Zabbix is an enterprise-level Distributed Open-Source Monitoring solution.

Zabbix is a software that monitors various network parameters and server health and integrity. Zabbix uses a flexible notification mechanism that allows you to configure email-based alarms for almost any event. This allows you to quickly report server problems. Based on the stored data, Zabbix provides excellent reporting and data visualization functions. These features make Zabbix an ideal solution for capacity planning.

Zabbix supports active polling and passive capturing. All reports, statistics, and configuration parameters of Zabbix can be accessed through the Web-based front-end page. Web-based front-end pages allow you to evaluate your network status and server health in any way. After proper configuration, Zabbix can play an important role in IT infrastructure monitoring. This is also true for small organizations with only a few servers and large companies with a large number of servers.

Zabbix is free of charge. Zabbix is developed and issued according to GPL General Public License version 2nd. This means that its source code is released free of charge and can be used by the public at will.

Features of Zabbix

Zabbix is a highly integrated network monitoring solution that provides diverse functions in a simple installation package.

Data collection

  • Availability and performance check
  • Support for SNMP (including capture and proactive training), IPMI, JMX, and VMware monitoring
  • Custom check
  • Collect required data at custom intervals
  • Executed by Server/Proxy and agents

Flexible threshold Definition

  • You can flexibly define the problem threshold, which is called a trigger. The trigger obtains reference values from the backend database.

Highly configurable alerts

  • You can customize Alert Notifications Based on the Upgrade Plan, recipient, and media type.
  • You can use macro variables to make alarm notifications more meaningful and efficient.
  • Automated actions include executing remote commands

Real-time chart Creation

  • You can use the built-in chart rendering function to immediately create a chart of metric items.

Web Monitoring

  • Zabbix can simulate operations on the Web site to check Web functions and response time.

Rich visualization options

  • Allows you to create custom images. Multiple metric items can be displayed in one view.
  • Network Topology
  • Display custom presentations and slides in a dashboard Style
  • Report
  • Advanced (business) view of monitored Resources

Historical Data Storage

  • Data is stored in the database
  • Configurable historical data
  • Built-in Data Management Mechanism

Easy Configuration

  • Add Monitored Objects as hosts
  • The host is created for monitoring and is unique in the database.
  • Application Template to monitor devices

Use Template

  • Group Check In Template
  • Templates can be associated with other templates

Network discovery

  • Automatically discover network devices
  • Automatic Registration of Monitoring Agent
  • Detected file system, network interface and snmp oid Value

Simple Web Interface

  • Web Front-end based on PHP
  • Accessible from anywhere
  • You can customize your own operations
  • Audit Log

Zabbix API

  • Zabbix API provides a programmable interface for Zabbix for batch operations, third-party software integration, and other purposes.

Permission management system

  • Secure User Authentication
  • Specific users can restrict access to specific views.

Powerful and scalable monitoring proxy

  • Deployed on Monitored Objects
  • Can be deployed on Linux and Windows

Binary Code

  • C language for performance and less memory usage
  • Ease of transplantation

Prepare for complex environments

  • Using Zabbix proxy server makes remote monitoring easier
Zabbix overview Structure

Zabbix consists of several major software components. The functions of these components are as follows.

Server

Zabbix server is a core component that monitors agent reporting system availability, system completion, and statistics. Zabbix Server is the core storage for all configuration information, statistics and operation data.

Database storage

All configuration information and data collected by Zabbix are stored in the database.

Web Interface

To easily access Zabbix from anywhere and on any platform, Zabbix provides a Web-based interface. This interface is part of Zabbix Server, which is usually (but not necessarily) running on the same physical machine as Zabbix Server.

 

If SQLite is used, the Zabbix Web interface must run on the same physical machine as Zabbix Server.

 

Proxy Server

Zabbix proxy can collect performance and availability data for Zabbix Server. The Proxy Server is a part of Zabbix software that can be deployed. Of course, the Proxy Server can help a single Zabbix Server to share the load pressure.

Agent Monitoring Agent

The Zabbix agents monitoring agent is deployed on the monitoring target. It can actively monitor local resources and applications and report collected data to the Zabbix Server.

Data Stream

In addition, it is equally important to understand the internal data streams of Zabbix. To create a metric for data collection, you must first create a host. To convert to other parts of the Zabbix function, you must first have a monitoring item to create a trigger, and you must have a trigger to create an action. Therefore, if you want to receiveX ServerIf the CPU load is too high, you must firstX ServerCreate a host entity and associate it with a monitoring item for CPU monitoring. If the CPU load is too high, the trigger is activated, and an action is executed to send you an alert email. Although there seem to be many steps, it is easy to use the template. At the same time, this design can create a very flexible configuration.

Definition

Host (Host)

-A network device that you want to monitor, expressed by IP address or domain name

Host group (Host group)

-The logical Group of the host. It contains the host and template. There is no direct association between hosts and templates in a host group. Generally, you can use a host group when assigning permissions to hosts in different user groups.

Metrics (Item)

-The specific data of the host you want to receive, a metric data.

Trigger (Trigger)

-A logical expression used to define the problem threshold and the data received by the "evaluation" Metric item

When the received data exceeds the threshold, the trigger changes from "OK" to "Problem. When the received data is lower than the threshold value, the trigger retains/returns an "OK" status.

Event (Event)

-Precautions for a single occurrence, such as changing the trigger status or detecting automatic registration of a Monitoring Agent

Exception (Problem)

-A trigger in the "abnormal" status

Action (Action)

-A predefined action to respond to an event.

An action consists of an action (for example, sending a notification) and a condition (At that timeOperation in progress)

Upgrade (Escalation)

-A custom scenario for executing operations within an action; a sequence of sending notifications/executing remote commands

Media (Media)

-Means of sending alarm notifications; means of sending alarm notifications

Notification (Notification)

-Send event-related information to users using selected media channels

Remote commands (Remote command)

-A predefined command that can be automatically executed on the monitored host when certain conditions are met

Template (Template)

-A set of entities (metric items, triggers, graphics, aggregated graphics, applications, LLD, and Web scenarios) that can be applied to one or more hosts.

The template task is to speed up the implementation of host monitoring tasks. It can also simplify the batch modification of monitoring tasks. Templates are directly associated with each individual host.

Application (Application)

-A logical group composed of a group of metric items

Web scenarios (Web scenario)

-Use one or more HTTP requests to check website availability

Front end (Frontend)

-Web interface provided by Zabbix

Zabbix API

-Zabbix API allows you to use the json rpc protocol to create, update, and obtain information about Zabbix objects (such as hosts, metric items, graphics, and others) or to execute any other custom tasks.

Zabbix server

-Zabbix software implements the core monitoring program. Its main functions are to interact with Zabbix proxies and Agents, trigger calculation, send alarm notifications, and save data in a centralized manner.

Zabbix agent

-A program deployed on a monitoring object that can actively monitor local resources and Applications

Zabbix proxy

-A program that helps Zabbix Server collect data and share the load of Zabbix Server

Zabbix Architecture

Monitoring category

 

Zabbix monitoring Java applications

Install and configure Zabbix
Machine name IP configuration Service role Remarks
Cairui 120.25.000087 Zabbix-server Enable monitoring
VM_0_7_centos 118.25.47.241 Zabbix-agent Enable

View environment:

[root@VM_0_7_centos zabbix-3.4.7]# cat /etc/redhat-release CentOS release 6.8 (Final)[root@VM_0_7_centos zabbix-3.4.7]# uname -aLinux VM_0_7_centos 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux[root@cairui ~]# cat /etc/redhat-release CentOS release 6.8 (Final)[root@cairui ~]# uname -aLinux cairui 2.6.32-696.6.3.el6.x86_64 #1 SMP Wed Jul 12 14:17:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@VM_0_7_centos zabbix-3.4.7]# /etc/init.d/iptables statusiptables: Firewall is not running.[root@VM_0_7_centos zabbix-3.4.7]# /usr/sbin/sestatus SELinux status:                 disabled[root@cairui ~]# /etc/init.d/iptables statusiptables: Firewall is not running.[root@cairui ~]# /usr/sbin/sestatus SELinux status:                 disabled
Server Installation Configuration:
[root@cairui software]# rpm -i http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm[root@cairui software]# yum install -y zabbix-server-mysql zabbix-web-mysql

Create a database:

mysql> create database zabbix character set gbk collate gbk_chinese_ci;mysql> show grants for zabbix@localhost;+------------------------------------------------------------+| Grants for zabbix@localhost                                |+------------------------------------------------------------+| GRANT USAGE ON *.* TO 'zabbix'@'localhost'                 || GRANT ALL PRIVILEGES ON `zabbix`.* TO 'zabbix'@'localhost' |+------------------------------------------------------------+

Import data:

[root@cairui software]# zcat /usr/share/doc/zabbix-server-mysql-3.0.15/create.sql.gz |mysql -uzabbix -p zabbixEnter password:

Configure zabbix-server to connect to mysql:

[Root @ cairui software] # vim/etc/zabbix/zabbix_server.conf [root @ cairui software] # grep "DB"/etc/zabbix/zabbix_server.conf | grep-v "#" DBHost = 127.0.0.1DBName = zabbixDBUser = zabbixDBPassword = zabbix
Modify php. ini:
Vim/application/php/lib/php. ini mainly includes the following parameters:
Post_max_size 16 M
Max_execution_time 300
Max_input_time 300
Timezone Asia/Shanghai
Restart php-fpm
[Root @ cairui html] #/etc/init. d/zabbix-server start [root @ cairui html] # cp-rf/usr/share/zabbix/*/opt/nginx/html/[root @ cairui html] # cd/ opt/nginx/html/conf/[root @ cairui conf] # cp zabbix. conf. php. example zabbix. conf. php [root @ cairui conf] # vim zabbix. conf. php [root @ cairui conf] # cat zabbix. conf. php <? Php // Zabbix GUI configuration file. global $ DB; $ DB ['type'] = 'mysql'; $ DB ['server'] = '2017. 0.0.1 '; $ DB ['Port'] = '000000'; $ DB ['database'] = 'zabbix'; $ DB ['user'] = 'zabbix '; $ DB ['Password'] = 'zabbix'; // Schema name. used for IBM DB2 and PostgreSQL. $ DB ['scheme'] = ''; $ ZBX_SERVER = 'localhost'; $ ZBX_SERVER_PORT = '000000'; $ ZBX_SERVER_NAME =''; $ IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG; error: fastCGI sent in stderr: "PHP message: PHP Warning: require_once (/etc/zabbix/web/maintenance. inc. php): failed to open stream: Permission denied in/app/nginx/html/zabbix/include/classes/core/ZBase. php on line 292PHP message: PHP Fatal error: require_once (): Failed opening required'/etc/zabbix/web/mainte solution: chmod-R 755/etc/zabbix/web

Error solution:

[Root @ cairui bcmath] # yum install * bcmath * -- skip-broken [root @ cairui bin] # find/-name bcmath/home/cairui/software/php-7.1.15/ext/bcmath [root @ cairui bin] # cd/home/cairui/software/php-7.1.15/ext/bcmath [root @ cairui bcmath] #/opt/php/bin/phpize indexing ing: PHP Api Version: 20160303 Zend Module Api No: 20160303 Zend Extension Api No: 320160303 [root @ cairui bcmath] #. /configure -- with-php-config =/opt /Php/bin/php-config make & make install [root @ cairui bcmath] # vim/opt/php/lib/php. [root @ cairui bcmath] # tail-1/opt/php/lib/php. ini extension = bcmath. so successful!

  

The solution to language switching is not supported:

[root@cairui web]# yum install *gettext* --skip-broken[root@cairui web]# find / -name gettext/usr/lib64/perl5/vendor_perl/auto/Locale/gettext/usr/lib64/ocaml/gettext/usr/lib64/gettext/usr/bin/gettext/usr/share/doc/gettext-devel-0.17/javadoc2/gnu/gettext/usr/share/glib-2.0/gettext/usr/share/gettext/usr/share/php/gettext/bin/gettext/home/cairui/software/php-7.1.15/ext/gettext/opt/boost/boost_1_59_0/tools/build/example/gettext[root@cairui web]# cd /home/cairui/software/php-7.1.15/ext/gettext[root@cairui gettext]# /opt/php/bin/phpizeConfiguring for:PHP Api Version:         20160303Zend Module Api No:      20160303Zend Extension Api No:   320160303[root@cairui gettext]# ./configure --with-php-config=/opt/php/bin/php-configmake && make install[root@cairui gettext]# vim /opt/php/lib/php.ini [root@cairui gettext]# tail -2 /opt/php/lib/php.ini extension=bcmath.soextension=gettext.so 

  

Client Configuration
[root@VM_0_7_centos ~]# rpm -i http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpmwarning: /var/tmp/rpm-tmp.iT0tW6: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY[root@VM_0_7_centos ~]# yum install zabbix-agent -y[root@VM_0_7_centos ~]# cat /etc/zabbix/zabbix_agentd.conf | grep 'Server'|grep -v "#"Server=120.25.255.87ServerActive=127.0.0.1[root@VM_0_7_centos ~]# /etc/init.d/zabbix-agent startStarting Zabbix agent:                                     [  OK  ]
Detection connectivity

Install zabbix-get detection tool on the server

[root@cairui gettext]# yum install zabbix-get
[root@cairui gettext]# zabbix_get -s 118.25.47.241  -p 10050 -k "system.cpu.load[all,avg1]"0.000000
Configure a new host

Custom monitoring and monitoring alarms

Note: zabbix's built-in Template OS Linux (Template App Zabbix Agent) provides CPU, memory, disk, Nic, and other general monitoring functions. if you add a new host to associate this Template, you can automatically add these metrics.

The custom key can be recognized by the server and agent.

# Correct key [root @ cairui ~] # Zabbix_get-s 118.25.47.241-p 10050-k 'System. uname 'linux VM_0_7_centos 2.6.32-642.6.2.el6.x86 _ 64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64 # unregistered, custom key [root @ cairui ~] # Zabbix_get-s 118.25.47.241-p 10050-k 'login-user' ZBX _ NOTSUPPORTED: Unsupported item key. # enter the wrong key [root @ cairui ~] # Zabbix_get-s 118.25.47.241-p 10050-k 'System. Unama' ZBX _ NOTSUPPORTED: Unsupported item key.
Custom Syntax:
UserParameter=<key>,<shell command>UserParameter=login-user,who|wc -lUserParameter=login-user,/bin/sh /server/scripts/login.sh
Agent Registration:
[Root @ login parameter] # vim userparameter_login.conf [root @ login zabbix_agentd.d] # cat userparameter_login.conf UserParameter = login-user, who | wc-lUserParameter = login-user2, who | wc-l note: key must be unique. Multiple keys must be split into [root @ VM_0_7_centos zabbix_agentd.d] #/etc/init. d/zabbix-agent restartShutting down Zabbix agent: [OK] Starting Zabbix agent: [OK] [root @ cairui ~] # Zabbix_get-s 118.25.47.241-p 10050-k 'login-user' 1 [root @ cairui ~] # Zabbix_get-s 118.25.47.241-p 10050-k 'login-user2' 1 [root @ cairui ~] # Zabbix_get-s 118.25.47.241-p 10050-k 'login-user3' ZBX _ NOTSUPPORTED: Unsupported item key.
Operate on the server (web page ):

Create application set

Create Metric

Create a trigger

Trigger function: trigger an alarm when the value obtained by the metric item reaches a certain number (create as needed)

 

 

Create a graph

Associated host Template

Configure hosts

One host can be associated with multiple templates

View monitoring Images

 

 

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.