Author Topic: cron job to test server availability  (Read 8572 times)

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
cron job to test server availability
« on: June 19, 2015, 04:33:50 AM »
I am looking for a way to test if a TNetServer is up and running, some kind of echo or ping I could send to the the TnetServer and get a response so I know if the server is up and running and receiving data or not.

Any one have any ideas about the best way to keep an automated system running which keeps tests whether servers are available?

Ideally, I would be able to use some standard shell commands to interface with TnetServer.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: cron job to test server availability
« Reply #1 on: June 19, 2015, 05:37:38 AM »
sounds like a lobby server?

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
Re: cron job to test server availability
« Reply #2 on: June 19, 2015, 02:21:30 PM »
yes, do you know an easy way to test if the lobby server is up and ready and available to be used?

also,does anyone know a good way to tell the latency or how long it takes for a packet to arrive?
« Last Edit: June 19, 2015, 08:55:56 PM by phoenix »

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: cron job to test server availability
« Reply #3 on: June 21, 2015, 01:18:00 PM »
TNet has a lobby system you can use, TNLobbyClient lobby.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: cron job to test server availability
« Reply #4 on: June 21, 2015, 09:38:29 PM »
also,does anyone know a good way to tell the latency or how long it takes for a packet to arrive?
TNManager.ping, or if you are trying to get latency to something you aren't connected to, you need to send a UDP ping packet via TNManager.Ping().

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
Re: cron job to test server availability
« Reply #5 on: June 22, 2015, 04:04:45 PM »
TNManager : MonoBehaviour and therefore I need unity to test if the server is up?

I am looking for a way, preferably with either pure mono code like the TNetServer runs without unity or standard linux command line tools which can run automated tests against the servers from a shell which does not have unity installed to determine if the servers are up and running and available.

From http://superuser.com/questions/621870/test-if-a-port-on-a-remote-system-is-reachable-without-telnet

I have found  Netcat  seems to work!

nc -v -z -w2 192.168.0.1 5127

found 0 associations
found 1 connections:
     1:   flags=82<CONNECTED,PREFERRED>
   outif en1
   src 192.168.0.2 port 55255
   dst 192.168.0.3 port 5127
   rank info not available
   TCP aux info available

Connection to 192.168.0.1 port 5127 [tcp/*] succeeded!

And when the TNetServer it is not running it outputs

nc: connectx to 192.168.0.1 port 5127 (tcp) failed: Connection refused