Grafana3.1.0 installation configuration
Grafana is the Graphite and InfluxDB dashboard and graphical editor. Grafana is an open source, full-featured measurement dashboard and graphical editor that supports Graphite,InfluxDB and OpenTSDB.
Grafana main features: flexible and rich graphical options; can mix multiple styles; support for 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
[root@Zabbix_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... # 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 [root @ Zabbix_server package] # chkconfig grafana-server on
two。 Create 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 have changed the listening address and initial password)
[root@Zabbix_server package] # vim / etc/grafana/grafana.ini [database] # Either "mysql", "postgres" or "sqlite3", it's your choicetype = mysqlhost = mysql listening address: 3306name = grafanauser = grafanapassword = ZabBix2017
Detailed explanation of 4.grafana.ini configuration file
App_mode: application name, default is production [path] data: a grafana to store sqlite3, temporary files, reply address path logs:grafana store logs path [server] http_addr: listening ip address, default is 0.0.0.0http_port: listening port, default is 3000protocol:http or https, default is httpdomain: this setting is part of root_url, the public domian name when you access grafana through a browser Default is localhostenforce_domain: if the header of the host does not match domian, jump to a correct domain. Default is falseroot_url: this is a full-path url that accesses grafana on web, default is% (protocol) domain s/router_logging% (http_port) s/router_logging: whether to record web request log 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. By default, you need to use a database to store user and dashboard information. By default, you can use sqlite3 to store user and dashboard information. You can also change it to other database type: mysql, postgres, sqlite3, sqlite3path: only sqlite3 needs, define sqlite3 storage path host: only mysql, postgres need Default is the database name of 127.0.0.1:3306name:grafana, default is grafanauser: user connecting to database password: password of database user ssl_mode: only postgres uses [security] admin_user:grafana default admin user, default is adminadmin_password:grafana admin default password Default is adminlogin_remember_days: how many days to maintain login status secret_key: keep login status signature disable_gravatar: [users] allow_sign_up: whether to allow ordinary users to log in, if set to false, users are not allowed to log in, default is true, then admin can create users and login grafanaallow_org_create: if set to false, users are not allowed to create new organizations, default is trueauto_assign_org: when set to true New users will be automatically added to the organization whose id is 1. When set to false, a new organization auto_assign_org_role will be added when the new user is created: new user additional rule, default is Viewer, can also be Admin, editor [auth.permission] enabled: set to true, allow anonymous access is enabled, default is falseorg_name: set organization name for anonymous users org_role: access rules for anonymous users The default is Viewer [auth.github] for the github project, and it is obvious that enabled = falseallow_sign_up = falseclient_id = some_idclient_secret = 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/oauth3/authtoken_url = https://accounts.google.com/o/oauth3/tokenapi_url = https://www.googleapis.com/oauth3/v1/userinfoallowed_domains = [auth.basic] enabled: when set to true Then http api enables basic authentication [auth.ldap] enabled: set to true to enable LDAP authentication. Default is falseconfig_file: if LDAP is enabled, the configuration file / etc/grafana/ldap.toml [auth.proxy] of specified LDAP 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: default is true. Enable automatic registration. If the user does not have [analytics] reporting_enabled in grafana DB: if set to true, anonymous usage analysis will be sent to stats.grafana.org, which is mainly used to track allowed instances, versions, dashboard, and error statistics. Default is truegoogle_analytics_ua_id: use GA for analysis, and fill in your GA ID. [dashboards.json] if you have a system that automatically generates dashboard in json format, you can turn on this feature to try enabled: default is falsepath: a full path is used to contain your json dashboard, default is / var/lib/grafana/ dashboardssession provider: default is file, values can also be memory, mysql, postgresprovider_config: the configuration of this value is determined by the setting of provider If provider is file, it is the data/xxxx path type; if provider is mysql, it is user:password@tcp (127.0.0.1 cookie 3306) / database_name; if provider is postgres, it is the cookie name cookie_secure of user=a password=b host=localhost port=5432 dbname=c sslmode=disablecookie_name:grafana: if set to true, grafana depends on https. The default is falsesession_life_time:session expiration time. The default is 86400 seconds. Official documents are not available for less than 24 hours. In the configuration file, [smtp] enabled = falsehost = localhost:25user = password = cert_file = key_file = skip_verify = falsefrom_address = admin@ grafana.localhost [emails] welcome_email_on_sign_up = falsetemplates_pattern = emails/*.html [log] mode: it can be console, file, console, file by default, or you can set multiple buffer lengths of buffer_len:channel separated by commas Default is 10000level: can be "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is info[ log.console] level: setting level [log.file] level: setting level log_rotate: whether to enable automatic rotation max_lines: maximum number of lines of a single log file, default is 1000000max_lines_shift: maximum size of a single log file, default is 28 Indicates 256MBdaily_rotate: whether to rotate logs every day. Default is truemax_days: log expiration time. Default is 7: 7 days after deletion.
5. Install the grafana-zabbix plug-in
[root@Zabbix_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.
6. Restart the service
[root@Zabbix_server package] # service grafana-server restartOKopping Grafana Server... [OK] Starting Grafana Server:.... OK
7. Browser access
Http://ip :3000