Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to use GeekTool (Mac pref pane... basically just embeds output of a shell command/script on the desktop... http://lifehacker.com/#!244026/geek-to-live--monitor-your-mac-and-more-with-geektool) to monitor a a remote machines/server, and I'm having some trouble determining how best to check if a machine is up/down.

I'm using no-ip as a free dns re-direct... but this only helps me with the public IP of the router. The machine I want is behind the router and thus isn't able to be "ping"ed directly.

I have port forwarding set up for port 8080 which leads to the machine I want. Is there a way to essentially ping through port 8080 to see if the machine is up and running? I tried telnet, but this apparently doesn't work (as far as output) in GeekTool. I'm running a website at 8080, so I guess I just want to know if/when it goes down.

Thanks in advance... if I can provide more clarification let me know.

(figured out my problem... see below)

share|improve this question
1  
ping is an ICMP protocol, whereas ports are TCP and UDP concepts. All 3 are distinct protocols on top of IP. That means an IP packet containing TCP cannot contain ICMP and vice versa. It also means the TCP header (with the port) is not present in an ICMP ping packet. –  MSalters Dec 30 '13 at 13:33
add comment

migrated from stackoverflow.com Apr 22 '11 at 9:28

This question came from our site for professional and enthusiast programmers.

3 Answers

To check a specific port, you can use telnet:

telnet 127.0.0.1 8080

(The port follows the IP / hostname with a space, not a colon.)

If you get an immediate error, then the port is not available. If telnet hangs, then you have successfully connected to the port. Ctrl + C to kill telnet, then.

This may or may not help with the port forwarding issue, though. It just gets you to that IP and port.

share|improve this answer
    
This would get the job done... but it doesn't work with GeekTool :/. I appreciate the help. –  loeschg Apr 22 '11 at 19:15
add comment

You could use wget, curl etc. to check that the website is responding.

share|improve this answer
    
I'll look into this... thanks! –  loeschg Apr 22 '11 at 19:15
add comment
up vote 0 down vote accepted

Telnet gets the job done, but I'm unable to integrate that with GeekTool. I ended up doing a mysqladmin ping to the remote machine. The website has a db backend, so this (more-or-less) returns the info I'm looking for. Thanks for all the help!

share|improve this answer
add comment

protected by Community Feb 8 at 13:50

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.