Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fresh installation. Changing static to dhcp and different network broke pi.alert #261

Closed
rubencastello90 opened this issue Oct 9, 2024 · 1 comment

Comments

@rubencastello90
Copy link

Hello,

I'm facing a very rare issue with Pi.Alert that is not discovering new devices.

Just fresh install, tried with Ubuntu 24.01 and Debian 12. Initial SCAN, when machine is configured in DHCP and have access to Internet, is working without problem and discovering devices.

When installation is done, I change DHCP to STATIC (same interface) and change Pi-alert from network/vlan, because I want it running on a dedicated OFFLINE (No internet) VLAN.

Since this is done, logs shows error and devices are not updated/discovered

Output log:

Pi.Alert v2024-09-28
---------------------------------------------------------
Executing user: XXXXX

Scan Devices
    Timestamp: 2024-10-09 12:10:00

Scanning...
    arp-scan Method...
    arp-scan: One interface
    Pi-hole 5 Client List Method... Skipped
    Pi-hole 5 DHCP Leases Method... Skipped
    Fritzbox Method... Skipped
    Mikrotik Method... Skipped
    UniFi Method... Skipped
    Satellite Import... Skipped

Processing scan results...
Traceback (most recent call last):
File "/home/iberpotash/pialert/back/pialert.py", line 3817, in
    sys.exit(main())    
             ^^^^^^
File "/home/iberpotash/pialert/back/pialert.py", line 100, in main
    res = scan_network()
         ^^^^^^^^^^^^^^
File "/home/iberpotash/pialert/back/pialert.py", line 774, in scan_network
    save_scanned_devices (arpscan_devices, cycle_interval)
File "/home/iberpotash/pialert/back/pialert.py", line 1555, in save_scanned_devices
    internet_IP = get_internet_IP()
                 ^^^^^^^^^^^^^^^^^
File "/home/iberpotash/pialert/back/pialert.py", line 516, in get_internet_IP
    cmd_output = subprocess.check_output (curl_args, universal_newlines=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['curl', '-s', 'https://myipv4.p1.opendns.com/get_my_ip']' returned non-zero exit status 6.
[CONF.txt](https://github.com/user-attachments/files/17306318/CONF.txt)

A simple arp-scan via CLI is working great discovering devices:

 XXX@ot-vm-pialert:~$ sudo arp-scan -l
 Interface: ens192, type: EN10MB, MAC: 00:50:56:98:52:77, IPv4: 172.16.0.8
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
172.16.0.1      00:00:5e:00:01:01       VRRP (last octet is VRID)
172.16.0.2      18:fd:74:83:a7:43       Routerboard.com
172.16.0.3      18:fd:74:83:9d:74       Routerboard.com
 172.16.0.10     00:60:c2:1b:07:fc       MPL AG
172.16.0.20     00:0c:29:c6:c5:38       VMware, Inc.
172.16.0.105    00:30:11:0a:9d:31       HMS Industrial Networks

Example of interface confiuration
CONF.txt

XXX@ot-vm-pialert:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens192
iface ens192 inet static
        address 172.16.0.8
        netmask 255.255.255.0
        gateway 172.16.0.1

Attached also conf from pialert.
Attached image shows only the first scanned when pi.alert was configured in the vlan with internet.
FIRST SCAN DISCOVERED

@jokob-sk
Copy link

jokob-sk commented Oct 9, 2024

Please close this issue and open it at the correct github repo. Look at #235 and #237

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants