NetAlertX icon indicating copy to clipboard operation
NetAlertX copied to clipboard

Internet Connection IP changed is shown, but connection did not change

Open todrees1967 opened this issue 9 months ago β€’ 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing open and closed issues and I checked the docs https://github.com/jokob-sk/NetAlertX/tree/main/docs

Current Behavior

I am getting constant messages (5-6 times a day) that the IP of my internet conncetion has changed. One message shows 0.0.0.0 as the IP the next one shows my "real" internet IP. This message shoudn't appear, since I have a static IP v4 using a cable connection (Vodafone, Germany) and the connection is not disconnected usually.

Seems the problem is related to that entry in the logs:

11:25:50 [INTRNT] DIG result : ;; communications error to 208.67.222.222#53: timed out

Why is the connection to the opendns Resolver timing out? Can I configure any other/different DNS server?

Expected Behavior

Not getting a timeout from OpenDNS when checking the internet IP.

Steps To Reproduce

No response

app.conf

# INTRNT
#---------------------------
INTRNT_RUN='schedule'
INTRNT_RUN__metadata="{\"function\": \"RUN\", \"events\": [\"run\"], \"type\": \"text.select\", \"default_value\": \"schedule\", \"options\": [\"disabled\", \"once\", \"schedule\", \"always_after_scan\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"When to run\"}, {\"language_code\": \"es_es\", \"string\": \"Cu\\u00e1ndo ejecutar\"}, {\"language_code\": \"de_de\", \"string\": \"Wann ausf\\u00fchren\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"When the plugin should run. An hourly or daily <code>SCHEDULE</code> is a good option.\"}, {\"language_code\": \"de_de\", \"string\": \"Wann das Plugin ausgef\\u00fchrt werden soll. Eine st\\u00fcndliche oder t\\u00e4gliche <code>SCHEDULE</code> wird empfohlen.\"}]}"
INTRNT_CMD='python3 /app/front/plugins/internet_ip/script.py prev_ip={prev_ip} INTRNT_DIG_GET_IP_ARG={INTRNT_DIG_GET_IP_ARG}'
INTRNT_CMD__metadata="{\"function\": \"CMD\", \"type\": \"readonly\", \"default_value\": \"python3 /app/front/plugins/internet_ip/script.py prev_ip={prev_ip} INTRNT_DIG_GET_IP_ARG={INTRNT_DIG_GET_IP_ARG}\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Command\"}, {\"language_code\": \"es_es\", \"string\": \"Comando\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Command to run. This can not be changed\"}, {\"language_code\": \"es_es\", \"string\": \"Comando a ejecutar. Esto no se puede cambiar\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl zum Ausf\\u00fchren. Dies kann nicht ge\\u00e4ndert werden\"}]}"
INTRNT_DIG_GET_IP_ARG='-4 myip.opendns.com @resolver1.opendns.com'
INTRNT_DIG_GET_IP_ARG__metadata="{\"function\": \"INTRNT_DIG_GET_IP_ARG\", \"type\": \"text\", \"default_value\": \"-4 myip.opendns.com @resolver1.opendns.com\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Internet IP discovery\"}, {\"language_code\": \"es_es\", \"string\": \"Descubrir de IP de Internet\"}, {\"language_code\": \"de_de\", \"string\": \"Erkennung externer IP (\\\"Internet IP\\\")\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Change the <a href=\\\"https://linux.die.net/man/1/dig\\\" target=\\\"_blank\\\">dig utility</a> arguments if you have issues resolving your Internet IP. Arguments are added at the end of the following command: <code>dig +short </code>.\"}, {\"language_code\": \"es_es\", \"string\": \"Cambie los argumentos de la <a href=\\\"https://linux.die.net/man/1/dig\\\" target=\\\"_blank\\\">utilidad de dig</a> si tiene problemas para resolver su IP de Internet. Los argumentos se agregan al final del siguiente comando: <code>dig +short </code>.\"}, {\"language_code\": \"de_de\", \"string\": \"\\u00c4ndere die Argumente des <a href=\\\"https://linux.die.net/man/1/dig\\\" target=\\\"_blank\\\">dig Dienstprogramms</a>, wenn Probleme beim Aufl\\u00f6sen der externen IP auftreten. Argumente werden an das Ende des folgenden Befehls angeh\\u00e4ngt: <code>dig +short </code>.\"}]}"
INTRNT_RUN_SCHD='*/5 * * * *'
INTRNT_RUN_SCHD__metadata="{\"function\": \"RUN_SCHD\", \"type\": \"text\", \"default_value\": \"*/5 * * * *\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Schedule\"}, {\"language_code\": \"es_es\", \"string\": \"Schedule\"}, {\"language_code\": \"de_de\", \"string\": \"Zeitplan\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Only enabled if you select <code>schedule</code> in the <a href=\\\"#INTRNT_RUN\\\"><code>INTRNT_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\\\"toggleAllSettings()\\\" href=\\\"#TIMEZONE\\\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes. It's recommended to use the same schedule interval for all plugins responsible for discovering new devices.\"}, {\"language_code\": \"es_es\", \"string\": \"Solo est\\u00e1 habilitado si selecciona <code>schedule</code> en la configuraci\\u00f3n <a href=\\\"#INTRNT_RUN\\\"><code>INTRNT_RUN</code></a>. Aseg\\u00farese de ingresar la programaci\\u00f3n en el formato similar a cron correcto (por ejemplo, valide en <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). Por ejemplo, ingresar <code>0 4 * * *</code> ejecutar\\u00e1 el escaneo despu\\u00e9s de las 4 a.m. en el <a onclick=\\\"toggleAllSettings()\\\" href=\\\"#TIMEZONE\\\"><code>TIMEZONE</ c\\u00f3digo> que configur\\u00f3 arriba</a>. Se ejecutar\\u00e1 la PR\\u00d3XIMA vez que pase el tiempo.\"}, {\"language_code\": \"de_de\", \"string\": \"Nur aktiv, wenn <code>schedule</code> in der <a href=\\\"#INTRNT_RUN\\\"><code>INTRNT_RUN</code>Einstellung</a> ausgew\\u00e4hlt wurde. Sichergehen, dass das Intervall in einem korrekten cron-\\u00e4hnlichen Format angegeben wurde (z.B. auf <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a> testen). <code>0 4 * * *</code> w\\u00fcrde den Scan t\\u00e4glich um 4 Uhr in der <a onclick=\\\"toggleAllSettings()\\\" href=\\\"#TIMEZONE\\\">oben ausgew\\u00e4hlten <code>TIMEZONE</code></a> starten. Wird erst beim N\\u00c4CHSTEN Intervall ausgef\\u00fchrt. <br/>Es wird empfohlen, das Intervall aller Plugins, welche nach neuen Ger\\u00e4ten suchen, auf den gleichen Wert zu setzen.\"}]}"
INTRNT_RUN_TIMEOUT=30
INTRNT_RUN_TIMEOUT__metadata="{\"function\": \"RUN_TIMEOUT\", \"type\": \"integer\", \"default_value\": 30, \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Run timeout\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo l\\u00edmite de ejecuci\\u00f3n\"}, {\"language_code\": \"de_de\", \"string\": \"Zeitlimit\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted.\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo m\\u00e1ximo en segundos para esperar a que finalice el script. Si se supera este tiempo, el script se cancela.\"}, {\"language_code\": \"de_de\", \"string\": \"Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei \\u00dcberschreitung dieser Zeit wird das Skript abgebrochen.\"}]}"
INTRNT_WATCH=['Watched_Value1']
INTRNT_WATCH__metadata="{\"function\": \"WATCH\", \"type\": \"text.multiselect\", \"default_value\": [\"Watched_Value1\"], \"options\": [\"Watched_Value1\", \"Watched_Value2\", \"Watched_Value3\", \"Watched_Value4\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Watched\"}, {\"language_code\": \"es_es\", \"string\": \"Visto\"}, {\"language_code\": \"de_de\", \"string\": \"\\u00dcberwacht\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Send a notification if selected values change. Use <code>CTRL + Click</code> to select/deselect. <ul> <li><code>Watched_Value1</code> is Previous IP (not recommended)</li><li><code>Watched_Value2</code> unused</li><li><code>Watched_Value3</code> unused </li><li><code>Watched_Value4</code> unused </li></ul>\"}, {\"language_code\": \"de_de\", \"string\": \"Sende eine Benachrichtigung, wenn ein ausgw\\u00e4hlter Wert sich \\u00e4ndert. <code>STRG + klicken</code> zum aus-/abw\\u00e4hlen. <ul> <li><code>Watched_Value1</code> ist die Vorige IP (nicht empfohlen)</li><li><code>Watched_Value2</code> ist nicht in Verwendung</li><li><code>Watched_Value3</code> ist nicht in Verwendung </li><li><code>Watched_Value4</code> ist nicht in Verwendung </li></ul>\"}]}"
INTRNT_REPORT_ON=['new','watched-changed']
INTRNT_REPORT_ON__metadata="{\"function\": \"REPORT_ON\", \"type\": \"text.multiselect\", \"default_value\": [\"new\", \"watched-changed\"], \"options\": [\"new\", \"watched-changed\", \"watched-not-changed\", \"missing-in-last-scan\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Report on\"}, {\"language_code\": \"es_es\", \"string\": \"Informar sobre\"}, {\"language_code\": \"de_de\", \"string\": \"Benachrichtige wenn\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Send a notification only on these statuses. <code>new</code> means a new unique (unique combination of PrimaryId and SecondaryId) object was discovered. <code>watched-changed</code> means that selected <code>Watched_ValueN</code> columns changed.\"}, {\"language_code\": \"es_es\", \"string\": \"Env\\u00ede una notificaci\\u00f3n solo en estos estados. <code>new</code> significa que se descubri\\u00f3 un nuevo objeto \\u00fanico (una combinaci\\u00f3n \\u00fanica de PrimaryId y SecondaryId). <code>watched-changed</code> significa que las columnas <code>Watched_ValueN</code> seleccionadas cambiaron.\"}, {\"language_code\": \"de_de\", \"string\": \"Benachrichtige nur bei diesen Status. <code>new</code> bedeutet ein neues eindeutiges (einzigartige Kombination aus PrimaryId und SecondaryId) Objekt wurde erkennt. <code>watched-changed</code> bedeutet eine ausgew\\u00e4hlte <code>Watched_ValueN</code>-Spalte hat sich ge\\u00e4ndert.\"}]}"

docker-compose.yml

don't have one

What branch are you running?

Production

app.log

This is IPChanges.log:

[2024-05-06 11:15:17] xx.134.136.yy [2024-05-06 11:20:31] xx.134.136.yy [2024-05-06 11:25:50] 0.0.0.0 [2024-05-06 11:30:59] xx.134.136.yy

This is app.log: 11:25:45 [Scheduler] - Scheduler run for INTRNT: YES 11:25:45 [Plugin utils] --------------------------------------------- 11:25:45 [Plugin utils] display_name: Internet-Check 11:25:45 [Plugins] CMD: python3 /app/front/plugins/internet_ip/script.py prev_ip={prev_ip} INTRNT_DIG_GET_IP_ARG={INTRNT_DIG_GET_IP_ARG} 11:25:45 [Plugin utils] Flattening the below array 11:25:45 ['xx.134.136.yy'] 11:25:45 [Plugin utils] isinstance(arr, list) : True | isinstance(arr, str) : False 11:25:45 [Plugin utils] Flattened array: xx.134.136.yy 11:25:45 [Plugins] Resolved value: xx.134.136.yy 11:25:45 [Plugins] Convert to Base64: False 11:25:45 [Plugins] setTyp: text 11:25:45 [Plugins] Resolved value: -4 myip.opendns.com @resolver1.opendns.com 11:25:45 [Plugins] Convert to Base64: True 11:25:45 [Plugins] base64 value: b'LTQgbXlpcC5vcGVuZG5zLmNvbSBAcmVzb2x2ZXIxLm9wZW5kbnMuY29t' 11:25:45 [Plugins] Timeout: 30 11:25:45 [Plugin utils] Pre-Resolved CMD: python3/app/front/plugins/internet_ip/script.pyprev_ip={prev_ip}INTRNT_DIG_GET_IP_ARG={INTRNT_DIG_GET_IP_ARG} 11:25:45 [Plugins] Executing: python3 /app/front/plugins/internet_ip/script.py prev_ip={prev_ip} INTRNT_DIG_GET_IP_ARG={INTRNT_DIG_GET_IP_ARG} 11:25:45 [Plugins] Resolved : ['python3', '/app/front/plugins/internet_ip/script.py', 'prev_ip=xx.134.136.yy', "INTRNT_DIG_GET_IP_ARG=b'LTQgbXlpcC5vcGVuZG5zLmNvbSBAcmVzb2x2ZXIxLm9wZW5kbnMuY29t'"] 11:25:45 [INTRNT] In script 11:25:45 [INTRNT] INTRNT_DIG_GET_IP_ARG: -4 myip.opendns.com @resolver1.opendns.com 11:25:45 [INTRNT] - Retrieving Internet IP 11:25:50 [INTRNT] DIG result : ;; communications error to 208.67.222.222#53: timed out xx.134.136.yy 11:25:50 [INTRNT] Current internet_IP : 0.0.0.0 11:25:50 [INTRNT] previous_IP : xx.134.136.yy 11:25:50 [INTRNT] Finished

Debug enabled

  • [X] I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs.

todrees1967 avatar May 06 '24 17:05 todrees1967

Hi There,

Thanks a lot for this much detail.

You should be able to change the DNS server by adjusting the setting INTRNT_DIG_GET_IP_ARG:

image

jokob-sk avatar May 06 '24 22:05 jokob-sk

Hi,

if I change the dns, I am no longer getting the right response, the command seems to be

dig -4 myip.opendns.com @resolver1.opendns.com

but if I am doing

dig -4 myip.opendns.com @dns.google.com

I not getting the right answer. Can you help me with that?

todrees1967 avatar May 07 '24 19:05 todrees1967

After checking https://askubuntu.com/questions/95910/command-for-determining-my-public-ip, it seems, that this dig command can be only used with OpenDNS to retrieve the IP. There are other options, but they are using a different command.

Any suggestions?

todrees1967 avatar May 07 '24 19:05 todrees1967

Hi there,

Could you please try this setting?

@ns1.google.com -t txt o-o.myaddr.l.google.com

jokob-sk avatar May 07 '24 22:05 jokob-sk

Hi there,

also with a different DNS provider the problem remains the same. I tried this command many times directly on the same linux server using the shell and I never got a problem. Is there anyway to take a more detailed trace on executing the command?

todrees1967 avatar May 11 '24 19:05 todrees1967

Hi there,

Can you post the logs with the google DNS in place? I'm starting to think that if 2 different DNS server configs produce the same result then potentially the internet is actually down during the scan. Would that be possible?

jokob-sk avatar May 16 '24 10:05 jokob-sk

Hi there,

the error message reimains the same:

10:45:12 [INTRNT] In script 10:45:12 [INTRNT] INTRNT_DIG_GET_IP_ARG: -4 @ns1.google.com -t txt o-o.myaddr.l.google.com 10:45:12 [INTRNT] - Retrieving Internet IP 10:45:17 [INTRNT] DIG result : ;; communications error to 216.239.32.10#53: timed out "xx.yyy.zzz.xx" 10:45:17 [INTRNT] Current internet_IP : 0.0.0.0

I know for sure, that the internet is not down. I am working from homeoffice, if at the that time the connection was down, I would habe recognized it.

NetAlertx runs on Docker on an Ubuntu 22 LTS Server, that is connected with LAN to the router. The server itself has a lot power, i7with 32 GM RAM and SSD on NVME.

I have create a script in parallel that runs on the Ubuntu host itself, using the same command. And I have to admit, that sometimes I am also getting a timeout here.

So far I have no idea, what causese htis problem. Since the time of occurences really vary, it might be only a very little temporary problem. At least my router does not show reconnect in this log.

What do you think of sending the DIG command three times in a row and only if all three commands are failing having a corresponding messsage in the log?

todrees1967 avatar May 19 '24 20:05 todrees1967

This should be available in the next release. Please have a look at the netalertx-dev docker image, in about 15 minutes (or after the last action finishes) from now.

Make sure you refresh your browser cache - and click the πŸ”„ refresh button in the top right corner.

It would be great if you could test this (backup everything first or use a new container) on your end by switching to the above image and letting me know if the issue was resolved.

Thanks in advance, j

jokob-sk avatar May 25 '24 02:05 jokob-sk

closing -> releasing in ~10min

jokob-sk avatar Jun 08 '24 14:06 jokob-sk

Hi there, sorry for coming back that late, i was on vacation and some time off. I just updated the image and will come back here, if this happens again. Thanks for fixing this.

todrees1967 avatar Jun 08 '24 20:06 todrees1967