1.配置Prometheus數據庫
grafana忘記登陸密碼
找到grafana的數據文件grafana.db
find / -name "grafana.db"
ps:默認的安裝路徑爲/var/lib/grafana/grafana.db
進入數據庫修改數據
#進入數據庫
sqlite3 /var/lib/grafana/grafana.db
#查看錶
.tables
#查看錶中數據
select * from user;
#更改密碼爲admin
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
#退出
.exit
重啓grafana
systemctl stop grafana-server.service
systemctl start grafana-server.service
service grafana-server restart
發送郵件配置
#################################### SMTP / Emailing ##########################
[smtp]
enabled = true #是否允許開啓
host = smtp.163.com:465
# 發送服務器地址,可以再郵箱的配置教程中找到:
#host = smtp.qq.com:465
user = [email protected]
#user = [email protected]
# 這個密碼是你開啓smtp服務生成的密碼
password = m15896863367
#password = epckclfjogcwgfah
#from_address = [email protected]
from_address = [email protected]
from_name = Grafana
;cert_file =
;key_file =
#跳過校驗
skip_verify = true
# EHLO identity in SMTP dialog (defaults to instance_name)
ehlo_identity = dashboard.example.com
# EHLO identity in SMTP dialog (defaults to instance_name)
[emails]
;welcome_email_on_sign_up = true
#################################### Logging ###################
POP3/SMTP協議
接收郵件服務器:pop.exmail.qq.com ,使用SSL,端口號995
發送郵件服務器:smtp.exmail.qq.com ,使用SSL,端口號465
海外用戶可使用以下服務器
接收郵件服務器:hwpop.exmail.qq.com ,使用SSL,端口號995
發送郵件服務器:hwsmtp.exmail.qq.com ,使用SSL,端口號465
IMAP協議
接收郵件服務器:imap.exmail.qq.com ,使用SSL,端口號993
發送郵件服務器:smtp.exmail.qq.com ,使用SSL,端口號465
海外用戶可使用以下服務器
接收郵件服務器:hwimap.exmail.qq.com ,使用SSL,端口號993
發送郵件服務器:hwsmtp.exmail.qq.com ,使用SSL,端口號465
雲主機爲了防止濫發郵件已經封掉了smtp的所有通信,所以雲主機發郵件是有問題的。
#檢查一下是否已經安裝sendmail
rpm -qa |grep sendmail
/etc/grafana
/var/log/grafana