chatgpt420
New member
Hello MNOs,
I've put together a python script to assist in monitoring, and hopefully rescuing, your VPS before incurring pose penalties.
This is achieved by monitoring CPU, memory and disk usage, and sending out an early warning email before you run out of resources.
In the event that memory usage climbs to 96%, the script will send out an email alert and immediately reboot the server to prevent a crash - not very elegant I know, but desperate times call for desperate measures!
Now the exciting feature for specific to MNOs - regular automatic port checks for all IPs connected to the VPS - no additional configuration required!
The script will gather all connected IP addresses and check them against the port test the owners of https://mnowatch.org have built into their site - thanks guys
Ports will be checked every 10 minutes and an email alert will be sent listing all of the offending IP addresses.
Setup of the script is quite straight forward so long as you;
- have root access to the system
- are running a linux vps with some swap space configured (this requirement can be removed in future iterations)
- have some SMTP credentials handy
Installation
---
Log into your VPS as root
Download the code into a suitable directory --- git clone https://github.com/chatgpt420/nodemonitor.git
Run the 'firstrun.py script in python --- python3 firstrun.py
Follow the prompts until you see some system stats being printed at 10 second intervals, then quit the process (Ctrl-c)
During the installation a service file is installed and enabled to ensure the script is always running.
To make sure the email alerts will be working when you need them, stop one of your dashd instances and wait 10 minutes
I'm on discord as 'BitterSeaTrading' if you have any questions, though I'll check in here too
Feedback and suggestions welcome
I've put together a python script to assist in monitoring, and hopefully rescuing, your VPS before incurring pose penalties.
This is achieved by monitoring CPU, memory and disk usage, and sending out an early warning email before you run out of resources.
In the event that memory usage climbs to 96%, the script will send out an email alert and immediately reboot the server to prevent a crash - not very elegant I know, but desperate times call for desperate measures!
Now the exciting feature for specific to MNOs - regular automatic port checks for all IPs connected to the VPS - no additional configuration required!
The script will gather all connected IP addresses and check them against the port test the owners of https://mnowatch.org have built into their site - thanks guys
Ports will be checked every 10 minutes and an email alert will be sent listing all of the offending IP addresses.
Setup of the script is quite straight forward so long as you;
- have root access to the system
- are running a linux vps with some swap space configured (this requirement can be removed in future iterations)
- have some SMTP credentials handy
Installation
---
Log into your VPS as root
Download the code into a suitable directory --- git clone https://github.com/chatgpt420/nodemonitor.git
Run the 'firstrun.py script in python --- python3 firstrun.py
Follow the prompts until you see some system stats being printed at 10 second intervals, then quit the process (Ctrl-c)
During the installation a service file is installed and enabled to ensure the script is always running.
To make sure the email alerts will be working when you need them, stop one of your dashd instances and wait 10 minutes
I'm on discord as 'BitterSeaTrading' if you have any questions, though I'll check in here too
Feedback and suggestions welcome