How to install grafana and add influxdb monitoring under Linux

How to install grafana and add influxdb monitoring under Linux

Install grafana. The official website provides an Ubuntu installation package, which can be installed directly.

wget https://dl.grafana.com/oss/release/grafana_6.5.1_amd64.deb 
dpkg -i grafana_6.5.1_amd64.deb 
update-rc.d grafana-server defaults 95 10
service grafana-server start

Use InfluxDB's HTTP API to add and query data

Add data

while true;do curl -i -XPOST 'http://127.0.0.1:8086/write?db=sinamail' --data-binary "webface,ip=10.2.2.1,httpstatus=404 prototype=\"GET /favicon.ico HTTP/1.1\" `date +%s`000000000";done

Query data

curl -GET 'http://127.0.0.1:8086/query?pretty=true' --data-urlencode "db=sinamail" --data-urlencode "q=SELECT * FROM webface where httpstatus='404'"

Add influxdb data source for grafana

Draw a line chart using query table data

{
 "xhrStatus": "complete",
 "request": {
  "method": "GET",
  "url": "api/datasources/proxy/1/query",
  "params": {
   "db": "sinamail",
   "q": "SELECT count(\"prototype\") FROM \"webface\" WHERE (\"httpstatus\" = '404') AND time >= now() - 15m GROUP BY time(1m) fill(null)",
   "epoch": "ms"
  },
  "data": null,
  "precision": "ms"
 },
 "response": {
  "results": [
   {
    "statement_id": 0,
    "series": [
     {
      "name": "webface",
      "columns": [
       "time",
       "count"
      ],
      "values": [
       [
        1575211320000,
        0
       ],
       [
        1575211380000,
        0
       ],
       [
        1575211440000,
        0
       ],
       [
        1575211500000,
        0
       ],
       [
        1575211560000,
        1
       ],
       [
        1575211620000,
        0
       ],
       [
        1575211680000,
        4
       ],
       [
        1575211740000,
        8
       ],
       [
        1575211800000,
        0
       ],
       [
        1575211860000,
        0
       ],
       [
        1575211920000,
        41
       ],
       [
        1575211980000,
        8
       ],
       [
        1575212040000,
        0
       ],
       [
        1575212100000,
        0
       ],
       [
        1575212160000,
        0
       ],
       [
        1575212220000,
        0
       ]
      ]
     }
    ]
   }
  ]
 }
}

Summarize

The above is the method that I introduced to you to install grafana under Linux and add influxdb monitoring. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Detailed explanation of performance monitoring of MySQL server using Prometheus and Grafana
  • Detailed tutorial on grafana installation and usage
  • Use Grafana to display monitoring charts of Docker containers and set email alert rules (illustration)
  • Detailed explanation of the tutorial on monitoring Springboot applications using Prometheus+Grafana
  • Use Grafana+Prometheus to monitor MySQL service performance
  • Detailed explanation of the process of building Prometheus+Grafana based on docker
  • Summary of influx+grafana custom python data collection and some pitfalls
  • Detailed steps for SpringBoot+Prometheus+Grafana to implement application monitoring and alarm
  • Analyze the method of prometheus+grafana monitoring nginx
  • Prometheus monitors MySQL using grafana display
  • How to monitor Docker using Grafana on Ubuntu
  • Detailed tutorial on building a JMeter+Grafana+Influxdb monitoring platform with Docker
  • Tutorial on building a JMeter+Grafana+influxdb visual performance monitoring platform in docker environment
  • Deploy grafana+prometheus configuration using docker
  • ELK and Grafana jointly create visual monitoring to analyze nginx logs
  • It doesn’t matter if you forget your Grafana password. 2 ways to reset your Grafana admin password

<<:  What is the file mysql-bin.000001 in mysql? Can it be deleted?

>>:  In-depth explanation of Set and WeakSet collections in ES6

Recommend

How to deploy Spring Boot using Docker

The development of Docker technology provides a m...

Install MySQL in Ubuntu 18.04 (Graphical Tutorial)

Tip: The following operations are all performed u...

Solution to Docker's failure to release ports

Today I encountered a very strange situation. Aft...

Example code for implementing image adaptive container with CSS

There is often a scenario where the image needs t...

Overview of the definition of HTC components after IE5.0

Before the release of Microsoft IE 5.0, the bigges...

Implementation of Nginx Intranet Standalone Reverse Proxy

Table of contents 1 Nginx Installation 2 Configur...

Vue elementUI implements tree structure table and lazy loading

Table of contents 1. Achieve results 2. Backend i...

js to achieve floor scrolling effect

This article uses jQuery to implement the sliding...

Bootstrap 3.0 study notes grid system case

Preface In the previous article, we mainly learne...

Sample code for cool breathing effect using CSS3+JavaScript

A simple cool effect achieved with CSS3 animation...

Implementation of Jenkins+Docker continuous integration

Table of contents 1. Introduction to Jenkins 2. I...

Detailed example of using js fetch asynchronous request

Table of contents Understanding Asynchrony fetch(...

MySQL slow log online problems and optimization solutions

MySQL slow log is a type of information that MySQ...