Grafana is the Graphite and InfluxDB Dashboard and graphics editor. Grafana is an open source, fully functional metric panel and graphic editor that supports Graphite,influxdb and OPENTSDB.
Grafana Main Features: Flexible and rich graphical options, can be mixed in a variety of styles, support day and night mode, multiple data sources, Graphite and InfluxDB Query Editor and so on.
Installation
https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.0-1468321182.x86_64.rpm
[[email protected]_server package]# rpm -ivh grafana-3.1.0-1468321182.x86_64.rpm warning: grafana-3.1.0-1468321182.x86_64.rpm: header v4 rsa/sha1 signature, key ID 3dd18bdd: NOKEYPreparing... ########################################### [100%] 1:grafana ########################################### [100%]### not starting grafana-server by default on bootup, please execute sudo /sbin/chkconfig --add grafana-server### in order to start grafana-server, execute sudo service grafana-server start[[email protected]_server package]# chkconfig Grafana-server on
2. creating databases and users
mysql> CREATE DATABASE grafana DEFAULT CHARACTER SET UTF8; Query OK, 1 row affected (0.02 sec) mysql> GRANT all on grafana.* to ' grafana ' @ '% ' identified by ' ZabBix2017 ' with GRANT OPTION; Query OK, 0 rows affected (0.26 sec) mysql> FLUSH privileges; Query OK, 0 rows affected (0.02 sec)
3. Modify the configuration file (here according to your own needs, I changed the listening address and the initial password)
[Email protected]_server package]# Vim/etc/grafana/grafana.ini [database]# either "MySQL", "postgres" or "sqlite3", it ' S your choicetype = Mysqlhost = MySQL Listener address: 3306name = Grafanauser = Grafanapassword = ZabBix2017
4.Grafana.ini configuration file Detailed
App_mode: Application name, default is Production[path]data: a grafana used to store sqlite3, temporary files, address paths Logs:grafana storage logs path [SERVER]HTTP_ Addr: Listen to the IP address, the default is 0.0.0.0http_port: Listening port, the default is 3000protocol:http or HTTPS, the default is Httpdomain: This setting is a part of Root_url, When you access Grafana through the browser Domian name, the default is Localhostenforce_domain: If the host header does not match Domian, then jumps to a correct domain, the default is Falseroot_ URL: This is a full path URL to access Grafana on the Web, by default% (protocol) s://% (domain) s:% (http_port) s/router_logging: Whether to log Web request logs, The default is falsecert_file: If you use HTTPS, you need to set Cert_key: If you use HTTPS, you need to set [Database]grafana to use the database to store user and dashboard information by default. The default is to use Sqlite3 to store, you can also switch to other database type: Can be MySQL, Postgres, sqlite3, the default is Sqlite3path: Just sqlite3 need, define SQLITE3 storage path host: just MySQL , Postgres required, default is 127.0.0.1:3306name:grafana database name, default is grafanauser: Connect database user password: Database user's password Ssl_mode: just postgres use [ Security]admin_user:grafana default Admin user, default is adminadmin_password:grafana admin default password, default is Adminlogin_remember_ Days: Remain logged in for the day Secret_key: sign-in status disable_gravatar:[users]allow_sign_up: Allow normal users to log on, if set to False, prevent users from logging on, by default is True , the admin can create the user and log in Grafanaallow_org_create: If set to False, the user is prevented from creating a new organization, by default trueauto_assign_org: When set to True, the new user is automatically added to the organization with ID 1, and when set to false, a new organization is added when the user is created auto_assign_org _role: New user-attached rule, default is viewer, can also be admin, editor[auth.anonymous]enabled: Set to True, turn on Allow anonymous access, default is Falseorg_ Name: Set the organization name for anonymous users org_role: Access rules set for anonymous users, default is Viewer[auth.github] for the GitHub project, obviously, hehe enabled = falseallow_ sign_up = falseclient_id = some_idclient_secret = some_secretscopes = user:emailauth_url = https://github.com/login/oauth/authorizetoken_url = https:// Github.com/login/oauth/access_tokenapi_url = https://api.github.com/userteam_ids =allowed_ Domains =allowed_organizations =[auth.google] for Google app, hehe Enabled = falseallow_ Sign_up = falseclient_id = some_client_idclient_secret = some_client_ Secretscopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth /userinfo.emailauth_url = https://accounts.google.com/o/oauth2/authtoken_url = https://accounts.google.com/o/oauth2/tokenapi_url = Https://www.googleapis.com/oauth2/v1/userinfoallowed_domains =[auth.basic]enabled: When set to true, the http API on Basic Authentication [auth.ldap]enabled: Set to True to turn on LDAP authentication, default is Falseconfig_file: If you turn on LDAP, specify the LDAP configuration file/etc/grafana/ldap.toml[ Auth.proxy] allows you to set authentication on an HTTP reverse proxy enabled: default is falseheader_name: Default is X-webauth-userheader_ Property: Default is a name USERNAMEAUTO_SIGN_UP: The default is true. Turn on autoenrollment If the user does not exist in grafana db [analytics]reporting_enabled: If set to True, anonymous usage analysis is sent to stats.grafana.org, which is primarily used to track allowed instances, Version, dashboard, error statistics. The default is truegoogle_analytics_ua_id: Use GA for analysis, fill in your Ga id [Dashboards.json] If you have a system that automatically generates JSON-formatted dashboard, You can turn on this feature to try the enabled: default is Falsepath: A full path to include your Json dashboard, default is/var/lib/grafana/dashboards[session] Provider: The default is file, the value can also be memory, MySQL, Postgresprovider_config: The configuration of this value is determined by the provider settings, if the provider is file, it is data/ XXXX path type, if provider is MySQL, then user:[email protected] (127.0.0.1:3306)/database_name, if provider is Postgres, It's user=a. password=b host=localhost port=5432 dbname=c sslmode=disablecookie_ Name:grafana Cookie name Cookie_secure: If set to true, Grafana relies on HTTPS, default is falsesession_life_time:session expiration time, default is 86,400 seconds, 24 hours or less the official documentation is not available in the configuration file [smtp]enabled = falsehost = localhost:25user =password = cert_file =key_file =skip_verify = falsefrom_address = [email protected][ Emails]welcome_email_on_sign_up = falsetemplates_pattern = emails/*.html[log] Mode: Can be console, file, default is console, file, can also set multiple, comma separated buffer_len:channel buffer length, default is 10000level: Can be "Trace", " Debug ", " Info ", " Warn ", " Error ", " Critical ", Default is Info[log.console]level: Set level [Log.file] Level: Set Log_rotate: Whether to turn on automatic rotation max_lines: The maximum number of rows for a single log file, the default is 1000000max_lines_shift: The maximum size of a single log file, the default is 28, which means 256mbdaily_ Rotate: Whether to log rotation every day, the default is truemax_days: Log expiration time, default is 7, 7 days after deletion
5. Installing the Grafana-zabbix plugin
[Email protected]_server package]# grafana-cli Plugins Install alexanderzobnin-zabbix-appinstalling Alexanderzobnin-zabbix-app @ 3.1.2from url:https://grafana.net/api/plugins/alexanderzobnin-zabbix-app/versions/ 3.1.2/downloadinto:/var/lib/grafana/plugins installed Alexanderzobnin-zabbix-app successfully Restart Grafana after Installing plugins. <service Grafana-server restart>
6. Restart the service
[Email protected]_server package]# service grafana-server restartokopping Grafana server ... [OK] Starting Grafana Server: .... Ok
7. Browser Access
http://ip:3000
This article from "Do not abandon!" Do not give up "blog, be sure to keep this source http://thedream.blog.51cto.com/6427769/1883367
grafana3.1.0 installation Configuration