3

How do I determine installation date (when the system was first booted) for Linux,Darwin, FreeBSD and NetBSD? Also, Is there any way to get the virtual status of the these machines (whether the system is virtual or physical). I need output using terminal commands.

For example,

Windows machine Installation date can be found using below command:

Command:

ssh host systeminfo | grep -i original

Output:

Original Install Date:     1/24/2014, 12:30:41 PM

Windows machine Virtual status of the machine can be found using below command:

Command:

ssh host systeminfo | grep -i manufacturer

Output:

OS Manufacturer:           Microsoft Corporation
System Manufacturer:       VMware, Inc.
yaegashi
  • 12,108
  • 1
  • 36
  • 41
Brenda
  • 133
  • 4

1 Answers1

0

On RedHat based Linux versions, timestamp of /root/anaconda-ks.cfg is a pretty good guide. Or use rpm -q --queryformat '%{installtime:date}' basesystem.

ls -l /root/anaconda-ks.cfg
-rw-------. 1 root root 2911 Nov 15  2014 /root/anaconda-ks.cfg

rpm -q --queryformat  '%{installtime:date}' basesystem
Sat 15 Nov 2014 08:40:28 AM PST

As for whether virtual or physical, reviewing contents of /proc/scsi/scsi is a fairly good guide.

cat /proc/scsi/scsi
Attached devices:
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware,  Model: VMware Virtual S Rev: 1.0
  Type:   Direct-Access                    ANSI  SCSI revision: 02

As is dmidecode -t 1.

dmidecode -t 1 | grep Manufacturer
        Manufacturer: VMware, Inc.
steve
  • 21,582
  • 5
  • 48
  • 75