\section{sar **}

\begin{frame}
   {sar}

   \begin{itemize}
      \item
      \textbf{sar} stands for the \textbf{S}ystems
      \textbf{A}ctivity \textbf{R}eporter
      \item
      All-purpose tool for gathering data and
      creating reports
      g      \item
      \textbf{sadc} accumulates statistics and stores
      periodically in \filelink{/var/log/sa}
      \item
      \textbf{sar} is invoked via:
      \begin{cmd}
$ sar [ options ] [ interval ] [ count ]
      \end{cmd}
      and is repeated at \verb?interval? seconds \verb?count?
      times
      \item
      With no options gives a report on CPU usage
   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{sar} stands for the \textbf{S}ystems
   \textbf{A}ctivity \textbf{R}eporter. It is an all-purpose
   tool for gathering system activity and performance data
   and creating reports that are readable by humans.

   On \textbf{Linux} systems the back end to \textbf{sar} is
   \textbf{sadc} (system activity data collector) which
   actually accumulates the statistics. It stores information
   in the \filelink{/var/log/sa} directory, with a daily
   frequency by default, but which can be adjusted.  Data
   collection can be started from the command line, and
   regular periodic collection is usually started as a
   \textbf{cron} job stored in
   \filelink{/etc/cron.d/sysstat}.

   \textbf{sar} then reads in this data (either from the
   default locations or by use of a file specified with the
   \verb?-f? option) and then produces a report.

   \begin{figure}[H]
      \includegraphics[width=7in]{IMAGES/sar}
      \caption{Using sar}
   \end{figure}

}

\begin{frame}
   {sar Example}

   \begin{itemize}
      \item This example reports on paging, I/O and transfer data statistics
   \end{itemize}

   \begin{figure}[H]
      \includegraphics[width=6.5in]{IMAGES/sario}
      \caption{Using sar to Get I/O Statistics}
   \end{figure}

\end{frame}

\cprotect\note{

   Here is a list of the major \textbf{sar} options, or modes,
   each one of which has it's own sub-options:

   \begin{table}[H]
      \caption{sar Options}
      \vspace{-15pt}
   \end{table}

   \small{\begin{tcolorbox}[tabularx={p{0.15\textwidth}|X}]

         \textbf{Option}
         &

         \textbf{Meaning}
         \\ \hline\hline


         \verb?-A?
         &

         Almost all information
         \\ \hline


         \verb?-b?
         &

         I/O and transfer rate statistics (similar to
         \textbf{iostat})
         \\ \hline

         \verb?-B?
         &

         Paging statistics including page faults
         \\ \hline
         \verb?-d?
         &

         Block device activity (similar to \textbf{iostat -x})
         \\ \hline

         \verb?-n?
         &

         Network statistics
         \\ \hline

         \verb?-P?
         &

         Per CPU statistics (as in \verb?sar -P ALL 3?)
         \\ \hline

         \verb?-q?
         &

         Queue lengths (run queue, processes and threads)
         \\ \hline

         \verb?-r?
         &

         Memory utilization statistics
         \\ \hline

         \verb?-S?
         &

         Swap utilization statistics
         \\ \hline

         \verb?-u?
         &

         CPU utilization (default)
         \\ \hline

         \verb?-v?
         &

         Statistics about inodes and files and file handles
         \\ \hline

         \verb?-w?
         &

         Context switching statistics.
         \\ \hline

         \verb?-W?
         &

         Swapping statistics, pages in and out per second
         \\ \hline

         \verb?-f?
         &

         Extract information from specified file, created by the
         \verb?-o? option
         \\ \hline

         \verb?-o?
         &

         Save readings in the file specified, to be read in later
         with \verb?-f? option
      \end{tcolorbox}}

}


