Giter VIP home page Giter VIP logo

keenetic-grafana-monitoring's People

Contributors

dependabot[bot] avatar tan4ek avatar vitaliy-sk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

keenetic-grafana-monitoring's Issues

Failed to establish a new connection: [Errno 111] Connection refused

Hello,

I have an error "Failed to establish a new connection: [Errno 111] Connection refused" either for read-only user (port 80) or /rci API connection (port 79):

2022-03-22 13:23:02,382 - keentic_influxdb_exporter.py - INFO - 

  _  __                    _   _         _____      _ _           _             
 | |/ /                   | | (_)       / ____|    | | |         | |            
 | ' / ___  ___ _ __   ___| |_ _  ___  | |     ___ | | | ___  ___| |_ ___  _ __ 
 |  < / _ \/ _ \ '_ \ / _ \ __| |/ __| | |    / _ \| | |/ _ \/ __| __/ _ \| '__|
 | . \  __/  __/ | | |  __/ |_| | (__  | |___| (_) | | |  __/ (__| || (_) | |   
 |_|\_\___|\___|_| |_|\___|\__|_|\___|  \_____\___/|_|_|\___|\___|\__\___/|_|   


2022-03-22 13:23:02,384 - influxdb_writter.py - INFO - Connecting to InfluxDB: http://localhost:8086
2022-03-22 13:23:02,384 - keentic_influxdb_exporter.py - INFO - Connecting to router: http://192.168.1.1:79
2022-03-22 13:23:02,384 - keentic_influxdb_exporter.py - INFO - Configuring metric: processes
2022-03-22 13:23:02,428 - keentic_influxdb_exporter.py - INFO - Configuring metric: ip hotspot
2022-03-22 13:23:02,536 - keentic_influxdb_exporter.py - INFO - Configuring metric: interface
2022-03-22 13:23:02,619 - keentic_influxdb_exporter.py - INFO - Configuring metric: system
2022-03-22 13:23:02,694 - keentic_influxdb_exporter.py - INFO - Configuring metric: internet status
2022-03-22 13:23:02,739 - keentic_influxdb_exporter.py - INFO - Configuring metric: media
2022-03-22 13:23:02,788 - keentic_influxdb_exporter.py - INFO - Configuring metric: interface stat
2022-03-22 13:23:02,825 - keentic_influxdb_exporter.py - INFO - Configuring metric: interface stat
2022-03-22 13:23:02,864 - keentic_influxdb_exporter.py - INFO - Configuring metric: interface stat
2022-03-22 13:23:02,903 - keentic_influxdb_exporter.py - INFO - Configuring metric: interface stat
2022-03-22 13:23:02,940 - keentic_influxdb_exporter.py - INFO - Configuring metric: interface stat
2022-03-22 13:23:02,979 - keentic_influxdb_exporter.py - INFO - Configuration done. Start collecting with interval: 60 sec
Traceback (most recent call last):
  File "/root/.local/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/root/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/root/.local/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/keentic_influxdb_exporter.py", line 127, in <module>
    infuxdb_writer.write_metrics(metrics)
  File "/home/influxdb_writter.py", line 18, in write_metrics
    self._write_api.write(bucket=self._configuration['bucket'], org=self._configuration['org'], record=metrics)
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/client/write_api.py", line 371, in write
    results = list(map(write_payload, payloads.items()))
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/client/write_api.py", line 369, in write_payload
    return self._post_write(_async_req, bucket, org, final_string, payload[0])
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/client/write_api.py", line 517, in _post_write
    return self._write_service.post_write(org=org, bucket=bucket, body=body, precision=precision,
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/service/write_service.py", line 62, in post_write
    (data) = self.post_write_with_http_info(org, bucket, body, **kwargs)  # noqa: E501
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/service/write_service.py", line 166, in post_write_with_http_info
    return self.api_client.call_api(
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/api_client.py", line 341, in call_api
    return self.__call_api(resource_path, method,
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/api_client.py", line 171, in __call_api
    response_data = self.request(
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/api_client.py", line 386, in request
    return self.rest_client.POST(url,
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/rest.py", line 304, in POST
    return self.request("POST", url,
  File "/root/.local/lib/python3.8/site-packages/influxdb_client/rest.py", line 217, in request
    r = self.pool_manager.request(
  File "/root/.local/lib/python3.8/site-packages/urllib3/request.py", line 78, in request
    return self.request_encode_body(
  File "/root/.local/lib/python3.8/site-packages/urllib3/request.py", line 170, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "/root/.local/lib/python3.8/site-packages/urllib3/poolmanager.py", line 376, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/root/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "/root/.local/lib/python3.8/site-packages/urllib3/util/retry.py", line 525, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/root/.local/lib/python3.8/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value
  File "/root/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/root/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/root/.local/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1256, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 951, in send
    self.connect()
  File "/root/.local/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/root/.local/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f81aa995e80>: Failed to establish a new connection: [Errno 111] Connection refused

Current config.ini is:

[influx2]
url=http://localhost:8086
# For influx v1.x please use "-" as a value
org=keenetic
# For influx v1.x please use "username:password" as a token
token=blah123
timeout=6000
# For influx v1.x DB name
bucket=keenetic
[keenetic]
skip_auth=true
admin_endpoint=http://192.168.1.1:79
login=user
password=password
[collector]
interval_sec=60

I also tried with:
admin_endpoint=http://192.168.1.1
or
admin_endpoint=curl http://192.168.1.1:79/rci

result was the same.
From the host whom contains the docker machine I can access the :79 and 80 port:

$ curl http://192.168.1.1:79/rci | jq .system.hostname
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 33970  100 33970    0     0  54311      0 --:--:-- --:--:-- --:--:-- 54265
"Keenetic"

I have tried 2.0.0 version and the latest both.
My Keenetic OS is the following version:

Current KeeneticOS version: [3.5.10]

Could you please give me a clue?

NAT sessions is empty on the Grafana dashboard

When, I'm checking "NAT Sessions" graph in Grafana - it is empty.

Correct me if I'm wrong, but it seems that "ip nat" command is missing in metrics.json?
Or is this another reason why "ip nat" is not collected?

Update:
I've checked and "ip nat" metrics collection seems to be gone starting from metrics.json in 1.1.1 release.

In 1.1.0 release metrics.json:
{
"command": "ip nat",
"root" : "$.[*]",
"tags" : {
"src" : "$.src",
"dst" : "$.dst"
},
"values" : {
"bytes-in": "$.bytes",
"bytes-out": "$.bytes-out"
}
},

Ping

Hello!
I want to monitoring for some hosts in Internet via ICMP.
And watch RTT and Loss in graphs.
Could keenetic-grafana-monitoring help in this?

installation and run

when docker run image
Traceback (most recent call last): File "/home/keentic_influxdb_exporter.py", line 110, in <module> infuxdb_writer = InfuxWriter(config['influx2'], config_path) File "/usr/local/lib/python3.8/configparser.py", line 960, in __getitem__ raise KeyError(key) KeyError: 'influx2'
And crash

Excessive logging in Keenetic syslog with monitoring enabled

Hello,

Is there a way to avoid or disable Excessive logging in Keenetic syslog when monitoring is enabled?

These messages are repeated every collection interval (interval_sec=30)
(using collector with docker image latest=1.1.1)


Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "bioset".
Oct 20 11:25:47 ndm
Core::Syslog: last message repeated 14 times.
Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "RtmpCmdQTask".
Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "RtmpWscTask".
Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "HwCtrlTask".
Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "ser_task".
Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "RtmpMlmeTask".
Oct 20 11:25:47 ndm
Json::Object: AppendMember: duplicate key: "nginx: worker process".
Oct 20 11:25:47 ndm
Core::Syslog: last message repeated 2 times.

Should not require InfluxDB admin privileges for existing DB pre-created before

Have existing common InfluxDB 1.8 instance already used for different metrics.
So it's nice to just create new DB once with only write access for particular InfluxDB user. But application tries to recreate DB every time a container deploys. Is there any way to avoid DB recreation attempts? just not found any existing config.ini parameters to change its behaviour

influxdb.exceptions.InfluxDBClientError: 403: {"error":"error authorizing query: keeneticmonwriter not authorized to execute statement 'CREATE DATABASE keeneticmetrics', requires admin privilege"}

How can I add more than 1 Keenetics?

Thank you for a wonderful project!

But as far as I understand, it is designed to monitor only 1 device. How do I add multiple Keenetics for monitoring?

Prometheus instead of InfluxDB?

Hello.

Please do not consider this request as a demand, but more of a question of curiosity matter.
Would it be a big work to make this monitoring also work with Prometheus instead of Influx DB? Or maybe there is some forked version of that script somewhere that is adapted for Prometheus that I don't know about?

Thanks.

Authorization header?

image

Trying setup grafana with new panels using InfluxDB2. Where can i get this header value?

Influxdb2 Unauthorized

Hi!
I have a problem when connecting to Influxdb2.

2021-10-31 09:59:08,607 - influxdb_writter.py - INFO - Connecting to InfluxDB: 172.19.0.4
Traceback (most recent call last):
  File "/home/keentic_influxdb_exporter.py", line 108, in <module>
    infuxdb_writer = InfuxWriter(config['influxdb'])
  File "/home/influxdb_writter.py", line 15, in __init__
    self.init_database()
  File "/home/influxdb_writter.py", line 22, in init_database
    if db_name not in self._client.get_list_database():
  File "/root/.local/lib/python3.8/site-packages/influxdb/client.py", line 704, in get_list_database
    return list(self.query("SHOW DATABASES").get_points())
  File "/root/.local/lib/python3.8/site-packages/influxdb/client.py", line 521, in query
    response = self.request(
  File "/root/.local/lib/python3.8/site-packages/influxdb/client.py", line 378, in request
    raise InfluxDBClientError(err_msg, response.status_code)
influxdb.exceptions.InfluxDBClientError: 401: {"code":"unauthorized","message":"Unauthorized"}

I noticed that this library is used - InfluxDB-Python

Where it clearly states:

Note: This library is for use with InfluxDB 1.x. For connecting to InfluxDB 2.x instances, please use the the influxdb-client-python client.

I saw that Influxdb2 integration was added in version 1.1.0

My build:

  influxdb2:
    image: influxdb:2.0-alpine
    container_name: influxdb2
    restart: unless-stopped
    volumes:
      - ./influxdb2/data:/var/lib/influxdb2
    env_file:
      - influxdb2.env

  keenetic-monitor:
    build: ./keenetic-monitor/build
    image: keenetic-monitor:latest
    container_name: keenetic-monitoring
    restart: unless-stopped
    environment:
      - TZ=Europe/Moscow
    volumes:
      - ./keenetic-monitor/config/config.ini:/home/config/config.ini:ro
      - ./keenetic-monitor/config/metrics.json:/home/config/metrics.json:ro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.