Layer7 API Management

Expand all | Collapse all

Simple Monitoring Query for MySQL

  • 1.  Simple Monitoring Query for MySQL

    Posted 09-19-2016 07:05 AM

    Hello,

     

    Does anyone have a simple "health-check" style query that one could run against the Gateway's MySQL database?

     

    Thanks,

     

    Alejandro



  • 2.  Re: Simple Monitoring Query for MySQL

    Posted 09-19-2016 10:10 PM

    Alejandro,

     

    The simplest SQL command to see if the MySQL server running and ssg database exists is "select * from ssg_version;". It returns one line with the version of the gateway being used in the database.

     

    mysql> select * from ssg_version;
    +-----------------+
    | current_version |
    +-----------------+
    | 9.1.00          |
    +-----------------+
    1 row in set (0.00 sec)

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 3.  Re: Simple Monitoring Query for MySQL

    Posted 10-17-2016 01:55 PM

    This query can provide the size of the database in MB, however this does not give you any monitoring details:

     

    select table_schema "db name", sum(data_length+index_length)/1024/1024 "db size in mb" from information_schema.tables group by table_schema;

     

    +-----------------------------+--------------------+
    | db name                       | db size in mb    |
    +-----------------------------+--------------------+
    | information_schema    | 0.00878906       |
    | mysql                           | 0.65437317       |
    | performance_schema | 0.00000000       |
    | ssg                              | 242.96973324   |
    +----------------------------+---------------------+
    4 rows in set (0.03 sec)