Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Anyone have a good ping test app for embedding in a website
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Anyone have a good ping test app for embedding in a website

smansman Member
edited July 2013 in Help

Looking for something that is opensource and preferably PHP + Java since that is what everything else on my website uses.

You would think it would be easy to embed something in your website that gives people ping times from their PC to your servers but you would be wrong. Apparently ICMP and Java/php don't get along. The alternative seems to be a seudo ping where you test response time to http or an image file or something on your server. I could live with that if it wasn't too complicated. However, there doesn't seem to be anything that does that either. At least nothing approaching an organized opensource project. There are responses to questions about this on stackoverflow where people post snippets of code that maybe is a start but that's about it.

Just to clarify. This is not something like just-ping.com where it pings from static IP servers to the IP you provide. It is also not something like nodeping that pings between one fixed point and another. It is something that shows up on my website that initiates something similar to ping between the visitors computer and static IP's I provide. Instead of them having to open a command line on their PC and typing ping xx.xx.xx.xx where xx.xx.xx.xx is an IP of one of my hosting servers.

I have searched all over and can't seem to find anything which is surprising. I would have thought there would be enough interest in something like this that someone would have posted something on github by now.

Comments

  • nunimnunim Member
    edited July 2013

    Unless I misunderstood, he said he's trying to ping from the client to the server, it's trivial to ping server to client.

    You'll probably have to write something yourself, seems easier to just have them run ping themselves. Why do you need this, are you running a gameserver community or something else very latency sensitive?

  • AdducAdduc Member

    Using an image and judging load time is a possibility: http://stackoverflow.com/questions/4282151/is-it-possible-to-ping-a-server-from-javascript

    Although I'd suggest making an AJAX request to the server if possible, recording time before and after response as a "ping" time.

  • smansman Member
    edited July 2013

    @Adduc said:
    Using an image and judging load time is a possibility: http://stackoverflow.com/questions/4282151/is-it-possible-to-ping-a-server-from-javascript

    Although I'd suggest making an AJAX request to the server if possible, recording time before and after response as a "ping" time.

    That is the problem. People say it should work and here is a little snippet of code to start etc. I'm looking for a more complete solution. Something I could paste into my website and would provide a nice little graph plot over time or something. Kind of like a little java version of pingplotter pro. I could cobble a lot of it together myself but there isn't much out there to help get started which is surprising. I like to find things that can at least get me half of the way there so I don't have to spend months on it.

  • nunimnunim Member
    edited July 2013

    @sman said:
    That is the problem. People say it should work and here is a little snippet of code to start etc. I'm looking for a more complete solution. Something I could paste into my website and would provide a nice little graph plot over time or something. Kind of like a little java version of pingplotter pro. I could cobble a lot of it together myself but there isn't much out there to help get started which is surprising. I like to find things that can at least get me half of the way there so I don't have to spend months on it.

    There was a lot of good info on that stackoverflow page, that's a good starting point. This is not exactly a common function so if you've googled around and couldn't find anything then most likely there is no public software that exactly meets your needs.

    I suggest to figure out a different way to do what you need or cobble it together yourself. You might be able to do it with Flash, but there is not an easy way to send ping (ICMP) traffic with Java, checkout this page: http://www.0x13.de/index.php/code-snippets/74-icmp-ping-in-java.html

    If you need charting, checkout pchart.net, it can do all sorts of graphs, bars and charts.

  • AdducAdduc Member

    Flash cannot send UDP packets (ActionScript supports it, but it cannot be done within the context of something embedded within the browser), which makes it impossible to send true ICMP traffic.

  • smansman Member
    edited July 2013

    Yea it sounds like ICMP is pretty much not possible. But there are other ways to do it that are just as good since I have access to the servers and can install files and agents.

    Perhaps that is another thing zabbix-agent could be used for.

Sign In or Register to comment.