標籤:nagios多使用者
一、nagios除了管理使用者登入來管理往往是不夠的,我們公司有廣東、江西、北京等地的業務,甚至內部人員也需要來查看(唯讀)監控的項目或者警示資訊。
So...
二、先備份我們需要修改的兩個檔案
[[email protected] nagios]#cp /etc/nagios/htpasswd.users /etc/nagios/htpasswd.users.20150126bak
[[email protected] nagios]#cp /etc/nagios/cgi.cfg /etc/nagios/cgi.cfg.20150126bak
三、建立使用者,建立使用者的時候不要加-c,否則會覆蓋該檔案原有資料,xh是使用者名稱。輸入密碼確定即可
[[email protected] nagios]#htpasswd /etc/nagios/htpasswd.users xh
New password:
Re-type new password:
Updating password for user xh
查看檔案,建立使用者成功,沒有覆蓋之前的使用者
[[email protected] nagios]# cat htpasswd.users
nagiosadmin:TxLl3Z4Hu/rgM
jxoperator:StFLcNbUYm8JQ
bjoperator:mIIZ6TKa85iyo
xh:HyPcV1ozVpCNg
四、賦予許可權,唯讀。經過測試,修改下面5行即可
[[email protected] nagios]#vi /etc/nagios/cgi.cfg
authorized_for_read_only=jxoperator,bjoperator,xh
authorized_for_all_services=nagiosadmin,xh
authorized_for_all_hosts=nagiosadmin,xh
authorized_for_all_service_commands=nagiosadmin,xh
authorized_for_all_host_commands=nagiosadmin,xh
五、重啟服務,使配置生效
/etc/init.d/httpd restart
/etc/init.d/nagios restart
本文出自 “卡卡西” 部落格,請務必保留此出處http://whnba.blog.51cto.com/1215711/1608478
Nagios 多使用者管理