Tuesday, December 17, 2013

SPARC Solaris: I've forgotten what I used to know

First of all... I know I should be using dtrace.  But my SPARC Solaris world has grown so small I haven't touched dtrace in 4 years.

Got some unattended logging to perform in order to give feedback and recommendations next week.  I know I could get a timestamp with each iteration of iostat, but I need a timestamp with each device output line for sorting and aggregation.

I really should pipe the commands to logger and redirect output to a file.  But on my test server as a nonroot user, the output is being swallowed and I don't have the time right now to figure out why :)

So, I'll solve this in sasquatch form by piping to nawk, very similar to the way I pipe AIX to awk to get timestamps on what I want.

iostat -X 2 2 | nawk '{"date \"+%m/%d/%Y %H:%M:%S\"" | getline date; close("date \"+%m/%d/%Y %H:%M:%S\""); printf ("%s %s\n", date, $0); }'

vmstat 2 2 | nawk '{"date \"+%m/%d/%Y %H:%M:%S\"" | getline date; close("date \"+%m/%d/%Y %H:%M:%S\""); printf ("%s %s\n", date, $0); }'

I'll undoubtedly in some future spare time both figure out what is wrong with my logger, and return for some dtrace fun.  I'll  be coming back for dtrace especially because after so many years of missing out on the Linux excitement, dtrace just might give me a chance to even the playing field.  Who would've guessed the excitement at IBM about Linux on Power?  And SUSE on the Z series?  Astounding!  All right... enough for now....

No comments:

Post a Comment