Indirect deleted images

I am trying to create some HTML that shows me if my server is accessible from the internet the green light OK red light is not available. This I can do for the remote site, but not for my home, my router seems to be preventing me from returning home via my static IP. I want to generate HTML to see what I look like from my ISP and not my local network, more specifically, I want the boss in Paris to know if the server in Paris is running.

<html>
<head><script language='JavaScript'>
// Begin
  function MyErr4(MyImage) {
      setTimeout(function() {       
        document.light4.src = 'http://www.myisp.uk/red.jpg';
      },300);
  }
// end
</script>

<img name='light4' src='http://mystaticip/2_lime.jpg'
    onerror='MyErr4(this)' border='0' width='30' />

      

doesn't work because I am running it inside my local network. How can I write code that will be allowed by my ISP. I tried ASP but Javascript gets clients allowed.

Anyone would like to comment?

0


source to share


4 answers


You are attacking the problem at the wrong angle.

Any code on the page will execute client-side by definition.



If you need to do something elsewhere, you need an external server at that other location. This could be a very simple HTTP server that you can request using XMLHttpRequest on your page, or something more interesting that will display a full status page.

As suggested in another answer , you should consider running Nagios on a third party server.

+1


source


Have you considered using an existing application like Nagios instead of writing your own tool? I guarantee it will offer more features and perform much better. For example, you can check if the web server is returning a 500 status code (or other errors), which might indicate that the database is overloaded, rather than just checking to see if it will respond.



+1


source


Did you know that your server can respond to requests from outside the local network? It looks like it is a routing / firewall issue and not a code issue. Typically for most home networks, you must enable port forwarding on the router to send requests from outside the firewall to the correct IP address in the firewall.

+1


source


Symptom: "Other people can reach my server, but I cannot view it locally."

Problem: You have Loopback connection error .

Read the link and its solution. See if this helps.

0


source







All Articles