opserver / Opserver

Stack Exchange's Monitoring System
https://opserver.github.io/Opserver/
MIT License
4.51k stars 827 forks source link

Added Service Tag/Serial Number to WMI #251

Closed jeddytier4 closed 7 years ago

jeddytier4 commented 7 years ago

Added service tag lookup for DELL physical servers for WMI polling.

NickCraver commented 7 years ago

I'm not against this - I'm all for it, but shouldn't this work for many more vendors? Can we check for it in a more generic way that's unrestricted?

@afscrome thoughts?

afscrome commented 7 years ago

win32_bios has a SerialNumber property which looks like it should be more generic. At least it works for me on both a Lenovo laptop and a Dell laptop.

Get-WmiObject win32_bios

SMBIOSBIOSVersion : 1.1.3
Manufacturer      : Dell Inc.
Name              : 1.1.3
SerialNumber      : REMOVED
Version           : DELL   - 1072009
jeddytier4 commented 7 years ago

Agreed, will update the pull request to change Service Tag to serialnumber. That field exists for all servers, but is very long on VMs. i.e. VMware-## ## ## ## ## ## ## ##-## ## ## ## ## ## ## ## that is the serial number of a VMWare vm, and ####-####-####-####-####-####-#### on Hyper-V. Am looking into using something like SELECT * FROM Win32_ComputerSystem WHERE Model LIKE '%Virtual%' to filter them out for now.

NickCraver commented 7 years ago

I'd pull that long field as-is in WMI, and we can filter it in code. We could for example have a SerialNumberDetail available on hover that we split it into on Node or something.

jeddytier4 commented 7 years ago

I have updated it to pull the Service Tag/Serial Number from Win32_BIOS. The virtual machines' serial numbers actually look ok in the UI as is, but I'm UI dysfunctional, so someone with a better eye should probably look at it.

NickCraver commented 7 years ago

Thanks!