Moved additional variables into .env file, updated README.md.

This commit is contained in:
Tanner van Teeffelen 2026-05-12 17:29:08 -04:00
parent bfd8e4fa36
commit d04c18d5da
2 changed files with 16 additions and 3 deletions

View file

@ -12,18 +12,31 @@ The following environment variables must be defined in your `.env` file:
- **API_KEY** - **API_KEY**
Your Cisco Meraki API key used to access and manage Meraki networks. Your Cisco Meraki API key used to access and manage Meraki networks.
`Required by every script.`
- **NETWORK_ID**
The network ID of the network you want to parse.
`Required by deviceCheck.py.`
- **DEVICE_MAC**
The MAC address of the device you want to monitor.
`Required by deviceCheck.py.`
- **SMTP_SERVER** - **SMTP_SERVER**
Your outgoing SMTP mail server address. Your outgoing SMTP mail server address.
`Required by deviceCheck.py.`
- **SMTP_PORT** - **SMTP_PORT**
Your outgoing SMTP mail server port. Your outgoing SMTP mail server port.
`Required by deviceCheck.py.`
- **SMTP_EMAIL** - **SMTP_EMAIL**
The email address used to send notifications. The email address used to send notifications.
`Required by deviceCheck.py.`
- **SMTP_PASS** - **SMTP_PASS**
The password for the SMTP email account. The password for the SMTP email account.
`Required by deviceCheck.py.`
--- ---

View file

@ -8,8 +8,8 @@ load.dotenv()
#Variable declaration. #Variable declaration.
API_KEY = os.getenv("API_KEY") API_KEY = os.getenv("API_KEY")
NETWORK_ID = "N_573646002536361150" NETWORK_ID = os.getenv("NETWORK_ID")
CLIENT_MAC = "e4:f1:4c:7e:eb:7a" CLIENT_MAC = os.getenv("CLIENT_MAC")
#Passes the API key to the header. #Passes the API key to the header.
HEADERS = { HEADERS = {
@ -72,7 +72,7 @@ while True:
send_email( send_email(
subject="Meraki Alert", subject="Meraki Alert",
body="Client " + CLIENT_MAC + " is offline!", body="Client " + CLIENT_MAC + " is offline!",
to_email="tanner@acoservices.com" to_email=os.getenv("SMTP_RECEIVER")
) )
#Wait a minute before checking again. #Wait a minute before checking again.