I
I
Ilya Rodionov2017-06-07 20:54:37
PHP
Ilya Rodionov, 2017-06-07 20:54:37

Automatically send a message if the API returns "0"?

Dear Toaster users!
A question arose, which, unfortunately, I cannot solve myself.
The bottom line is that there is a server that must be online 24/7. Every time it shuts down due to errors, I want to receive an email alert like "server down, restart"
How it should happen: minecraft-statistic.net has an API in which it returns the server status: online, if 0 - offline.
Tell me, is it possible to somehow implement a status check for "1" or "0" every ten minutes and, if "0" is returned, will the message be sent to the mail?
And, if so, what is the best way to do it?
There is Ubuntu Server. I thought about writing a python program for this, but I'm afraid I can't do it myself. Yes, and I'm not sure that python is the
best solution for
this section "server statistics" (commented below "checking online") I hope that is clear. If so, I can explain in the comments . Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shane Matte, 2017-06-07
@mattedev

Curl + cron

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question