jokob-sk / NetAlertX

🖧🔍 WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
2.84k stars 163 forks source link

Status Column Never Shows "New" #549

Closed clockwinder closed 7 months ago

clockwinder commented 8 months ago

Is there an existing issue for this?

Current Behavior

After selecting the "New devices" tab, all devices with the new device box ticked show "online".

image

Expected Behavior

I would expect these items to have the yellow "new" status, like I've seen in screenshots. This would be nice because then I could see new devices in the main "all devices" list.

I assume this is just a user issue, or misunderstanding, but there didn't seem to be a more casual route to asking how this feature is expected to work.

Steps To Reproduce

  1. A new docker install
  2. scan new devices on network

pialert.conf

My only changes so far are to `SCAN_SUBNETS` for device, and adding smtp notifications.

docker-compose.yml

version: "3"
services:
  pialert:
    container_name: pialert
    # use the below line if you want to test the latest dev image
    # image: "jokobsk/pi.alert_dev:latest" 
    image: jokobsk/pi.alert:latest
    network_mode: host
    restart: unless-stopped
    volumes:
      - /:/home/pi/pialert/config
      - /:/home/pi/pialert/db
      # (optional) useful for debugging if you have issues setting up the container
      - /:/home/pi/pialert/front/log
    environment:
      - TZ=America/Denver
      - HOST_USER_ID=
      - HOST_USER_GID=
    ports:
      - 20211:20211

What branch are you running?

Production

pialert.log

14:36:34 The container restarted (started). If this is unexpected check https://bit.ly/PiAlertDebug for troubleshooting tips. 

14:36:34 Permissions check (All should be True) 14:36:34 ------------------------------------------------ 14:36:34 /config/pialert.conf | READ | True 14:36:34 /config/pialert.conf | WRITE | True 14:36:34 /db/pialert.db | READ | True 14:36:34 /db/pialert.db | WRITE | True 14:36:34 ------------------------------------------------ 14:36:34 [Setup] Attempting to fix permissions. 14:36:34 [Setup] Attempting to fix permissions. 14:36:34 [Database] Opening DB 14:36:34 [upgradeDB] Re-creating Settings table 14:36:34 [upgradeDB] Re-creating Pholus_Scan table 14:36:34 [upgradeDB] Re-creating Parameters table 14:36:34 [Config] reading config file 14:36:34 [Config] Plugins: Number of dynamically loaded plugins: 26 14:36:34 [Plugin utils] --------------------------------------------- 14:36:34 [Plugin utils] display_name: Rogue DHCP 14:36:34 [Plugin utils] description: This plugin is to use NMAP to monitor for rogue DHCP servers. 14:36:34 [Plugin utils] --------------------------------------------- 14:36:34 [Plugin utils] display_name: Maintenance 14:36:34 [Plugin utils] description: A plugin for maintenance tasks. 14:36:34 [Plugin utils] --------------------------------------------- 14:36:34 [Plugin utils] display_name: Services & Ports (NMAP) 14:36:34 [Plugin utils] description: This plugin shows all services discovered by NMAP scans. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: Arp-Scan (Network scan) 14:36:35 [Plugin utils] description: This plugin is to execute an arp-scan on the local network 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: UniFi import 14:36:35 [Plugin utils] description: This plugin is used to import devices from an UNIFI controller. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: Pushsafer publisher 14:36:35 [Plugin utils] description: A plugin to publish a notification via the Pushsafer gateway. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: Apprise publisher 14:36:35 [Plugin utils] description: A plugin to publish a notification via the Apprise gateway. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: DHCP Leases (Device import) 14:36:35 [Plugin utils] description: This plugin is to import devices from dhcp.leases files. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: DB cleanup 14:36:35 [Plugin utils] description: A plugin to schedule database cleanup & upkeep tasks. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: Website monitor 14:36:35 [Plugin utils] description: This plugin is to monitor status changes of services or websites. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: Un-Discoverable Devices 14:36:35 [Plugin utils] description: This plugin is to import undiscoverable devices from a file. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: SNMP discovery 14:36:35 [Plugin utils] description: This plugin is used to discover devices via the arp table(s) of a RFC1213 compliant router or switch. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: New Devices 14:36:35 [Plugin utils] description: The template used for new devices. 14:36:35 [Plugin utils] --------------------------------------------- 14:36:35 [Plugin utils] display_name: MQTT publisher 14:36:35 [Plugin utils] description: A plugin to publish a notification via the Apprise gateway. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Notification Processing 14:36:36 [Plugin utils] description: A plugin to for advanced notification processing. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Vendor update 14:36:36 [Plugin utils] description: A plugin to schedule vendor database updates for mac based vendor resolution. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: DDNS update 14:36:36 [Plugin utils] description: A plugin update the DDNS record. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Set password 14:36:36 [Plugin utils] description: A simple plugin to set the web ui password on app start. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Webhook publisher 14:36:36 [Plugin utils] description: A plugin to publish a notification via Webhooks. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Pholus-Scan (Name discovery) 14:36:36 [Plugin utils] description: This plugin is to execute a Pholus-scan (name discovery) on the local network 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Email publisher (SMTP) 14:36:36 [Plugin utils] description: A plugin to publish a notification via Email (SMTP) gateway. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: NTFY publisher 14:36:36 [Plugin utils] description: A plugin to publish a notification via the NTFY gateway. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: CSV backup 14:36:36 [Plugin utils] description: A plugin to auto-generate devices.csv backups. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Internet speedtest 14:36:36 [Plugin utils] description: A plugin to perform a scheduled internet speedtest. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: Internet-Check 14:36:36 [Plugin utils] description: A plugin to check your internet connectivity and IP. 14:36:36 [Plugin utils] --------------------------------------------- 14:36:36 [Plugin utils] display_name: PiHole (Device sync) 14:36:36 [Plugin utils] description: This plugin syncs devices from the PiHole database 14:36:37 [API] Update API starting 14:36:37 [API] Updating table_settings.json file in /front/api 14:36:37 [Plugins] Check if any plugins need to be executed on run type: before_config_save 14:36:37 [Config] Imported new config 14:36:37 [Plugins] Check if any plugins need to be executed on run type: once 14:36:37 [API] Update API starting 14:36:37 [API] Updating table_devices.json file in /front/api 14:36:37 [API] Updating table_events_pending_alert.json file in /front/api 14:36:37 [API] Updating table_plugins_events.json file in /front/api 14:36:37 [API] Updating table_plugins_history.json file in /front/api 14:36:37 [API] Updating table_plugins_objects.json file in /front/api 14:36:37 [API] Updating table_plugins_language_strings.json file in /front/api 14:36:37 [API] Updating table_notifications.json file in /front/api 14:36:37 [API] Updating table_custom_endpoint.json file in /front/api 14:36:37 [Plugins] Check if any plugins need to be executed on run type: schedule 14:36:37 [Scheduler] - Scheduler run for MAINT: NO 14:36:37 [Scheduler] - Scheduler run for ARPSCAN: NO 14:36:37 [Scheduler] - Scheduler run for DBCLNP: NO 14:36:37 [Scheduler] - Scheduler run for VNDRPDT: NO 14:36:37 [Scheduler] - Scheduler run for CSVBCKP: NO 14:36:37 [Scheduler] - Scheduler run for INTRNT: NO 14:36:37 [Plugins] Check if any plugins need to be executed on run type: always_after_scan 14:36:37 [MAIN] processScan: False 14:36:37 [Notification] Check if something to report

Debug enabled

jokob-sk commented 8 months ago

Thanks for the report!

I changed the priority, so the most important is the New status:

  if(item.dev_NewDevice === 1)
  {
    return 'New';
  }
  else if(item.dev_PresentLastScan === 1)
  {
    return 'On-line';
  }
  else if(item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown  !== 0)
  {
    return 'Down';
  }
  else if(item.dev_Archived === 1)
  {
    return 'Archived';
  }
  else if(item.dev_PresentLastScan === 0)
  {
    return 'Off-line';
  }

This will be available after the next release.

clockwinder commented 8 months ago

Oh great, thanks. I just felt like I was at a loss for "proper" use of this utility!

jokob-sk commented 7 months ago

released -> closing

Tharic99 commented 7 months ago

I saw this was included in the new update and I'm curious what the "process" is here now.

At what point does a "new" device transition into... "not new" ?

jokob-sk commented 7 months ago

Hi @Tharic99 ,

The NEW flag is currently only managed manually, however an automation of this is being discussed in this issue:

https://github.com/jokob-sk/Pi.Alert/issues/562