溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Nagios 多用戶管理

發(fā)布時(shí)間:2020-08-04 17:48:28 來源:網(wǎng)絡(luò) 閱讀:869 作者:zddnyl 欄目:移動(dòng)開發(fā)


一、nagios除了管理員用戶登錄來管理往往是不夠的,我們公司有廣東、江西、北京等地的業(yè)務(wù),甚至內(nèi)部人員也需要來查看(只讀)監(jiān)控的項(xiàng)目或者告警信息。


So...


二、先備份我們需要修改的兩個(gè)文件

[root@localhost nagios]#cp /etc/nagios/htpasswd.users /etc/nagios/htpasswd.users.20150126bak

[root@localhost nagios]#cp /etc/nagios/cgi.cfg /etc/nagios/cgi.cfg.20150126bak


三、創(chuàng)建用戶,創(chuàng)建用戶的時(shí)候不要加-c,否則會(huì)覆蓋該文件原有數(shù)據(jù),xh是用戶名。輸入密碼確定即可

[root@localhost nagios]#htpasswd  /etc/nagios/htpasswd.users xh

New password: 

Re-type new password: 

Updating password for user xh


查看文件,創(chuàng)建用戶成功,沒有覆蓋之前的用戶

[root@localhost nagios]# cat htpasswd.users

nagiosadmin:TxLl3Z4Hu/rgM

jxoperator:StFLcNbUYm8JQ

bjoperator:mIIZ6TKa85iyo

xh:HyPcV1ozVpCNg


四、賦予權(quán)限,只讀。經(jīng)過測試,修改下面5行即可

[root@localhost 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


五、重啟服務(wù),使配置生效

/etc/init.d/httpd restart

/etc/init.d/nagios restart


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI