Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Grafana + Zabbix

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Grafana: a static project that needs to be used in conjunction with nginx, apache, etc., as shown above

Install grafana first

There are many versions of http://grafana.org/download/ available on the official website, several packages and three installation methods (official instructions):

1. Yum installs the rpm package directly, but it is so slow that you can't connect at all. (because of the lower version of zabbix, I installed a lower version)

Sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-4.1.2-1486989747.x86_64.rpm

2. Or manually install and use rpm

Sudo yum install initscripts fontconfig sudo rpm-Uvh grafana-4.1.2-1486989747.x86_64.rpm

On susa: sudo rpm-I-- nodeps grafana-4.1.2-1486989747.x86_64.rpm

3. Configure yum source (it is recommended that [it seems that key will be saved for the first time in yum, but will not succeed] default Version 4.1.2)

/ etc/yum.repos.d/grafana.repo

[grafana] name=grafana baseurl= https://packagecloud.io/grafana/stable/el/6/$basearch repo_gpgcheck=1 enabled=1 gpgcheck=1 gpgkey= https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt

Sudo yum install grafana

Required key: https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana

Start:

Service grafana-server start | | / etc/init.d/grafana-server start

Systemctl grafana start

. / usr/sbin/grafana-server

Configuration file:

The configuration files on the grafana backend can be multiple configuration files that end in .ini and read the configuration from three configuration files:

The default is $WORKING_DIR/conf/defaults.ini, followed by the user configuration of $WORKING_DIR/conf/custom.ini, which can be overridden by re-specifying the configuration file with the-- config parameter when the command line starts grafana. If you are installing as deb or rpm, the default configuration file is / etc/grafana/grafana.ini, which is specified through the-- config parameter in the startup script of init.d. [some configuration file paths can be found on the official website]

The default listening port 3000, of course, can be modified in the default configuration file, for security reasons, it is best to modify it, remember to remove the comments.

Now you can visit-> IP:3000 (for security, we need to go to the web and change the default user password)

Site root path: / usr/share/grafana/

Install the zabbix plug-in in the following two ways

1. Download the plugin made by the master.

Git clone https://github.com/linglong0820/grafana-zabbix

Cp-r grafana-zabbix/zabbix/ / usr/share/grafana/public/app/plugins/datasource/

(but no matter how I match it, I can't show it on web. Maybe it's the version? )

2. Plugins----find more plugins (plug-in) on the web side, and then there will be additional plug-ins provided officially.

Grafana-cli plugins install alexanderzobnin-zabbix-app

(default storage path / var/lib/grafana/plugins/alexanderzobnin-zabbix-app)

Restart, but it's not over. Go to web-plugins----apps---zabbix---enable (open). All right.

(I tested that the directory will be tested to the default identification plug-in path, but it will report an error and will not take effect.)

Configure as follows:

The API address of Zabbix is "http://192.168.246.133/zabbix/api_jsonrpc.php", where IP's server where zabbix-server is installed is IP

The API account password of Zabbix is the login account and password of Zabbix on the web. Account number: admin, password zabbix

After clicking Add, click Test Connection to test whether you can connect. Prompt "Success" to indicate that the connection is successful, click Save

Disadvantages:

1. The latest version cannot choose all cpu or mem. It can only be selected one by one. It is too troublesome.

2. The delay in obtaining data is relatively large.

Create a new Graph:

Click on the red box below-> Select Edit- > Select Database ZabbixClient as above

After configuring it as follows, gorgeous data can be displayed. The following pictures are official diagrams:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report