从《zabbix用户认证方式 内建、HTTP Basic、LDAP(96)》我们了解到zabbix有三种认证方式,内建的不用多说,今天我们聊聊HTTP Basic Auth认证方式,我们将在实例中使用nginx来演示,Apache也类似。
zabbix认证配置
Administration>> Authentication,将http authentication改为HTTP,保存即可,如下图:文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
接下来在nginx中创建Admin用户,或者创建zabbix已经存在的其他用户。文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
nginx用户认证配置
nginx配置如下文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
server{ server_name www.ttlsa.com; index index.html index.php; root /data/site/www.ttlsa.com; ..... 省略部分配置 ..... location ~ ^/zabbix(/.*)$ { auth_basic "nginx basic http test for ttlsa.com"; auth_basic_user_file htpasswd; location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } } ..... 省略部分配置 .....
创建用户密码文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
# printf "Admin:$(openssl passwd -crypt 123456)\n" >>conf/htpasswd # cat conf/htpasswd Admin:xyJkVhXGAZ8tM
重启nginx文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
# /usr/local/nginx-1.5.2/sbin/nginx -s reload
更多关于nginx认证的内容,请参考前面的文章:nginx用户认证配置( Basic HTTP authentication)文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
zabbix http认证效果
像往常一样打开zabbix管理地址,此时会弹出账号密码框,账号是Admin,密码123456。假如哪天你取消了http认证,那么zabbix会使用zabbix系统内的密码。文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
输入完账号密码之后,直接进入了zabbix界面。文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/
下一篇我们谈谈使用openldap做认证,大家可以先了解下《openldap安装配置》,有兴趣的也可以看看《openldap mirrorMode主主实现高可用性》文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/ 文章源自运维生存时间-https://www.ttlsa.com/zabbix/zabbix-auth-http-basic-auth/

3F
凉师傅,有没有完整的LDAP配置文章啊[懒得理你]
2F
凉师傅,有没有打算出一篇zabbix+MPM监控MySQL的?
B1
@ helix http://www.linuxidc.com/Linux/2013-07/86965.htm,这有现成的文档~
1F
这个真的很不错的分享。收藏了