Skip to content

Commit

Permalink
Add BIOS info
Browse files Browse the repository at this point in the history
  • Loading branch information
zcalusic committed Sep 24, 2016
1 parent f0e05e2 commit 32261de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bios.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright © 2016 Zlatko Čalušić
//
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

package sysinfo

// BIOS information.
type BIOS struct {
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Date string `json:"date,omitempty"`
}

func (si *SysInfo) getBIOSInfo() {
si.BIOS.Vendor = slurpFile("/sys/class/dmi/id/bios_vendor")
si.BIOS.Version = slurpFile("/sys/class/dmi/id/bios_version")
si.BIOS.Date = slurpFile("/sys/class/dmi/id/bios_date")
}
2 changes: 2 additions & 0 deletions sysinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type SysInfo struct {
Product Product `json:"product"`
Board Board `json:"board"`
Chassis Chassis `json:"chassis"`
BIOS BIOS `json:"bios"`
CPU CPU `json:"cpu"`
Memory Memory `json:"memory"`
Storage []StorageDevice `json:"storage"`
Expand All @@ -34,6 +35,7 @@ func (si *SysInfo) GetSysInfo() {
si.getProductInfo()
si.getBoardInfo()
si.getChassisInfo()
si.getBIOSInfo()
si.getCPUInfo()
si.getMemoryInfo()
si.getStorageInfo()
Expand Down

0 comments on commit 32261de

Please sign in to comment.