Macro Ping

hello,
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.
example
“Closed for maintenance”
“Server (Postgres, MySQL …) out of service”

or is there another way to do it?

Thank you.

Hello,

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.

regards,
Bernhard Bernsmann

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

Thank you.

Thanks also!

regards,
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";
}

Useage:
echo ping(“www.google.com”, 80, 10);