mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Doc
This commit is contained in:
40
README.md
40
README.md
@@ -38,31 +38,31 @@ The system consists of two parts:
|
|||||||
|
|
||||||
### Back
|
### Back
|
||||||
In charge of:
|
In charge of:
|
||||||
- Scan the network searching connected devices using the scanning methods
|
- Scan the network searching connected devices using the scanning methods
|
||||||
described
|
described
|
||||||
- Store the information in the DB
|
- Store the information in the DB
|
||||||
- Report the changes detected by e-mail
|
- Report the changes detected by e-mail
|
||||||
|
|
||||||
| ![Report 1][report1] | ![Report 2][report2] |
|
| ![Report 1][report1] | ![Report 2][report2] |
|
||||||
| -------------------- | -------------------- |
|
| -------------------- | -------------------- |
|
||||||
|
|
||||||
### Front
|
### Front
|
||||||
A web frontal that allows:
|
A web frontal that allows:
|
||||||
- Manage the devices inventory and the characteristics
|
- Manage the devices inventory and the characteristics
|
||||||
- Display in a visual way all the information collected by the back
|
- Display in a visual way all the information collected by the back
|
||||||
- Sessions
|
- Sessions
|
||||||
- Connected devices
|
- Connected devices
|
||||||
- Favorites
|
- Favorites
|
||||||
- Events
|
- Events
|
||||||
- Presence
|
- Presence
|
||||||
- Concurrent devices
|
- Concurrent devices
|
||||||
- Down alerts
|
- Down alerts
|
||||||
- IP's
|
- IP's
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
| ![Screen 1][screen1] | ![Screen 2][screen2] |
|
| ![Screen 1][screen1] | ![Screen 2][screen2] |
|
||||||
| -------------------- | -------------------- |
|
| -------------------- | -------------------- |
|
||||||
| ![Screen 3][screen3] | ![Screen 4][screen4] |
|
| ![Screen 3][screen3] | ![Screen 4][screen4] |
|
||||||
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|||||||
@@ -29,29 +29,29 @@ Estimated time: 20'
|
|||||||
3 - Start the raspberry
|
3 - Start the raspberry
|
||||||
|
|
||||||
4 - Login to the system with pi user
|
4 - Login to the system with pi user
|
||||||
```
|
```
|
||||||
user: pi
|
user: pi
|
||||||
password: raspberry
|
password: raspberry
|
||||||
```
|
```
|
||||||
|
|
||||||
5 - Change the default password of pi user
|
5 - Change the default password of pi user
|
||||||
```
|
```
|
||||||
passwd
|
passwd
|
||||||
```
|
```
|
||||||
|
|
||||||
6 - Setup the basic configuration
|
6 - Setup the basic configuration
|
||||||
```
|
```
|
||||||
sudo raspi-config
|
sudo raspi-config
|
||||||
```
|
```
|
||||||
|
|
||||||
7 - Optionally, configure a static IP in raspi-config
|
7 - Optionally, configure a static IP in raspi-config
|
||||||
|
|
||||||
8 - Update the OS
|
8 - Update the OS
|
||||||
```
|
```
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get upgrade
|
sudo apt-get upgrade
|
||||||
sudo reboot
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
## Pi-hole Setup
|
## Pi-hole Setup
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
@@ -63,16 +63,16 @@ Estimated time: 20'
|
|||||||
2 - Login to the system with pi user
|
2 - Login to the system with pi user
|
||||||
|
|
||||||
3 - Install Pi-hole
|
3 - Install Pi-hole
|
||||||
```
|
```
|
||||||
curl -sSL https://install.pi-hole.net | bash
|
curl -sSL https://install.pi-hole.net | bash
|
||||||
```
|
```
|
||||||
- Mark "Install web admin interface"
|
- Mark "Install web admin interface"
|
||||||
- Mark "Install web server lighttpd"
|
- Mark "Install web server lighttpd"
|
||||||
|
|
||||||
4 - Configure Pi-hole admin password
|
4 - Configure Pi-hole admin password
|
||||||
```
|
```
|
||||||
pihole -a -p PASSWORD
|
pihole -a -p PASSWORD
|
||||||
```
|
```
|
||||||
|
|
||||||
5 - Connect to web admin panel
|
5 - Connect to web admin panel
|
||||||
- http://192.168.1.x/admin/
|
- http://192.168.1.x/admin/
|
||||||
@@ -97,41 +97,41 @@ Estimated time: 20'
|
|||||||
## arp-scan & Python
|
## arp-scan & Python
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
1 - Install arp-scan utility and test
|
1 - Install arp-scan utility and test
|
||||||
```
|
```
|
||||||
sudo apt-get install arp-scan
|
sudo apt-get install arp-scan
|
||||||
sudo arp-scan -l
|
sudo arp-scan -l
|
||||||
```
|
```
|
||||||
|
|
||||||
2 - Install Python & packages
|
2 - Install Python & packages
|
||||||
```
|
```
|
||||||
sudo apt-get install python-setuptools
|
sudo apt-get install python-setuptools
|
||||||
sudo apt install python-pip
|
sudo apt install python-pip
|
||||||
|
|
||||||
pip install netaddr
|
pip install netaddr
|
||||||
pip install dpkt
|
pip install dpkt
|
||||||
pip install MacLookup
|
pip install MacLookup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Pi.Alert
|
## Pi.Alert
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
1- Download Pi.Alert and uncompress
|
1- Download Pi.Alert and uncompress
|
||||||
```
|
```
|
||||||
curl -LO https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_latest.tar
|
curl -LO https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_latest.tar
|
||||||
tar xvf pialert_latest.tar
|
tar xvf pialert_latest.tar
|
||||||
rm pialert_latest.tar
|
rm pialert_latest.tar
|
||||||
```
|
```
|
||||||
|
|
||||||
2 - Public the front portal
|
2 - Public the front portal
|
||||||
```
|
```
|
||||||
sudo ln -s /home/pi/pialert/front /var/www/html/pialert
|
sudo ln -s /home/pi/pialert/front /var/www/html/pialert
|
||||||
```
|
```
|
||||||
|
|
||||||
3 - Update lighttpd config
|
3 - Update lighttpd config
|
||||||
```
|
```
|
||||||
sudo sh -c "printf '\n\n\$HTTP[\"host\"] == \"pi.alert\" {\n server.document-root = \"/var/www/html/pialert/\"\n}\n' >> /etc/lighttpd/external.conf"
|
sudo sh -c "printf '\n\n\$HTTP[\"host\"] == \"pi.alert\" {\n server.document-root = \"/var/www/html/pialert/\"\n}\n' >> /etc/lighttpd/external.conf"
|
||||||
sudo /etc/init.d/lighttpd restart
|
sudo /etc/init.d/lighttpd restart
|
||||||
```
|
```
|
||||||
|
|
||||||
4 - If you want to use email reporting with gmail
|
4 - If you want to use email reporting with gmail
|
||||||
- Go to your Google Account https://myaccount.google.com/
|
- Go to your Google Account https://myaccount.google.com/
|
||||||
@@ -141,53 +141,53 @@ Estimated time: 20'
|
|||||||
- Click Save button
|
- Click Save button
|
||||||
|
|
||||||
5 - Config Pialert parameters
|
5 - Config Pialert parameters
|
||||||
```
|
```
|
||||||
nano ~/pialert/back/pialert.conf
|
nano ~/pialert/back/pialert.conf
|
||||||
```
|
```
|
||||||
- If you want to use email reporting, configure this parameters
|
- If you want to use email reporting, configure this parameters
|
||||||
```
|
```ini
|
||||||
REPORT_MAIL = True
|
REPORT_MAIL = True
|
||||||
SMTP_USER = 'user@gmail.com'
|
SMTP_USER = 'user@gmail.com'
|
||||||
SMTP_PASS = 'password'
|
SMTP_PASS = 'password'
|
||||||
REPORT_TO = 'user@gmail.com'
|
REPORT_TO = 'user@gmail.com'
|
||||||
```
|
```
|
||||||
|
|
||||||
- If you want to update your Dynamic DNS, configure this parameters
|
- If you want to update your Dynamic DNS, configure this parameters
|
||||||
```
|
```ini
|
||||||
DDNS_ACTIVE = True
|
DDNS_ACTIVE = True
|
||||||
DDNS_DOMAIN = 'your_domain.freeddns.org'
|
DDNS_DOMAIN = 'your_domain.freeddns.org'
|
||||||
DDNS_USER = 'dynu_user'
|
DDNS_USER = 'dynu_user'
|
||||||
DDNS_PASSWORD = 'A0000000B0000000C0000000D0000000'
|
DDNS_PASSWORD = 'A0000000B0000000C0000000D0000000'
|
||||||
DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?'
|
DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?'
|
||||||
```
|
```
|
||||||
|
|
||||||
- If you have installed Pi.hole and DHCP, activate this parameters
|
- If you have installed Pi.hole and DHCP, activate this parameters
|
||||||
```
|
```ini
|
||||||
PIHOLE_ACTIVE = True
|
PIHOLE_ACTIVE = True
|
||||||
DHCP_ACTIVE = True
|
DHCP_ACTIVE = True
|
||||||
```
|
```
|
||||||
|
|
||||||
6 - Update vendors DB
|
6 - Update vendors DB
|
||||||
```
|
```
|
||||||
python ~/pialert/back/pialert.py update_vendors
|
python ~/pialert/back/pialert.py update_vendors
|
||||||
```
|
```
|
||||||
|
|
||||||
7 - Test Pi.Alert Scan
|
7 - Test Pi.Alert Scan
|
||||||
```
|
```
|
||||||
python ~/pialert/back/pialert.py internet_IP
|
python ~/pialert/back/pialert.py internet_IP
|
||||||
python ~/pialert/back/pialert.py 1
|
python ~/pialert/back/pialert.py 1
|
||||||
```
|
```
|
||||||
|
|
||||||
8 - Add crontab jobs
|
8 - Add crontab jobs
|
||||||
```
|
```
|
||||||
(crontab -l 2>/dev/null; cat ~/pialert/back/pialert.cron) | crontab -
|
(crontab -l 2>/dev/null; cat ~/pialert/back/pialert.cron) | crontab -
|
||||||
```
|
```
|
||||||
|
|
||||||
9 - Add permissions to the web-server user
|
9 - Add permissions to the web-server user
|
||||||
```
|
```
|
||||||
sudo chgrp -R www-data ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
|
sudo chgrp -R www-data ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
|
||||||
chmod -R 770 ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
|
chmod -R 770 ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
|
||||||
```
|
```
|
||||||
|
|
||||||
10 - Check DNS record por pi.alert (explained in point 7 of Pi.hole installing)
|
10 - Check DNS record por pi.alert (explained in point 7 of Pi.hole installing)
|
||||||
- Add pi.alert DNS Record
|
- Add pi.alert DNS Record
|
||||||
|
|||||||
Reference in New Issue
Block a user