Auto detecting a website is down & restore

Zerojam

Active Member
Sep 13, 2018
7
0
41
43
Hello.

I like to know if we have any existing service or plugins for Proxmox that...

  1. Can detect when a website is down (when returning status other than 200, 201, 202)
  2. When receiving error codes like 404, it auto-recovers the VM from the last snapshot
Also would be nice if we could also cron the following too...

  1. Auto-create snapshots on hourly / daily basis

This would save tons of hours & human-resource on this, any suggestions given are appreciated.
 
You've got dedicated software for site's monitoring (nagios, zabbix, prometheus, etc.). Requesting to have it in Proxmox wastes tons of hours & human-resource in Proxmox dev team ;-)
 
You can easily create bash scripts that do all this stuff and run them on your host using the crontab

I was thinking of that, do you have any existing scripts or documents that could point me in the right direction?

Greatly appreciated.
 
Monit, something like this:

check process squid3 with pidfile /var/run/squid3.pid
group proxy
start program = "/etc/init.d/squid3 start"
stop program = "/etc/init.d/squid3 stop"
if failed host localhost port 3128
send "GET /monit-check HTTP/1.0\r\n\r\n"
expect "HTTP/[0-9\.]{3} 400 .*\r\n"
for 5 cycles then restart

Se here more eaxamples:

https://mmonit.com/wiki/Monit/ConfigurationExamples
 
I was thinking of that, do you have any existing scripts or documents that could point me in the right direction?

Greatly appreciated.
Unfortunately I don't have any existing scrips that does that but it's pretty easy. Depending on the file system you are using on your host you can use curl to probe the site and if it returns a certain code then restore the snapshot.

I found this link maybe it can help.

The automatic snapshot is pretty easy and you can create the snapshot name based on the current time then delete the ones where the name includes a date older than X days.

Hope it helps
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!