yoshinorim / mha4mysql-node

Development tree of Master High Availability Manager and tools for MySQL (MHA), Node (MySQL Server) part
http://code.google.com/p/mysql-master-ha/
GNU General Public License v2.0
398 stars 198 forks source link

NodeUtil.pm: slight bug on version extraction #37

Open geekgogie opened 5 years ago

geekgogie commented 5 years ago

Caused by an error as an example: vagrant@node_manager:~$ /usr/local/bin/masterha_check_repl --conf=/etc/app1.cnf Fri May 3 00:59:43 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping. Fri May 3 00:59:43 2019 - [info] Reading application default configuration from /etc/app1.cnf.. Fri May 3 00:59:43 2019 - [info] Reading server configuration from /etc/app1.cnf.. Fri May 3 00:59:43 2019 - [info] MHA::MasterMonitor version 0.58. Fri May 3 00:59:44 2019 - [error][/usr/local/share/perl/5.26.1/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. Redundant argument in sprintf at /usr/local/share/perl/5.26.1/MHA/NodeUtil.pm line 195. Fri May 3 00:59:44 2019 - [error][/usr/local/share/perl/5.26.1/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers. Fri May 3 00:59:44 2019 - [info] Got exit code 1 (Not master dead).

It would be more readable and easy to follow using array and then splice based only on the indexes needed to be parsed in Major and Minor version