BlockchainFUE infraestructure monitor.
BCFMonitor is a simple service monitor that allows, without any complications, to have a simple email alert when one of the critical services is not responding.
It consists of an executable and a very straightforward configuration file in YAML format.
Installing it is as easy as copying both files to a server and starting the service, for example with a systemd unit, one is included as an example and a Makefile that allows you to install everything and start the service.
Check if you are looking for at least two of this principles before to use this software:
- KISS: Keep it simple, stupid!
- SRP: Single Responsibility Principle.
- IHNT: I have no time!
- FAIF: Free as in freedom.
Just go to the releases page:
If you can't find your arquitecture, please, raise an issue.
tar xvzf bcf-monitor_linux-amd64_1.2.tar.gz
cd bcf-monitor_linux-amd64_1.2
scp bcf-monitor [email protected]:/usr/local/bin/.
mv example.yaml bcf-monitor-prod.yaml
Edit the yaml
and configure your runners, the smtp and the administrative contacts.
At this time we are only supporting the monitorization of
- ping:
- Using the system
ping
command. If we use ICMP then we need root privileges.
- Using the system
- mongodb
- redis
- web applications:
- GET request with or without aditional headers.
- In addition it looks for a needle text in the html.
Upload to /etc
:
scp bcf-monitor-prod.yml [email protected]:/etc/.
/usr/local/bin/bcf-monitor -c /etc/bcf-monitor-prod.yaml
Now you can define a systemd unit, a daemontools svc or whatever you want to have it alwais running.
Create this file in /etc/systemd/system/.
:
[Unit]
Description=BCF Monitor
After=network.target auditd.service
[Service]
Type=simple
ExecStart=/usr/local/bin/bcf-monitor -c /etc/bcf-monitor-prod.yaml
Restart=always
User=root
WorkingDirectory=/usr/local/bin
[Install]
WantedBy=multi-user.target
Alias=bcf-monitor.service
Load the unit and start the service:
systemctl daemon-reload
service bcf-monitor restart
Watch the log to see if all is working fine:
journalctl -efu bcf-monitor
git clone [email protected]:jorgefuertes/bcf-monitor.git
cd bcf-monitor
Create a .secrets
file like this one:
SERVER=api.blockchainfue.com
Take a look into the make file if you need to modify something or add any other architecture.
Copy example.yaml
cp conf/example.yaml conf/prod.yaml
Edit prod.yaml
and configure your runners, the smtp and the administrative contacts.
At this time we are only supporting the monitorization of mongodb, redis and web applications via GET request with or without aditional headers. In addition it looks for a needle text in the html.
You may need to raise some tunnels to be allowed to reach the remote services or you can replicate the services on your local machine.
Copy prod.yaml
to dev.yaml
and configure it properly. Remember to keep only you as admin in order to don't disturb anyone else.
make run
By default we are building a binary to a GNU/Linux OS, with amd64 architecture. You'll need to adjust the Makefile
if it doesn't suit your server, but it's pretty easy.
make publish
- Pull requests are welcome.
- New runners are welcome, always respecting the KISS principle, please.
- Open an issue if you need help or you reach a bug.
- Alerting by telegram.
- Simple authenticated webpage to watch the status in real time.
- New runners:
- MySQL.
- Postgres.
- Memcached.
- Nginx.
- SMTP, IMAP.
- POST in addition to GET.
- etc...
Feel you free to improve it and make a pull request.
©2023 Jorge Fuertes Alfranca
This software is licensed under GNU GPL v3.
You have a copy of this license in this repository, file: gpl-3.0.txt
, or you can read it online here: