gcmon
Version:
Galera Cluster Monitor
107 lines (78 loc) • 3.94 kB
Markdown
*Ncurses console tool for monitoring Galera Cluster*
<img src="https://github.com/KrumBoychev/gcmon/raw/master/assets/gcmon.png"/>
Galera Cluster Monitor - gcmon is console tool for centralized monitoring of Mysql Galera cluster nodes. The tool provides the same information as [myqstatus](https://github.com/jayjanssen/myq-tools) on a single screen/console.
``` bash
$ npm install gcmon
```
1. Configure the INSTALL_DIR/gcmon/etc/gcmon.json file:
```json
{
"thresholds": {
"fc_snt" : 10
},
"nodes":[
{"hostname" : "gdb1", "port":"3306", "user" : "user", "password": "secret"},
{"hostname" : "gdb2", "port":"3306", "user" : "user", "password": "secret"},
{"hostname" : "gdb3", "port":"3306", "user" : "user", "password": "secret"},
{"hostname" : "gdb4", "port":"3306", "user" : "user", "password": "secret"}
]
}
```
The thresholds configuration setting is used to monitor certain parameters and to highlight them on the screen
if the threshold is reached. !!! Currently the only supported param is **fc_snt**!!!
<img src="https://github.com/KrumBoychev/gcmon/raw/master/assets/gcmon02.png"/>
2. Run the tool in debug mode to check if the communication with the nodes is OK:
```
$ ./gcmon -d
[] [INFO] [gdb1] Connec
[] [INFO] [gdb2] Connect
[] [INFO] [gdb3] Connect
[] [INFO] [gdb4] Connect
[] [INFO] [gdb2] Connected as id 120
[] [INFO] [gdb3] Failed to connect!! Reason: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'load'@'xxx.xxx.xxx.xxx' (using password: YES)
[] [INFO] [gdb4] Connected as id 779
[] [INFO] [gdb1] Connected as id 3903
[] [INFO] [gdb3] Node is not connected
[] [INFO] [gdb3] Reconnect
[] [INFO] [gdb2] Executing query 'show global status'
[] [INFO] [gdb2] Execute query return: 398 rows
[] [INFO] [gdb1] Executing query 'show global status'
[] [INFO] [gdb1] Execute query return: 398 rows
[] [INFO] [gdb4] Executing query 'show global status'
[] [INFO] [gdb4] Execute query return: 398 rows
[] [INFO] [gdb3] Failed to connect!! Reason: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'load'@'xxx.xxx.xxx.xxx' (using password: YES)
```
3. After the connection verification, run the tool in ncurses mode:
**NOTE!!!**
> Many SSH emulators like **Putty** will use UTF-8 mode. This in turn
> will result in the session not use the correct character set. Ncurses
> attempts to use the "graphical" character set for drawing lines. Which
> results in alpha and numeric characters when executing the ncurses
> environment. One of the possible solutions is to export
> **NCURSES_NO_UTF8_ACS=1** to your .bashrc.
[](https://thesorcerer.wordpress.com/2015/04/01/how-to-solve-some-graphical-issues-with-putty-utf8-and-ncurses/)
```
$ ./gcmon
```
<img src="https://github.com/KrumBoychev/gcmon/raw/master/assets/gcmon03.png"/>
4. To exit from the application use **q**
5. For additional options check the help:
```
$ ./gcmon -h
Description
gcmon(v1.0.0) -Galera Cluster Monitor
Synopsis
$ gcmon --help
$ gcmon [--config file]
$ gcmon [--interval seconds] --debug
Options
-h, --help Display this usage guide.
-v, --version Version
-d, --debug Debug communication.
-i, --interval <seconds> Collect data interval.
-c, --config <file> Config file.
```