npmGrafStats icon indicating copy to clipboard operation
npmGrafStats copied to clipboard

no data displayed in grafana

Open sistemmsn opened this issue 1 year ago • 9 comments

I don't understand why it doesn't give me data in Grafana image

image

Internal IP-Source: 172.17.0.1 called: meta.levecs.com Internal IP-Source: 172.17.0.1 called: meta.levecs.com **************** start ********************* Measurement-name: ReverseProxyConnections Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. **************** start ********************* Measurement-name: ReverseProxyConnections Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> **************** start ********************* Measurement-name: ReverseProxyConnections response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) **************** start ********************* Measurement-name: ReverseProxyConnections ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> **************** start ********************* Measurement-name: ReverseProxyConnections response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. **************** start ********************* Measurement-name: ReverseProxyConnections Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. **************** start ********************* Measurement-name: ReverseProxyConnections Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. **************** start ********************* Measurement-name: ReverseProxyConnections Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> **************** start ********************* Measurement-name: ReverseProxyConnections response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database. **************** start ********************* Measurement-name: ReverseProxyConnections Traceback (most recent call last): File "/root/.config/NPMGRAF/Getipinfo.py", line 59, in <module> response = reader.asn(str(sys.argv[1])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 176, in asn ASN, self._flat_model_for(geoip2.models.ASN, "GeoLite2-ASN", ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 267, in _flat_model_for (record, prefix_len) = self._get(types, ip_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/geoip2/database.py", line 240, in _get raise geoip2.errors.AddressNotFoundError( geoip2.errors.AddressNotFoundError: The address 1.2.8.1 is not in the database.

sistemmsn avatar Oct 07 '24 23:10 sistemmsn

Hi, can you please share your environments variables you set.

smilebasti avatar Oct 09 '24 15:10 smilebasti

@smilebasti of course

`version: '3' services: npmgraf: image: smilebasti/npmgrafstats:latest restart: unless-stopped hostname: npmgraf environment: REDIRECTION_LOGS: TRUE INTERNAL_LOGS: TRUE MONITORING_LOGS: TRUE INFLUX_HOST: influxdb_nginx:8086 INFLUX_BUCKET: npmgrafstats INFLUX_ORG: npmgrafstats INFLUX_TOKEN: 232123132123123123132132 volumes: - /home/docker/nginx/data/logs:/logs - /home/docker/nginx/geolite:/geolite - /home/docker/nginx/monitoringips.txt:/monitoringips.txt - /etc/localtime:/etc/localtime:ro depends_on: - geoipupdate networks: - proxy

influxdb_nginx: image: influxdb:2.7-alpine hostname: influxdb_nginx restart: unless-stopped environment: DOCKER_INFLUXDB_INIT_MODE: setup DOCKER_INFLUXDB_INIT_USERNAME: npmgrafstats DOCKER_INFLUXDB_INIT_PASSWORD: 121313313 DOCKER_INFLUXDB_INIT_ORG: npmgrafstats DOCKER_INFLUXDB_INIT_BUCKET: npmgrafstats volumes: - /home/docker/nginx/influxdbv2:/var/lib/influxdb2 - /etc/localtime:/etc/localtime:ro networks: - proxy

geoipupdate: image: maxmindinc/geoipupdate hostname: geoipupdate restart: unless-stopped environment: GEOIPUPDATE_ACCOUNT_ID: 1213131 GEOIPUPDATE_LICENSE_KEY: 123365656 GEOIPUPDATE_EDITION_IDS: GeoLite2-ASN GeoLite2-City GeoLite2-Country GEOIPUPDATE_FREQUENCY: 24 volumes: - /home/docker/nginx/geolite:/usr/share/GeoIP - /etc/localtime:/etc/localtime:ro networks: - proxy

networks: proxy: external: true `

sistemmsn avatar Oct 09 '24 22:10 sistemmsn

Try changing:

INFLUX_HOST: influxdb_nginx:8086

To:

INFLUX_HOST: 'http://influxdb_nginx:8086'

JuliusBlueTek avatar Dec 06 '24 02:12 JuliusBlueTek

i have the exact same issue

KoenM9264 avatar Mar 25 '25 09:03 KoenM9264

i have the exact same issue

INFLUX_HOST:

Needs to be http://hostnameofbd:portofdb

What is your

Influxbd_nginx: …. hostname:

Set to?

JuliusSupergenius avatar Mar 25 '25 17:03 JuliusSupergenius

My INFLUX_HOST is set to the following in my docker-compose.yml:

INFLUX_HOST: 'http://host.docker.internal:8086'

i do not have influxdb_nginx as an option.

i can send the docker compose file as well.

KoenM9264 avatar Mar 26 '25 01:03 KoenM9264

My INFLUX_HOST is set to the following in my docker-compose.yml:

INFLUX_HOST: 'http://host.docker.internal:8086'

i do not have influxdb_nginx as an option.

i can send the docker compose file as well.

Are you using a different influxbd outside of the compose? If you are and it’s hosted in the same docker instance then you can set the hostname to whatever but the hostname is just for cross docker connections and shouldn’t have dots. If it’s on a different server then you should be able to use a dns lookup able address like you have. The hostname field in compose is just for internal docker container to docker container lookup as the docker network keeps its own local dns using that hostname to docker network ip.

Basically add a hostname to your DB like:

image: influxdb:2.7-alpine hostname: influxgraphdb

Then set that hostname as the address

INFLUX_HOST: 'http://influxgraphdb:8086'

JuliusSupergenius avatar Mar 26 '25 01:03 JuliusSupergenius

ah, ok. So i should not be using an ip address or host.docker.internal if on the same machine? I should instead be using the containers name/hostname correct?

Thanks!

KoenM9264 avatar Mar 26 '25 02:03 KoenM9264

Hello, it still does not work.

sistemmsn avatar Mar 31 '25 14:03 sistemmsn

Please test it with the new release v2.4.3. If it doesn't work please let me know.

And sorry for the late fix

smilebasti avatar Aug 05 '25 15:08 smilebasti

It seems that it is just a question now, this displays the requests made to my published services. Image

sistemmsn avatar Aug 06 '25 19:08 sistemmsn