Announcement

Collapse
No announcement yet.

Macro Ping

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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

    Comment


    • #3
      that's the idea ..!, I will try to use php code until you to realize the macro (ping).

      Thank you.

      Comment


      • #4
        Thanks also!

        regards,
        Bernhard Bernsmann

        Comment


        • #5
          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);

          Comment

          Working...
          X