1、報錯信息node
郵件收到CMDB發出的錯誤信息,「No value for productname」,經過salt '主機的salt-key' grains.get productname,發現返回值的確爲空。python
找了兩臺主機,看了下productname究竟是什麼返回值,經過如下判斷,多是虛擬化類型。linux
# salt 'wanwan-test-sr1' grains.get productname
wanwan-test-sr1:
Alibaba Cloud ECS
# salt 'exporthost' grains.get productname
exporthost:
VMware Virtual Platform
2、處理過程ios
linux下安裝下virt-what包:shell
# 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
到此,問題獲得解決。
bash