So, I'm currently using A system where I can manually say if the website is online or not; but I don't see this as "Efficient" because I won't be there 24/7. So I was wondering if there was a way to check if their website is online or not and then create a file on a server as soon as it goes down?
Asked
Active
Viewed 1,049 times
1
-
There is no way to check internally if a site is online or not. What can the server do if it crashes or down? The answer is: not a lot. Generally you use an external service for this. [DotComMonitor](https://www.dotcom-monitor.com/) is just one example of such a service. – Jon P Aug 28 '18 at 04:45
4 Answers
1
You can use free service like UptimeRobot. It will send you notification when the site is down or back up.

Roman Svitukha
- 1,302
- 1
- 12
- 22
1
I wrote simple script in python. Script simple check website status. Here is a link, maybe help You.
Script simple check site code response. If status code is ok - 200 then do nothing. If status code is different than 200, send email notification to declared addresses in config.ini.
Finaly, in crontab I create a log file with site statuse.
1 * * * * /usr/bin/python3 /scripts/WebPageStatusCheck/main.py >> /scripts/WebPageStatusCheck/log/WebPageStatusCheck.log 2>&1
Here check page status and return site status to main.py
import urllib.request
class CheckSiteStatus:
def __init__(self):
pass
@staticmethod
def check_site_url(url: str):
url = 'http://' + url
status = urllib.request.urlopen(url).getcode()
return status
With best regards!

Grzegorz Brzęczyszczykiewicz
- 569
- 5
- 11
0
You check it using
1:Ping your website
2:Go here and enter your website url to check availability
Make sure that your site is live on server.

Community
- 1
- 1

TAHA SULTAN TEMURI
- 4,031
- 2
- 40
- 66
-
I know if its online or not but the website does not detect if it's online or not and I was wondering if there was a way that automatically detected it and created a file on the server. – Sonny Aug 28 '18 at 04:40