zabbix監控mysql之Warning: Using a password on the command line interface can be insecure.

來源:互聯網
上載者:User

標籤:use   name   提示   mysql伺服器   lin   suitable   zabbix監控   awk   警示   

今天在添加zabbix對2台mysql伺服器監控的時候,其中有一台的item報如下錯誤:

Value "Warning: Using a password on the command line interface can be insecure.6158" of type "string" is not suitable for value type "Numeric(unsigned)"

我設定的擷取的實值型別是數字格式,2台機器用的同一個模版的key取值,但為什麼有一台接收到的是string格式。

 

web中的item裡我設定的Type of information:Numeric (unsigned)

zabbix_agentd.conf裡key寫的 UserParameter=mysql.status[*],echo "show global status where Variable_name=‘$1‘;" | mysql -u zabbix -pzabbix -N | awk ‘{print $$2}‘

 

後來發現這2台mysql版本不一樣。。。一台是5.5,一台是5.6。

在5.6以上版本的時候用mysql相關命令-p後面接密碼這種方式會有一個警告提示(Warning: Using a password on the command line interface can be insecure.),反正就是不安全吧。

這樣zabbix服務端使用運算式過濾擷取數值的時候,會帶有該字串,導致item擷取實值型別錯誤。。。

 

解決方案:

在key中用 2>/dev/null把這段警示忽略掉。

UserParameter=mysql.status[*],echo "show global status where Variable_name=‘$1‘;" | mysql -u zabbix -pzabbix -N 2>/dev/null| awk ‘{print $$2}‘

 

zabbix監控mysql之Warning: Using a password on the command line interface can be insecure.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.