Collectd+influxdb+grafana Building Performance monitoring PlatformPreface
InfluxDB is an open-source distributed time-series database for Go language development, which is well suited for storing metrics, events, analytics and other data; key-value times database performance is good.
COLLECTD is a system performance acquisition tool written in the C language.
Grafana is a front-end tool for
Here, I will explain the difference between him and cacti nagios ~ And why should we use him ~
Cacti Uses snmp to capture data. Of course, you can use snmp to execute exec to retrieve the data in the script.
Nagios is used to monitor various Server statuses. Of course, you can also use pnp to draw images.
But why should I use graphite? In fact, it is just a function that shows the received data to the page ~
I think this function is enough ~
Requireme
One collectdserver: IP: 192.168.91.134; one collectdclient: IP: 192.168.91.133.
First, perform a local experiment on collectdserver:
1. Install MYSQL: APT-Get install mysql-server mysql-client.
2. collectD requires a user to connect to MySQL and does not grant other permissions.
CREATE USER 'collectd'@'localhost' IDENTIFIED BY 'Fat4ohse'; -- Give appropriate permissions -- ("GRANT USAGE" is synonymous to "
Here I first explain the difference between him and cacti Nagios ~ and why we use him ~
Cacti is used for data capture via SNMP, and, of course, can be used by SNMP for exec-fetch data in scripts
Nagios is used to monitor the various state of the server, of course, through PnP can also achieve drawing
But why should I use graphite, in fact, he has a function, the data received to show on the page ~
On this one function, I feel enough.
Demand:
Ef
Graphene and graphite have similar names, actually two kinds of substances.2012 Graphene first appeared in the eyes of people, it with its potential success has attracted the attention of researchers. However, because of the backwardness of the extraction technology, although it has many advantages, but the huge cost of extraction can only be studied and not applied to the actual.With the gradual deepening of graphene research in recent years and the
1. Instructions
The following describes how to feed data. For more information about how to use statsd to feed data, see my fourth article: statsd guide.
There are three ways to feed data:
There are three main methods for sending data to graphite: plaintext, pickle, and amqp.
Choosing the right transfer method for you is dependent on how you want to build your application or script to send data:
For a singular script, or for test data, the plainte
Tags: collectd grafana influxdbFirst, the introduction of common plug-insGets the connection status of the specified port established, close_wait, listen, etc.Tcpconns:Listeningports falseLocalPort "80"RemotePort "80"Get the status of NginxNginx:URL "Http://test.tt.com/NginxStatus"Ping:Host "172.18.2.125"Interval 10.0Timeout 1.0Get the traffic for the NICInterfaceInterface "Eth0"The following plugin directly cancels the commentCpuLoadMemoryProcessesIi
Two Ubuntu virtual machines, server and client. Server IP Address: 192.168.91.130. Port 25827 to be received.Server Installation, version 4.10Apt-Get install collectD
/Etc/collectD. conf configuration (mainly including network plugin and rrdtool plugin ):Loadplugin SyslogLoglevel info
Loadplugin CPULoadplugin DFLoadplugin DiskLoadplugin InterfaceLoadplugin LoadLoadplugin memoryLoadplugin NetworkLoadplugin r
First, compile the source:Sudo apt-Get install build-essentialNext, install some necessary packages. You may need to install the necessary plug-ins later. For more information, see http://collectd.org/wiki/index.php/first_steps#creating_graphs:Sudo apt-Get install librrd2-dev libsensors-dev libsnmp-Dev.Next, install:Sudo apt-Get install collectD
Restart the service after installation:Sudo/etc/init. d/collectD
Tags: grafana collectd influxdbWhy study Grafana, COLLECTD and InfluxDB, because I work in the use of open source monitoring software (Nagios, Cacti) drawing is based on RRD implementation, and frankly not very beautiful, and can not customize the chart, But with my development level can not do to write their own charts. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0059.gif "alt=" J_0059.gif "/
After installing the COLLECTD tool on the host, you can obtain data such as cpu,memery,if-traffic of the virtual machine on the host by using the COLLECTD tool. Monitoring of these data can be achieved through Nagios monitoring scripts.The following is a simple monitoring virtual machine memory script:#!/bin/bash#desc:tocheckmemoryaboutvminstancestate_ok=0state_warning=1state_ Critical=2state_unknown=3colle
This article describes how to monitor network card traffic in python and use graphite graphics. For more information, see the following code:
#! /Usr/bin/env pythonImport sys, timeFrom socket import socketDef read_interface (in_file ):With file (in_file) as f:Return f. readlines () [2:]Def set_interface (inter_msg ):Dic = {}For I in xrange (len (inter_msg )):Dic [inter_msg [I]. split (":") [0]. strip ()] = {"in": inter_msg [I]. split (":") [1]. strip
The RRD file generated by collectD cannot be parsed directly by rrd4j. At this time, rrdtool is used to convert the RRD file into an XML file, and rrd4j converts the XML file into an RRD file that rrd4j can recognize. The figure is shown as follows.
① Rrdtool converts RRD files to XML files/Usr/bin/rrdtool dump/var/lib/collectD/RRD/localhost/load. RRD> load. xml
② Rrd4j converts an XML file to an RRD file t
This was done today, and it turned out that it was wrong to choose the Influxdb version when configuring Grafana. Scratching your heads ~ ~The configuration of the COLLECTD is simple, the basic see will know.INFLUXDB configuration is also possible, but the query syntax also needs to be learned.Grafana English interface is really a bit advanced ah, a lot of click on the button is looking for half a day. But the results of the show are pretty flashy. Re
the arithmetic mean (average) of a value in a field. The field type must be Long integer or float64.Syntax format:SELECT MEAN (Using the example> SELECT MEAN (water_level) from H2o_feetname:h2o_feet--------------time mean1970-01-01t00:00 : 00Z 4.286791371454075Indicates that the average value of the Water_level field is4.286791371454075Time is the default time, of course, you can also join the Where condition.4) MEDIAN () functionReturns the median (median) value from the sorted value in a sing
Results of the installation of COLLECTD:
Configuration:Libraries:intel mic ... No (micaccessapi not found) libaquaero5 ... no (libaquaero5.h not found) Libatasmart ... no (atasmart. H not found) Libcurl .... No (Curl-config failed) libdbi ... no (dbi/dbi.h not found) libe Smtp...... No (libesmtp not found) Libganglia ... no (gm_protocol.h not found) Libgcrypt ... No (gcrypt.h not found) Libhal ... no libhiredis ... no (hiredis.h not found) Libi2c-dev
The code is as follows:
#!/usr/bin/env pythonImport Sys,timeFrom socket import socketdef read_interface (in_file):With file (In_file) as F:return F.readlines () [2:]def set_interface (inter_msg):dic={}For i in Xrange (Len (inter_msg)):Dic[inter_msg[
Copy Code code as follows:
#!/usr/bin/env python
Import Sys,time
From socket import socket
def read_interface (in_file):
With file (In_file) as F:
return F.readlines () [2:]
def set_interface (inter_msg):
dic={}
For i in Xrange (Len
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.