LoginSignup
0
0

More than 5 years have passed since last update.

nagiosプラグインのcheck_mysqlでConnection using olication protocol refused (client option 'secure_auth' enabled) d (pre-4.1.1) authent

Posted at

nagiosを新サーバに移したらmysqlのチェックで次のエラーを吐くようになった。
Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

CentOS7にして、MySQLをyumで入れたら5.6.25になって5.6.7以降の問題にぶつかったらしい(5.6.7以降はデフォルトでtrueになる)。

この問題を解決するには
①サーバ側にsecure_authを切る。
→ 台数が多いので却下

②クライアントからの接続に --skip-secure-authをつける
これが望ましいかったので、nagiosプラグインのソースをいじることにした。

nagios-plugins-2.0.3/plugins/check_mysql.c
nagios-plugins-2.0.3/plugins/check_mysql_check.c

を修正。
普段は全くさわらないC言語なので簡単なこともなかなか時間がかかる。

connect一行前の140行目に下記を足す。
my_bool opt_secure_auth= FALSE;
mysql_options(&mysql,MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);

コンパイルしたらうまく接続されるようになりました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0