Tuesday, February 25, 2014

subscription-manager cheat sheet

Red Hat is moving from RHN Classic to Red Hat Subscription Management so you may want to start using subscription-manager instead of rhn_register. Here's a cheat sheet on how to register your system to the CDN, attach to what should be the appropriate channel, see other repos and add an extra repo. For more info see the documentation.

subscription-manager register
subscription-manager attach --auto
subscription-manager list --available
subscription-manager repos --enable=rhel-6-server-optional-rpms

Friday, February 14, 2014

ksar wrapper

I have been using ksar to analyze the output of sar. I often use it one specific way so I have a wrapper script which assumes you've done the following:

  1. Download kSar-X.y.z.zip from sourceforge
  2. Unpack it in /usr/local/ksar/
  3. ln -s /usr/local/ksar/kSar-X.y.z /usr/local/ksar/ksar
  4. Add the following script somewhere in your $PATH
#!/bin/bash
# Filename:                ksar
# Description:             Wrapper to run ksar
# Supported Langauge(s):   GNU bash, version 4.2.x
# Time-stamp:              <2014-02-14 16:12:18 someguy> 
# -------------------------------------------------------
# http://sourceforge.net/projects/ksar/
# -------------------------------------------------------
if [ "$#" -eq 1 ]
then
    /bin/java -jar /usr/local/ksar/ksar/kSar.jar -input $1  -outputPDF $1.pdf
else
    echo "Usage: 'ksar foo.sar'";
    echo "where foo.sar is a sar file produced by sar";
    echo "Note that such a file can be found in an sosreport";
fi
The assumption is that you just want to generate a PDF for a particular sar report
$ ksar sar11 
time to parse: 560ms number of line: 2527 line/msec: 4.0
$ 
$ mupdf sar11.pdf &