Author Options:

How can i make a status light for my website? Answered

I host my own website on a old crappy computer (pc running xp) and i want to make a light that will be green when the website is up and red when the website is down this way i will easily be able to tell when the website is down because this computer is making weird noises (i think its the hardrive) so i was thinking that maybe i could make a c++ program to go to the site and see if it can get something from the server and if it can it would turn a pin the the lpt or serial port high if it cant it would turn a diffrent pin high wich would be connected to a red led. does anyone know of a better easier idea. or does anyone know how i can even do this i am a begginer with c++. ps i know this project is semi pointless but i like to do stuff with computer and stuff



Best Answer 8 years ago

it would be easy to do... im thinking an if else loop using a ping to the server. you would then pull a serial pin high to light a led/relay. or if you use the arduino, you coule put the text file on a server containg one word. With a serial program over usb on the board, you could have it try to read the file from the server address (NOT the local one) using an if else... so: read file: (assume online means server is working) If online, execute code. If else, execute other code.

but how do i make the serial pin high?

You could just create a web-page that uses a bit of java script to reload every 5 seconds? Green background & text that say "OK", if it fails you get a standard error message. L

i wanted just be a little led light in my room or something

thats really cool but i dont have an arduino or money....