温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Nagios 多用户管理

发布时间:2020-08-04 17:48:28 来源:网络 阅读:868 作者:zddnyl 栏目:移动开发


一、nagios除了管理员用户登录来管理往往是不够的,我们公司有广东、江西、北京等地的业务,甚至内部人员也需要来查看(只读)监控的项目或者告警信息。


So...


二、先备份我们需要修改的两个文件

[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


三、创建用户,创建用户的时候不要加-c,否则会覆盖该文件原有数据,xh是用户名。输入密码确定即可

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

New password: 

Re-type new password: 

Updating password for user xh


查看文件,创建用户成功,没有覆盖之前的用户

[root@localhost nagios]# cat htpasswd.users

nagiosadmin:TxLl3Z4Hu/rgM

jxoperator:StFLcNbUYm8JQ

bjoperator:mIIZ6TKa85iyo

xh:HyPcV1ozVpCNg


四、赋予权限,只读。经过测试,修改下面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


五、重启服务,使配置生效

/etc/init.d/httpd restart

/etc/init.d/nagios restart


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI