My Oracle Support Banner

Displaying Date And Time Values In Command Outputs To Simplify Problem Analysis (Doc ID 1469674.1)

Last updated on JULY 20, 2023

Applies to:

Solaris Operating System - Version 8 6/00 U1 and later
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on x86-64 (64-bit)

Goal

Commands like vmstat and mpstat are frequently used to find out if there was a resource shortage (e.g. low free memory) which could explain unwanted application behavior. In cases when an application is not behaving as desired, application and/or system logs (/var/adm/messages) typically contain a date and time stamp together with an error or warning code and message. Solaris commands like vmstat do not print out date and time strings with each record, making it more difficult to find out if a certain application event corresponds to a certain system status like low amount of free memory.

Beginning with Solaris 11, these commands come with a T option which print a date and time stamp in a separate line, before the actual values are printed. However, as the date and time stamp is not in the same line as the other data, it requires an additional data processing step to prepare the data for creating a graph in a spreadsheet application. Graphs often make it easier to show and understand the trend of relevant performance data.

The solution offered in this document will print out a date and time string before each line of output, so that the output can be imported into a spreadsheet and a graph with events vs. date and/or time can be created from it.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.