Grafana Cool Chart

Source: Internet
Author: User
Tags ldap oauth syslog grafana

Grafana Visualization of large measurement data tools
############################################################# $Name:         grafana可视化大型测量数据工具# $Author:       zhangshoufu# $organization: http://blog.51cto.com/13447608# $Create Date:  2018-10-14############################################################
What is Grafana?

1) Grafana is an open source program for visualizing large measurement data, providing a powerful and elegant way to create, share, and explore data. The data from your different metric data sources is displayed in dashboard.
2) Grafana is most commonly used for Internet infrastructure and application analysis, but it also has opportunities in other areas such as industrial sensors, home automation, Process control, and so on.
3) Grafana has hot-swappable control Panel and extensible data source, currently supports graphite, InfluxDB, Opentsdb, Elasticsearch.

Install, configure Grafana software

1, install Grafana software
[Grafana official website Installation Instructions] (http://docs.grafana.org/installation/rpm/)
We introduce the installation of 5.1.4 version of Grafana, if other versions are required, please click on the link above to download and install the website yourself.

sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.4-1.x86_64.rpm//granfan软件的目录结构/usr/sbin/grafana-server 安装的二进制文件,可执行的命令/etc/sysconfig/grafana-server 默认和软件相关的环境变量/etc/grafana/grafana.ini  默认的配置文件/var/log/grafana/grafana.log 默认的日志文件/var/lib/grafana/grafana.db 默认使用的时候是sqlite3数据库,里面存放的连接信息,刚安装好服务没启动之前这个文件是不存在的systemctl start grafana-server.service  //启动服务systemctl enable grafana-server.service //把服务加入开机启动文件中

Description

1, the default is to Grafana users to start Grafana, the default listener on the 3000 port.
2, the default login user is Admin/admin
3, we can access the Grafana Web interface via http://IP:3000
4, the default database used is Sqlite3

The default page after login

2. Configuring Grafana Software
1)/etc/sysconfig/grafana-server environment variable configuration file description

[[email protected] grafana]# cat /etc/sysconfig/grafana-serverGRAFANA_USER=grafana // 启动grafana的用户身份GRAFANA_GROUP=grafana// 启动grafana的用户组身份GRAFANA_HOME=/usr/share/grafana// garfana软件默认的目录LOG_DIR=/var/log/grafana// grafana日志文件存放的位置DATA_DIR=/var/lib/grafana// grafana默认数据存放的位置,sqlite3数据库MAX_OPEN_FILES=10000// 最大打开的文件数CONF_DIR=/etc/grafana// 默认配置文件存在的目录CONF_FILE=/etc/grafana/grafana.ini// 默认的配置文件RESTART_ON_UPGRADE=true// 从新启动升级开启PLUGINS_DIR=/var/lib/grafana/plugins// 插件存放的目录PROVISIONING_CFG_DIR=/etc/grafana/provisioning# Only used on systemd systemsPID_FILE_DIR=/var/run/grafana// 软件启动pid号存放的在那个文件中// 我们更改上述信息重启grafana生效

2) interpret /etc/grafana/grafana.ini the default configuration file with precedence over the previous file

In this document; Represents a comment, and the value of the note represents the default value [[email protected]/]# cat/etc/grafana/grafana.ini##################### grafana Configuration  Example ####################### Everything have defaults so do you have need to uncomment things you want to# change# possible  Values:production, Development;app_mode = production# instance name, defaults to HOSTNAME environment variable value or Hostname if hostname var is empty;instance_name = ${hostname}// Set the name of the Grafana-server instance if the value of hostname is null default to use hostname environment variable or hostname #################################### Paths ############ ########################[paths]# Path to where grafana can store temp files, sessions, and the Sqlite3 db (if it is used );d ata =/var/lib/grafana//Grafana where the data is stored, the Sqlite3 and session information is stored by default (if you use Sqlite3) # Directory where Grafana can store  Logs;logs =/var/log/grafana//where default log information is stored # Directory where Grafana would automatically scan and look for plugins;plugins = The/var/lib/grafana/plugins//plugin stores the civilian # folder that contains provisioning config files that GrafanA would apply on the startup and while running.; Provisioning = conf/provisioning//contains a folder of configuration profiles that Grafana will apply at startup and at run time. #################################### Server ####################################[server]# Protocol (http, HTTPS,  SOCKET);p Rotocol = http//using the HTTP protocol # The IP address to bind to, empty would bind to all interfaces;http_addr =//the address of the listening HTTP port to Use;http_port = 3000//Listening Ports # The public facing domain name used to access Grafana from a browser;domain = localhost//used domain name # Redirect to correct domain if host header does not match domain# prevents DNS rebinding attacks;enforce _domain = false//If the host header does not match the domain name, then redirect to the correct domain name to prevent DNS rebinding ***# the full public facing URL to the use of browser, used for redirects an D emails# If Reverse Proxy and sub path specify full URL (with sub path); root_url = http://localhost:3000//site default home page URL, if we change the above domain and port this will also be changed to the corresponding # Log web requests;router_logging = false//default does not log Web requests # The path relative working path; Static_root_path = public//The path of the Web static file # EnabLe gzip;enable_gzip = false//whether to start gzip compression at HTTP transfer time by default without using # HTTPS Certs & key File;cert_file =;cert_key =//when using HTTPS encryption protocol Wait for certificate and place the certificate and key location # Unix socket path;socket =#################################### Database ########################### #########[database]//Connection Database configuration file, should be able to read, do not explain # You can configure the database connection by specifying type, host, name, use  R and password# as separate properties or as on string using the URL properties.# either "MySQL", "postgres" or "sqlite3", It ' s your choice;type = Sqlite3;host = 127.0.0.1:3306;name = Grafana;user = root# If The password contains # or; You have the to wrap it with triple quotes. Ex "" "#password;" "; Password =//If the password contains # or, you must wrap it in triple quotation marks. "" "#password;" " # Use either URLs or the previous fields to configure the database# example:mysql://user:[email protected]:p ort/datab Ase;url =# for ' postgres ' only, either ' Disable ', ' require ' or ' verify-full '; ssl_mode = disable# for ' sqlite3 ' only, path Relative to Data_path Setting;path = grafana.db#MAX Idle conn Setting default is 2;max_idle_conn = * Max Conn setting default is 0 (mean not set); Max_open_conn =# Connec tion Max Lifetime default is 14400 (means 14400 seconds or 4 hours), Conn_max_lifetime = 14400# Set to True to log the SQL Calls and execution times.log_queries =#################################### Session ################################ ####[session]# either "Memory", "File", "Redis", "MySQL", "Postgres", Default is "file";p Rovider = file# provider config o ptions# Memory:not has any config yet# file:session dir path, are relative to Grafana data_path# redis:config like Redi s server e.g. ' Addr=127.0.0.1:6379,pool_size=100,db=grafana ' # mysql:go-sql-driver/mysql DSN config string, e.g. ' user:[ Email protected] (127.0.0.1:3306)/database_name ' # postgres:user=a password=b host=localhost port=5432 dbname=c Sslmode=disable;provider_config = sessions# Session Cookie Name;cookie_name = grafana_sess# If The session in HTTPS on Ly, default is false;cookie_secure = false# Session Life time, default is 86400;session_life_time = 86400#################################### Data proxy ###### #####################[dataproxy]# This enables data proxy logging, default is false;logging = false##################### ############### Analytics ####################################[analytics]# Server Reporting, sends usage counters to stats.grafana.org every hours.# No IP addresses is being tracked, simple counters to track# running instances, DA Shboard and error counts. It is very helpful to us.# change this option to false to disable reporting.; reporting_enabled = true# Set to False to disable all checks to https://grafana.net# for new Vesions (Grafana itself and P Lugins), check is used# in some UI views to notify that Grafana or plugin update exists# This option does not cause any AU To updates, nor send any information# only a GET request to http://grafana.com to GET latest versions;check_for_updates = true# Google Analytics Universal Tracking Code, onlY-enabled if you specify an ID here;google_analytics_ua_id =#################################### Security ############## ######################[security]# default Admin user, created on startup;admin_user = admin//The username of the login Web site # defaults admin PA ssWOrd, can be changed before first start of Grafana, or with profile Settings;admin_password = admin//default password # used for S Igning;secret_key = sw2ycwtib9zpoohopsmm//used to sign some data source settings # Auto-login Remember days;login_remember_days = 7//Remember the number of days of login; Cookie_username = grafana_user//user cookie recorded file; cookie_remember_name = grafana_remember# Disable Gravatar profile images ;d Isable_gravatar = false//Disable personal image File # data source proxy whitelist (Ip_or_domain:port separated by spaces);d Ata_source_pro Xy_whitelist =# Disable protection against brute force login attempts;disable_brute_force_login_protection = false###### ############################## snapshots ###########################[snapshots]# snapshot sharing Options;external_ Enabled = True;external_snapshot_url = https:Snapshots-origin.raintank.io;external_snapshot_name = Publish to snapshot.raintank.io# remove expired snapshot; snapshot_remove_expired = true#################################### Dashboards History ##################[dashboards ]# number dashboard versions to keep (per dashboard). default:20, minimum:1;versions_to_keep = 20#################################### Users ############################# ##[users]# Disable User Signup/registration;allow_sign_up = true//set to False prevents users from registering/creating users, but administrators can still manipulate # allow non admin use RS to create Organizations;allow_org_create = true//false prevents user from creating organization # Set to True to automatically assign new users to the D Efault Organization (ID 1), auto_assign_org = true//is set to True to automatically add new users to the primary organization (identity 1). Set to False, and the new user will automatically create a new organization for the new user.  # Default role new users would be automatically assigned (if disabled above are set to true); Auto_assign_org_role = viewer// Assign the role of the new user to the primary organization # Background text for the user field on the login Page;login_hint = email or username# Default UI theme ("Da RK "or" lIght ");d efault_theme = dark# External user management, these options affect the organization users View;external_manage_li Nk_url =;external_manage_link_name =;external_manage_info =# Viewers can edit/inspect dashboard settings in the browser. But not save the dashboard.; Viewers_can_edit = false[auth]# Set to True to disable (hide) The login form, useful if-use OAuth, defaults to False;d Isable_login_form = false# Set to True to disable the SignOut link in the side menu. Useful if auth.proxy, defaults to False;disable_signout_menu = false#################################### Anonymous Auth ##########################[auth.anonymous]# Enable Anonymous access;enabled = false# Specify Organization name that should is used for unauthenticated users;org_name = Main org.# Specify role for unauthenticated use Rs;org_role = viewer#################################### Github Auth ##########################[auth.github]; Enabled = False;allow_sign_up = true;client_id = Some_id;client_secret = Some_secret;scopes = User:email,read:org;auth_url = Https://github.com/login/oauth/authorize;token_url = https:// Github.com/login/oauth/access_token;api_url = Https://api.github.com/user;team_ids =;allowed_organizations =###### ############################## Google Auth ##########################[auth.google];enabled = false;allow_sign_up = true;client_id = Some_client_id;client_secret = Some_client_secret;scopes = https://www.googleapis.com/auth/ Userinfo.profile Https://www.googleapis.com/auth/userinfo.email;auth_url = https://accounts.google.com/o/oauth2/ Auth;token_url = Https://accounts.google.com/o/oauth2/token;api_url = https://www.googleapis.com/oauth2/v1/ Userinfo;allowed_domains =#################################### Generic OAuth ##########################[ auth.generic_oauth];enabled = False;name = oauth;allow_sign_up = true;client_id = Some_id;client_secret = Some_secret; Scopes = User:email,read:org;auth_url = Https://foo.bar/login/oauth/authorize;token_url = https://foo.bar/Login/oauth/access_token;api_url = Https://foo.bar/user;team_ids =;allowed_organizations =######################## ############ grafana.com Auth ####################[auth.grafana_com];enabled = false;allow_sign_up = true;client_id = Some_id;client_secret = Some_secret;scopes = User:email;allowed_organizations =#################################### Auth Proxy ##########################[auth.proxy];enabled = False;header_name = X-webauth-user;header_property = username;auto_sign_up = True;ldap_sync_ttl = 60;whitelist = 192.168.1.1, 192.168.2.1################################# # # # Basic Auth ##########################[auth.basic];enabled = true#################################### Auth LDAP # # # #######################[auth.ldap];enabled = False;config_file =/etc/grafana/ldap.toml;allow_sign_up = true######## ############################ smtp/emailing ##########################[smtp];enabled = False;host = Localhost:25;user =# If The password contains # or; You have to wrap it with Trippel QUotes. Ex "" "#password;" "; Password =;cert_file =;key_file =;skip_verify = false;from_address = [Email protected];from_name = Grafana# EHLO IDE Ntity in SMTP dialog (defaults to instance_name); ehlo_identity = Dashboard.example.com[emails];welcome_email_on_sign_ up = false#################################### Logging ##########################[log]# Either "console", "File", " Syslog ". Default is console and file# use space to separate multiple modes, e.g. "console file"; mode = console file# either "Debug "Info", "Warn", "error", "Critical", default is "info", level = info# Optional settings to set different levels for spec Ific Loggers. Ex filters = sqlstore:debug;filters =# for "console" mode only[log.console];level =# Log line format, valid options is TE XT, console and Json;format = console# for "file" mode only[log.file];level =# Log line format, valid options is text, CO Nsole and Json;format = text# This enables automated log rotate (switch to following options), default is True; log_rotate = true# Max line number of a single file, the default is 1000000;max_lines = 1000000# Max size shift of a single file, Default is means 1 <<, 256mb;max_size_shift = 28# Segment log daily, default is true;daily_rotate = true# Exp Ired Days of log file (delete after Max days), default was 7;max_days = 7[log.syslog];level =# Log line format, valid option S is text, console and Json;format = text# Syslog network type and address. This can is UDP, TCP, or UNIX. If left blank, the default UNIX endpoints would be used.; Network =;address =# Syslog facility. User, daemon and local0 through Local7 are valid.; Facility =# Syslog tag. By default, the process ' argv[0 ' is used.; Tag =#################################### alerting ############################[alerting]# Disable Alerting engine & UI features;enabled = true# makes it possible to turn off alert rule execution The alerting UI is Visible;execute_al ERTs = true#################################### Internal grafana Metrics ########################### Metrics available at HTTP API url/metrics[metrics]# disable/enable Internal metrics;enabled = true# Publish interval;interval_seconds = 10# Send internal metrics to graphite[metrics.graphite]# Enable by Setti ng the address setting (ex localhost:2003); address =;p Refix = prod.grafana.% ( instance_name) s.#################################### distributed tracing ############[tracing.jaeger]# Enable by Setting the address sending traces to Jaeger (ex localhost:6831), address = localhost:6831# Tag That'll always be include D in when creating new spans. EX (tag1:value1,tag2:value2); Always_included_tag = tag1:value1# type Specifies the type of the Sampler:const, probabilist IC, ratelimiting, or remote;sampler_type = const# Jaeger samplerconfig param# for "Const" sampler, 0 or 1 for always false /true respectively# for "probabilistic" sampler, a probability between 0 and # for "ratelimiting" sampler, the number of Spans per second# for "remote" sampler, param is The same as for "probabilistic" # and indicates, the initial sampling rate before the actual one# are received from the moth Ership;sampler_param = 1#################################### grafana.com Integration ########################### URL Used to into import dashboards directly from grafana.com[grafana_com];url = https://grafana.com########################## ########## External image storage ##########################[external_image_storage]# used for uploading images to Public servers so they can is included in Slack/email messages.# can choose between (S3, WebDAV, GCs, Azure_blob, Loca L);p rovider =[external_image_storage.s3];bucket =;region =;p ath =;access_key =;secret_key =[external_image_ Storage.webdav];url =;p Ublic_url =;username =;p assword =[external_image_storage.gcs];key_file =;bucket =;p Ath =[ External_image_storage.azure_blob];account_name =;account_key =;container_name =[external_image_storage.local]# Does not require any configuration

Location of user authentication method: Garfana Several user authentication methods

3) Modify the configuration file

// grafana默把数据存在sqlite3里,我们更改到mysql重[[email protected] /]# grep "^[a-z]" /etc/grafana/grafana.inidomain = test.garfana.comroot_url = http://test.garfana.com:3000type = mysqlhost = 172.16.1.51:3306name = grafanauser = grafanapassword = "zsf123.com"log_queries =admin_user = zsfadmin_password = "zsf123.com"

4) MySQL creates libraries and users and authorizes

MariaDB [(none)]> create database grafana ;MariaDB [(none)]> grant all privileges on grafana.* to [email protected]"172.16.1.71" identified by ‘zsf123.com‘;MariaDB [(none)]> flush privileges;

5) Reboot Grafana to make its configuration effective, login to Web interface connection configuration, install plugin plugin

Use of Grafana and Zabbix to describe how the Grafana is used

1) Install Zabbix plug-in, enter Grafana-web home---> Install Apps & plugin installation Zabbix plugin

Select the Zabbix plugin



[[email protected] /]#[[email protected] /]# grafana-cli plugins install alexanderzobnin-zabbix-appinstalling alexanderzobnin-zabbix-app @ 3.9.1from url: https://grafana.com/api/plugins/alexanderzobnin-zabbix-app/versions/3.9.1/downloadinto: /var/lib/grafana/plugins? Installed alexanderzobnin-zabbix-app successfullyRestart grafana after installing plugins . <service grafana-server restart>// 安装完插件之后重启一下grafana端[[email protected] /]# systemctl restart grafana-server.service

2) then go to the Web first click

Go to enable Zabbix plugin


3) Add a data source for a report

4) View the template information
To the home page click Home

5) refers to the definition of the indicator disk

First, create a Garfana row to categorize

Create a chart




The approximate page is such a situation,

Add a pie chart plugin
and installing the Zabbix plugin is the same process

grafana-cli plugins install grafana-piechart-panelinstalling grafana-piechart-panel @ 1.3.3from url: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.3.3/downloadinto: /var/lib/grafana/plugins? Installed grafana-piechart-panel successfullyRestart grafana after installing plugins . <service grafana-server restart>[[email protected] /]# systemctl restart grafana-server.service


Once the installation is complete, you will be able to see the pie chart where you added the module, and you can create a pie chart of the memory.

Installation plug-in introduced to this, the basic use has been normal, and later continued to introduce the relevant tutorials

Grafana Cool Chart

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.