Multiple MySQL instances

Monitor multiple MySQL instances from one plugin

You can monitor multiple MySQL instances using a single plugin. You can configure the input data like the MySQL hostname, password, and other details in the mysql.cfg file. This enables multiple instance monitoring using the same plugin without changing the plugin script.

 

To monitor multiple instances of MySQL using the MySQL plugin, follow the steps below: 

  1. Download and install the latest version of the Site24x7 Linux agent

After successful installation, you will see the Linux server monitor in the Site24x7 Control Panel. This confirms that the agent can communicate with our data center.

  1. Download the mysql.py and mysql.cfg files from the GitHub repository.

  2. Configure the host, port, username, and password in your mysql.cfg file.

  3. Then, add a new section with the instance name for identification in the mysql.cfg file.

      [instance_name]

      host = localhost

      port = 3306

      username = test

      password = your_password

Any field with a name password will be automatically encrypted once the server agent picks it up. The field will subsequently change to an encrypted password.
      [instance_name]

      host = localhost

      port = 3306

      username = test

      encrypted password = hash_for_your_password_created_by_site24x7

 

The agent will start executing the plugin with the defined configuration setup of mysql.cfg. For each configuration, the agent will add a MySQL plugin monitor for each MySQL instance. You can find the instances of MySQL by their respective instance names appended to the plugin monitor name. 


    • Related Articles

    • Troubleshoot connection errors in the MySQL plugin

      When configuring the MySQL plugin, you may encounter the following errors: Error : Connection Error - This error typically indicates that there is a problem establishing a connection to the database. Sometimes, this message is supplemented with an ...
    • Troubleshoot the "pymysql module not found" error when installing the MySQL plugin

      If you're encountering the pymysql module not found error, it likely means that the pymysql Python library is not installed on the server. pymysql is a Python package that provides a way to interact with MySQL databases using Python code and is used ...
    • How is MySQL added for monitoring in Site24x7?

      Site24x7 uses the server monitoring agent to monitor MySQL databases. To install the Site24x7 Server monitoring agent, follow the below steps: Log in to Site24x7. Install the Linux Server monitoring agent by navigating to Server > Server Monitor > ...
    • Why is my MySQL monitor not discovered?

      If your MySQL is not getting discovered, you cannot add your MySQL, you are unable to add MySQL server for monitoring, or unable to view your MySQL resources, try discovering your resources by navigating to Server > Server Monitor > Rediscover ...
    • What is a plugin template and a plugin monitor?

      Plugin Template:A plugin template is a set of attributes to be monitored.  Example: mysql.py file consisting of attributes like slow queries, reads, writes etc Plugin Monitor: A monitor that uses a plugin template for monitoring purposes Example: The ...