nagios如何实现对个别用户隐藏部分服务信息。

1、添加测试用户

htpasswd/usr/local/nagios/etc/htpasswd.usersuser

2、将测试用户添加到联系人。

definecontact{contact_nametestusegeneric-contactaliastest}

3、将联系人添加到允许查看的个别服务中(defineservice)。注意不能写入define host,写入host里面就能看见该主机的全部服务了。

defineservice{use webhost_name web-testservice_description 80_Port_Statusnormal_check_interval1notifications_enabled0check_commandcheck_tcp!80 contacts test}

这样就能想让test用户看什么服务,就只能看什么服务。