Giter Site home page Giter Site logo

Comments (11)

leiweibau avatar leiweibau commented on June 16, 2024

Please check the Permissions. Have you checked the FAQ/Help section? There is an entry about "read only" db.

from pi.alert.

intheshell avatar intheshell commented on June 16, 2024

Thanks, but I have a question. It turns out that the database is not locked when I remove the "offline mode", it will be that some process takes the database by modifying the lines:

# Get Internet IP
print ('\nRetrieving Internet IP...')
internet_IP = get_internet_IP()
# TESTING - Force IP
    # internet_IP = "1.2.3.4"

to:

# Get Internet IP
print ('\nRetrieving Internet IP...')
# internet_IP = get_internet_IP()
# TESTING - Force IP
internet_IP = "0.0.0.0"

Also the section beginning in line 702 from:

# Check Internet connectivity
internet_IP = get_internet_IP()
    # TESTING - Force IP
    # internet_IP = ""

to

# Check Internet connectivity
# internet_IP = get_internet_IP()
    # TESTING - Force IP
internet_IP = "0.0.0.0"

from pi.alert.

leiweibau avatar leiweibau commented on June 16, 2024

Can you show me you pialert.conf, especially the Pi-hole Configuration?

from pi.alert.

intheshell avatar intheshell commented on June 16, 2024

Yes ,sure 👍

Pi-hole Configuration

----------------------

PIHOLE_ACTIVE = True
PIHOLE_DB = '/etc/pihole/pihole-FTL.db'
DHCP_ACTIVE = False
DHCP_LEASES = '/etc/pihole/dhcp.leases'

from pi.alert.

leiweibau avatar leiweibau commented on June 16, 2024

Why is PIHOLE_ACTIVE = True when you are in an offline network? Please set it to False

from pi.alert.

intheshell avatar intheshell commented on June 16, 2024

ok thanks, i Disable the pihole_active, but persist:

arp-scan Method...
Pi-hole Method...
DHCP Leases Method...

Processing scan results...
Traceback (most recent call last):
File "/root/pialert/back/pialert.py", line 1776, in
sys.exit(main())
File "/root/pialert/back/pialert.py", line 97, in main
res = scan_network()
File "/root/pialert/back/pialert.py", line 465, in scan_network
save_scanned_devices (arpscan_devices, cycle_interval)
File "/root/pialert/back/pialert.py", line 654, in save_scanned_devices
sql.execute ("DELETE FROM CurrentScan WHERE cur_ScanCycle = ?",
sqlite3.OperationalError: database is locked
^@^@^@^@^@^@^@^@^@^@................

thanks for help me

from pi.alert.

leiweibau avatar leiweibau commented on June 16, 2024

With the "offline" fix and disabling Pi-Hole, I can't reproduce your error unfortunately. Here everything works as it should.
At this point I would try to either restore a backup of my database or start again with an empty database from my fork.

from pi.alert.

intheshell avatar intheshell commented on June 16, 2024

Hi Master, I have been looking for the reason why it could eventually be failing and I noticed that the database session is taken and apparently it is due to the process of... Trying to resolve devices without name...

will it be so?

Devices Detected.......: 63
arp-scan Method....: 61
Pi-hole Method.....: +0
New Devices........: 0

Devices in this cycle..: 63
    Down Alerts........: 0
    New Down Alerts....: 0
    New Connections....: 1
    Disconnections.....: 2
    IP Changes.........: 0

Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name....

root@rle2ag-1:/pialert/log# cd ..
root@rle2ag-1:
/pialert# cd db
root@rle2ag-1:/pialert/db# sudo fuser -v pialert.db
USER PID ACCESS COMMAND
/root/pialert/db/pialert.db:
root 6157 F.... python3
root@rle2ag-1:
/pialert/db#

from pi.alert.

leiweibau avatar leiweibau commented on June 16, 2024

Based on your findings, you can try the following. Search

    print_log ('   Resolve devices names...')
    update_devices_names()

and change it to

    print_log ('   Resolve devices names...')
    # update_devices_names()

It is possible that you have to kill running scans.
But I admit that it hurts a bit to cripple the software more and more :(

from pi.alert.

intheshell avatar intheshell commented on June 16, 2024

If you are absolutely right, I believe that now the software is 100% in offline mode, since it does not make queries outside its network, therefore it is useful in case of having a panel to manage alerts without internet access (there are still , believe it or not) .

Thank you very much, it is solved.

from pi.alert.

leiweibau avatar leiweibau commented on June 16, 2024

I'm happy to hear that.
Please note that you have to repeat these changes when you install an update. I will rename this issue so that it is obvious that there is information worth knowing here. At this time, I do not plan to "officially" include this mode.

from pi.alert.

Related Issues (20)

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.