一、报错信息
邮件收到CMDB发出的错误信息,“No value for productname”,通过salt '主机的salt-key' grains.get productname,发现返回值的确为空。
找了两台主机,看了下productname到底是什么返回值,通过以下判断,可能是虚拟化类型。
1
|
<span style=
"font-size: 14px;"
>
# salt 'wanwan-test-sr1' grains.get productname<br>wanwan-test-sr1:<br> Alibaba Cloud ECS<br># salt 'exporthost' grains.get productname<br>exporthost:<br> VMware Virtual Platform</span>
|
二、处理过程
linux下安装下virt-what包:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# yum search virt-what
# yum -y install virt-what
# salt 'exporthost' grains.ls
exporthost:
- SSDs
- biosreleasedate
- biosversion
- cpu_flags
- cpu_model
- cpuarch
- disks
- dns
- domain
- fqdn
- fqdn_ip4
- fqdn_ip6
- gid
- gpus
- groupname
- host
- hwaddr_interfaces
-
id
- init
- ip4_interfaces
- ip6_interfaces
- ip_interfaces
- ipv4
- ipv6
- kernel
- kernelrelease
- locale_info
- localhost
- lsb_distrib_codename
- lsb_distrib_id
- lsb_distrib_release
- manufacturer
- master
- mdadm
- mem_total
- nodename
- num_cpus
- num_gpus
- os
- os_family
- osarch
- oscodename
- osfinger
- osfullname
- osmajorrelease
- osrelease
- osrelease_info
- path
- pid
- productname
-
ps
- pythonexecutable
- pythonpath
- pythonversion
- saltpath
- saltversion
- saltversioninfo
- selinux
- serialnumber
- server_id
- shell
- uid
- username
- uuid
- virtual
- zmqversion
# salt 'exporthost' grains.get productname
exporthost:
VMware Virtual Platform
|
到此,问题得到解决。
本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/2044829,如需转载请自行联系原作者