Project

General

Profile

How to connect to backup server

Added by Thom Asv 12 days ago

Hi guys,
I wanted to ask if is it possible to check server status and then connect. I have one TVH server where I am testing and its kinda my "main" server. My family has access to this SERVER, but sometimes it crashes and would like to check the status first and connect to the server. if it would be possible.
I was trying PHP something like this

< ? php

//check MAIN TVH SERVER STATUS
IF ($STATUS=="OK"){
//CONNECT TO MAIN
$IP= "127.0.0.1";} ELSE {
//CONNECT TO BACKUP
$IP= "192.168.0.133";}
?>
Is this even possible?
I was trying both header_location and simply echo URL of SERVER but it didnt connect.


Replies (2)

RE: How to connect to backup server - Added by Flole Systems 12 days ago

I suggest that you fix the cause of the crash rather than just adding redundancy.

But yes, it is definitely possible.

RE: How to connect to backup server - Added by Thom Asv 12 days ago

Sure, I am fixing it and looking what causes the error. But sometimes I am working all day and I dont have access to the rpi and synology nas. I am trying to eliminate the time when main server is down so my family can watch the TV. Sometimes I get home after 8 hours.
Could you help me with the syntaxe of the script?

    (1-2/2)