2、找到里面的内容,如下:
password requisite /lib/security/$ISA/pam_passwdqc.so retry=3 min=8,8,8,7,6
password requisite /lib/security/$ISA/pam_passwdqc.so retry=N min=N0,N1,N2,N3,N4
说明���
retry=3的意思是说可以尝试输入3次密码;
N0 = 12,表示一种字符即可,但是最短也需要12位;
N1 = 10,密码至少要有2种字符类型,最短10位;
N2 = 8,密码最短需要8位;
N3 = 8,要求大小写和数字3种字符,最短8位;
N4 = 7,要求大小写、数字和特殊字符,且长度最少为7位;
2)将nagios用户设置成“只读角色”。在“权限”标签中,空白处右键“添加权限”,然后按下图操作
测试
[root@nagios libexec]# ./check_esxi_hardware.py -H 10.10.2.233 -U nagios -P nagios -V dell
UNKNOWN: Authentication Error
[root@localhost libexec]# ./check_esxi_hardware.py -H 10.15.98.204 -U nagios -P nagios -V auto -t 90 -i "IPMI SEL"
Traceback (most recent call last):
File "./check_esxi_hardware.py", line 593, in <module>
wbemclient = pywbem.WBEMConnection(hosturl, (user,password), no_verification=True)
TypeError: __init__() got an unexpected keyword argument 'no_verification'
[root@localhost libexec]#
认证失败。在网上查到原因是Esxi版本不同差异导致。
解决方法:
ssh登陆Esxi主机,Esxi主机开启ssh功能点此
~ # cat /etc/security/access.conf
# This file is autogenerated and must not be edited.
+:dcui:ALL+:root:ALL
+:vpxuser:ALL
+:vslauser:ALL
-:nagios:ALL
-:ALL:ALL
将“-:nagios:ALL”去掉,在第二行加上“+:nagios:sfcb”,修改成如下
~ # cat /etc/security/access.conf
# This file is autogenerated and must not be edited.
+:dcui:ALL+:root:ALL
+:nagios:sfcb
+:vpxuser:ALL
+:vslauser:ALL
-:ALL:ALL
这种方式适合在不经常添加用户的情况下使用,只改一次即可;但是经常加用户可能会导致access.conf变化,需要设置计划任务添加“+:nagios:sfcb”
[root@nagioslibexec]# ./check_esxi_hardware.py -H 10.10.2.233-U nagios -P nagios -V dell
OK - Server: Dell Inc. PowerEdge R610 s/n: XXXXXX System BIOS: XXXXXXXXXXX