Macro Ping

do you think?, develop a macro (sc) _ping to be executed
in an application of menu, to check the database server, and ping error, to redirect to another page.
“Closed for maintenance”
“Server (Postgres, MySQL …) out of service”

or is there another way to do it?

Thank you.


If you want to ping another server, that can be achieved with a bit of coding in PHP.

I have sent your suggestion as a macro to “ping” if a database is online. If that wasn’t what you intended, please let me know.

Bernhard Bernsmann

that’s the idea …!, I will try to use php code until you to realize the macro (ping).

Thank you.

Thanks also!

Bernhard Bernsmann

function ping($host, $port, $timeout)
$tB = microtime(true);
$fP = fSockOpen($host, $port, $errno, $errstr, $timeout);
if (!$fP) { return “down”; }
$tA = microtime(true);
return round((($tA - $tB) * 1000), 0)." ms";

echo ping(“”, 80, 10);