Cara menggunakan mysql monitor agent user

Jul 24, 2018 by Robert Gravelle

A database event is a task that runs according to a schedule. Also known as "scheduled events", an event is similar to a cron job in UNIX or a task scheduler task in Windows, except that scheduled events are configured using a database's syntax and/or command-line-interface (CLI). Database events have many uses, such as optimizing database tables, cleaning up logs, archiving data, or generating complex reports during off-peak time.

In previous blogs on this topic, we learned how to configure events using MySQL as our database. Today, we're going to schedule a database task using the Navicat Premium GUI Database Management Tool.

In Navicat database management offerings, including Navicat Premium, the Event Designer is the tool for working with events. It's accessible by clicking on the Event button on the main toolbar:

Cara menggunakan mysql monitor agent user

Clicking the Event button opens the Event object list in the Object pane. The Object pane toolbar contains three buttons: Design Event, New Event, and Delete Event. If you have no events defined, only the New Event button will be enabled.

Creating a New Event

Click the New Event button to open a new untitled Definition tab:

Cara menggunakan mysql monitor agent user

You can enter any valid SQL procedure statement in the Definition tab. This can be a simple statement such as "INSERT INTO tbl_users (first_name,last_name) VALUES('Bob','Jones');", or it can be a compound statement written within BEGIN and END statement delimiters. Compound statements can contain declarations, loops, and other control structure statements.

Note that we don't have to write the CREATE EVENT code, as this is handled by Navicat (as we'll see in the following sections).

Here is an event definition that inserts a new row in the sakila.actor table:

Cara menggunakan mysql monitor agent user

Scheduling your Event

Navicat alleviates much of the burden of scheduling events by providing a form for entering scheduling details. The scheduling form is located on the Schedule tab. It supports the adding of Intervals that may comprise either simple or complex time units. Here's a simple example that sets the event to execute 5 minutes after creation:

Cara menggunakan mysql monitor agent user

Here's a more complex event schedule that starts in 5 minutes, and runs every five-and-a-half hours for 3 days:

Cara menggunakan mysql monitor agent user

Saving an Event

To save an Event, click the Save button on the Even tab. If you like, you can preview the generated SQL on the SQL Preview tab before saving it:

Cara menggunakan mysql monitor agent user

Note that the statement is read-only and cannot be edited in the preview.

Adding Comments

You can include comments with your Event on the Comment tab.

It adds them to the CREATE EVENT statement via the COMMENT clause:

Cara menggunakan mysql monitor agent user

Deleting an Event

To delete an Event, select it in the Object tab and click the Delete Event button. A warning dialog will ask you to confirm that you wish to delete the Event:

Cara menggunakan mysql monitor agent user

Modifying an Event

To modify an Event, select it in the Object tab and click the Design Event button. That will open it in the Event tab.

Monitoring MySQL Server pada Zabbix - Pada kesempatan kali ini, www.dimasrio.com akan menjelaskan bagimana cara melakukan monitoring mysql server pada zabbix. Bagi anda yang belum mengetahui apa itu zabbix, silahkan mebaca artikel berikut :

Install Zabbix Server di CentOS 7
Tutorial Zabbix SNMP dan Traffic Monitoring Graph 

Oke sobat, disini saya anggap anda sudah menginstall Zabbix Server, Zabbix Agent dan MariaDB (mysql) di server CentOS anda.

Langkah pertama buka direktori /etc/zabbix/zabbix_agentd.conf  kemudian edit menu include seperti dibawah ini.

Include=/etc/zabbix/zabbix_agentd.d/*.conf

Buat direktori /var/lib/zabbix sebagai default informasi untuk zabbix mengakses mysql. 

mkdir /var/lib/zabbix/
cd /var/lib/zabbix/

Selanjutnya buat file .my.cnf .

nano /var/lib/zabbix/.my.cnf

dan tambahkan script dibawah ini.

[mysql]
user = zabbix_boy
password = password
host = localhost

[mysqladmin]
user = zabbix_boy
password = password
host = localhost

Buat user zabbix_boy pada mysql.

MariaDB [(none)]>create user 'zabbix_boy'@'localhost' identified by 'password';
MariaDB [(none)]>grant all privileges on *.* to 'zabbix_boy'@'localhost';
MariaDB [(none)]>flush privileges;
MariaDB [(none)]>quit;

Setelah selesai restart zabbix-agent.

systemctl restart zabbix-agent

Sampai disini konfigurasi mysql pada zabbix server sudah selesai. Sekarang anda sudah bisa menggunakan tempalte app mysql pada zabbix.

Cara menggunakan mysql monitor agent user