System Administration



Similar documents
Linux System Administration. System Administration Tasks

Facultat d'informàtica de Barcelona Univ. Politècnica de Catalunya. Administració de Sistemes Operatius. System monitoring

Syslog & xinetd. Stephen Pilon

CSE 265: System and Network Administration

Chapter 10: System monitoring and logging. Chapter 10 System monitoring and logging

Red Hat Linux Administration II Installation, Configuration, Software and Troubleshooting

Monitoring Linux with native tools

System Resources. To keep your system in optimum shape, you need to be CHAPTER 16. System-Monitoring Tools IN THIS CHAPTER. Console-Based Monitoring

Linux Syslog Messages in IBM Director

The System Monitor Handbook. Chris Schlaeger John Tapsell Chris Schlaeger Tobias Koenig

CSE/ISE 311: Systems Administra5on Logging

Topics. CIT 470: Advanced Network and System Administration. Logging Policies. System Logs. Throwing Away. How to choose a logging policy?

Red Hat System Administration 1(RH124) is Designed for IT Professionals who are new to Linux.

Using SNMP with Content Gateway (not V-Series)

Linux System Administration on Red Hat

Using an Open Source Framework to Catch the Bad Guy. Norman Mark St. Laurent Senior Solutions Architect, Red Hat

Partitioning. Files on the Hard Drive. Administration of Operating Systems DO2003. Partition = Binder with index. Write file = Insert document

Distributed Computing under Linux

Performance monitoring. in the GNU/Linux environment. Linux is like a wigwam - no Windows, no Gates, Apache inside!

VIRTUALIZATION AND CPU WAIT TIMES IN A LINUX GUEST ENVIRONMENT

SLURM Resources isolation through cgroups. Yiannis Georgiou Matthieu Hautreux

Linux logging and logfiles monitoring with swatch

These sub-systems are all highly dependent on each other. Any one of them with high utilization can easily cause problems in the other.

How To Analyze Logs On Aloha On A Pcode On A Linux Server On A Microsoft Powerbook (For Acedo) On A Macbook Or Ipad (For An Ubuntu) On An Ubode (For Macrocess

syslog - centralized logging

CPSC 2800 Linux Hands-on Lab #7 on Linux Utilities. Project 7-1

Typeset in L A TEX from SGML source using the DocBuilder Document System.

Linux Security Ideas and Tips

CYAN SECURE WEB APPLIANCE. User interface manual

20 Command Line Tools to Monitor Linux Performance

CIT 470: Advanced Network and System Administration. Topics. Performance Monitoring. Performance Monitoring

MONITORING PERFORMANCE IN WINDOWS 7

TOP(1) Linux User s Manual TOP(1)

Server Management Tools (ASMT)

RH033 Red Hat Linux Essentials or equivalent experience with Red Hat Linux..

OS Thread Monitoring for DB2 Server

Monitoring IBM HMC Server. eg Enterprise v6

Using esxtop to Troubleshoot Performance Problems

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Extreme Linux Performance Monitoring Part II

Topics. CIT 470: Advanced Network and System Administration. Why Monitoring? Why Monitoring? Historical Monitoring Processes. Historical Monitoring

Using New Relic to Monitor Your Servers

IBM Tivoli Monitoring Version 6.3 Fix Pack 2. Infrastructure Management Dashboards for Servers Reference

Cisco Setting Up PIX Syslog

Sawmill Log Analyzer Best Practices!! Page 1 of 6. Sawmill Log Analyzer Best Practices

UNISOL SysAdmin. SysAdmin helps systems administrators manage their UNIX systems and networks more effectively.

Linux Kernel Architecture

System Administration Guide

Volume SYSLOG JUNCTION. User s Guide. User s Guide

Thirty Useful Unix Commands

Configuring System Message Logging

HARFORD COMMUNITY COLLEGE 401 Thomas Run Road Bel Air, MD Course Outline CIS INTRODUCTION TO UNIX

This is when a server versus a workstation is desirable because it has the capability to have:

W3Perl A free logfile analyzer

Runtime Monitoring & Issue Tracking

Advanced Linux System Administration on Red Hat

Operating System Monitor Application (OS MON)

Embedded Event Manager Commands

Workflow Templates Library

Security Correlation Server Quick Installation Guide

Rsync: The Best Backup System Ever

Linux Crontab: 15 Awesome Cron Job Examples

EMC VNX Version 8.1 Configuring and Using the Audit Tool on VNX for File P/N Rev 01 August, 2013

Integrity Checking and Monitoring of Files on the CASTOR Disk Servers

IceWarp to IceWarp Server Migration

HOWTO: Set up a Vyatta device with ThreatSTOP in router mode

Backing Up TestTrack Native Project Databases

Virtual Private Systems for FreeBSD

Red Condor Syslog Server Configurations

GL254 - RED HAT ENTERPRISE LINUX SYSTEMS ADMINISTRATION III

Unit objectives IBM Power Systems

Chapter 2: Getting Started

Linux Security on HP Servers: Security Enhanced Linux. Abstract. Intended Audience. Technical introduction

SSL Tunnels. Introduction

Host Hardening. OS Vulnerability test. CERT Report on systems vulnerabilities. (March 21, 2011)

Improved metrics collection and correlation for the CERN cloud storage test framework

ipta iptables Log Analyzer Anders Sikvall ichimusai.org

HelpSystems Web Server User Guide

CIT 470: Advanced Network and System Administration. Topics. Why Monitoring? System Monitoring

Leak Check Version 2.1 for Linux TM

Oracle Linux 7: System Administration Ed 1 NEW

Sophos Anti-Virus for Linux user manual

Web Application s Performance Testing

The Ins and Outs of System Logging Using Syslog

Operating System and Process Monitoring Tools

Syslog (Centralized Logging and Analysis) Jason Healy, Director of Networks and Systems

Unix::Statgrab - System Monitoring

TDA - Thread Dump Analyzer

Also on the Performance tab, you will find a button labeled Resource Monitor. You can invoke Resource Monitor for additional analysis of the system.

Incremental Backup Script. Jason Healy, Director of Networks and Systems

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

HOWTO: Set up a Vyatta device with ThreatSTOP in bridge mode

Avira AntiVir MailGate 3.2 Release Notes

4PSA Total Backup User's Guide. for Plesk and newer versions

SAS Application Performance Monitoring for UNIX

Transcription:

Performance Monitoring For a server, it is crucial to monitor the health of the machine You need not only real time data collection and presentation but offline statistical analysis as well Characteristics of a computer's health: Load Disk usage Process accounting

Load Load average measures the number of processes in the run queue, i.e. the number of processes waiting to use the CPU Ideally, load should be 1 or less Several ways to obtain load averages: uptime, w, ps, top all report load averages cat /proc/load tload, xload present graphical displays of load

Performance Monitoring Load Exercise Run xload and start an intensive process # xload update 1 scale 2 & # ooimpress &

df [file or file system] System Performance Monitoring Disk Usage Disks do no good if they are full This is especially true for server processes. If a log file cannot be written, some daemons may crash du gives a report of disk usage. It will descend all directories unless the s option is given df gives a report of disk usage and the amount of free space available

Process Accounting THE most important thing to monitor is what is running on your computer Processes are tasks being executed by your CPU Each process is allocated space in the process table which tracks information the CPU needs to schedule and swap a task for CPU and memory usage Information for processes currently in the process table can be retrieved with the ps and top commands pstree is also very useful for following the process ownership

Process Accounting ps gives a variety of output depending on the options selected. Most useful options A show all processes a show only processes connected with a tty x show only processes disconnected from a tty u display the effective user name o user defined format

Process Accounting Example ps output: <lister> ps xua root 1 0.0 0.0 1320 484? S Jan13 0:04 init edsall 5047 0.0 0.0 3876 564 pts/8 S 14:03 0:00 sleep 300 edsall 5066 0.0 0.0 2872 980 pts/10 R 14:07 0:00 ps xua giving the following information Username Process ID (PID) Percent CPU being used Percent memory being used Virtual memory size Resident memory usage Associated TTY Current process status Date/time the process was started System tme used by the process Name of the command

State codes First letter: R running S interruptible sleep D uninterruptible sleep T stopped Z zombie Second letter: + foreground process s session leader N low priority ( nice ) < high priority (not nice) l multithreaded

Performance Monitoring Process Accounting ps only gives a one time snapshot of the processes in the process table top gives process information which updates at regular intervals. top also allows you to interactively sort the information being displayed top presents other useful system information including the system load average and memory usage

Performance Monitoring Process Accounting Example top output: 8:05pm up 8 days, 2:31, 1 user, load average: 0.54, 0.55, 0.50 57 processes: 56 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 1.9% user, 2.3% system, 0.0% nice, 95.6% idle Mem: 776780K av, 664392K used, 112388K free, 46804K shrd, 270344K buff Swap: 530104K av, 4124K used, 525980K free 195596K cached PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND 29370 root 16 0 1028 1028 824 R 0 1.5 0.1 0:00 top 27682 nobody 2 0 15780 14M 4492 S 0 0.5 1.9 0:06 httpd 28409 nobody 14 0 14900 13M 4532 S 0 0.3 1.8 0:03 httpd 28895 nobody 1 0 15008 14M 4512 S 0 0.3 1.8 0:03 httpd 27666 nobody 1 0 15156 14M 4500 S 0 0.1 1.8 0:06 httpd 27687 nobody 17 0 16648 15M 4532 S 0 0.1 2.0 0:06 httpd 27829 nobody 7 0 14984 14M 4496 S 0 0.1 1.8 0:03 httpd 28211 nobody 1 0 14684 13M 4504 S 0 0.1 1.8 0:03 httpd 29341 root 1 0 1112 1112 832 S 0 0.1 0.1 0:00 in.rlogind

Performance Monitoring Process Accounting Run ps aux # ps aux Run top # top Exercises

/proc File System On Linux systems (and many other operating systems), ps and top actually read their data from the /proc file system /proc is a mirror of the kernel configuration and what is currently memory resident As a result we can not only read the state of the system but modify its configuration in real time Information in /proc is stored in files in a hierarchical manner based on the aspect of the system they describe

/proc File System Examples: loadavg file containing System load average meminfo file containing the number of total, used and free bytes of memory and swap area cpuinfo file containing recognized processor parameters net Directory containing descriptions about the network layer(s)

/proc File System Information on current processes is stored in directories corresponding to the PID of the process. Example: The init command, corresponding to PID = 1 has the following subdirectories in /proc/1: cmdline cwd environ exe fd maps mem mounts root stat statm status # cat /proc/1/environ HOME=/ TERM=linux

Monitoring the health of your computer can be enhanced by collecting data and analyzing later to look for trends. There are many ways to do this: Write your own packages Use an Open Source package Use a commercial package Examples: Tivoli Ecotools Candle

Before writing your own package, look to see if someone else has already done the work for you. Many Open Source packages available psacct sysstat Hobbit

psacct The psacct package provides simple process accounting and process summary information. Data collection is initiated with the command accton These data can later be analyzed with the commands ac, lastcomm and sa, the most useful of which is sa

Performance Analysis sysstat The sysstat package, which comes by default with most recent Red Hat Linux distributions, collects an enormous amount of data on system resources including paging activity interrupts network activity memory

Performance Analysis sysstat Several times a day, cron runs the commands in the /etc/cron.d/sysstat crontab to collects the data. The same crontab analyzes the collected data once a day. Results can be found in /var/log/sa/ and reports can be generated with the sar command.

Performance Analysis sysstat Exercise Look at the contents of /var/log/sa # ls l /var/log/sa Run the sar command to get a report # /usr/bin/sar A more

Hobbit Hobbit is an open source pacakge available to most non profit groups for free. Hobbit not only generates history graphs, it also, and most prominently, is used as a real time performance monitor IT Services uses Hobbit: http://kosh.its.iastate.edu More information can be found at http://hobbitmon.sourceforge.net/

Log Files Many processes running on the system generate log files Linux stores all of its system log files in a special directory /var Log files can quickly fill the partition on which they are stored Tip create a separate partition for /var

Log Files One important system logging process syslogd. Many processes make a syslog call to write information to the system log void openlog(char *ident, int option, int facility); void syslog(int priority, char *format,...); void closelog(void); The processes are always writing. Whether you wish to see it depends on how you configure syslogd

Log Files syslogd is configured with the file /etc/syslog.conf Each line consists of a selector and an action for that selector # Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;cron.none /var/log/messages

Log Files # Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;cron.none /var/log/messages The selector identifies the facility which may request logging and the priority level at which it may want logging. See the correlation? void openlog(char *ident, int option, int facility); void syslog(int priority, char *format,...); For each selector an action is specified. In most cases, the action is the name of a file to which the messages will be logged

Remote Log Files syslogd can log its information to a remote server: *.* @remotelog1.iastate.edu *.* @remotelog2.iastate.edu In this case, syslogd will send everything to the syslog daemon on the remote servers remotelog1 and remotelog2 If the bad guys tamper with log files on your server, you have a pristine copy elsewhere that might show their break in

Monitoring Your Log Files logwatch Daily analysis of logfiles can be e mailed to you Global and local configuration Can analyze on a per service basis In /etc/log.d: Scripts for services and filters they use Config files for services

Monitoring Your Log Files logwatch ######## LogWatch 4.3.2 (02/18/03)######## Processing Initiated: Mon Mar 26 11:33:53 2007 Date Range Processed: yesterday Detail Level of Output: 0 Logfiles for Host: webmail 1.iastate.edu ####################################### Connections (secure log) Begin Connections: Service shell: 129.186.140.67: 4 Time(s) Connections (secure log) End

Reining in Your Log Files logrotate Wouldn't it be nice if we could delete old log files or move them elsewhere? Otherwise, our disks may fill. logrotate can: Back up Compress Mail logfiles subject to a variety of constraints you specify

Reining in Your Log Files logrotate logrotate is configured via a set of configuration files Generally one main config file (/etc/logrotate.conf) is used to include other config files in /etc/logrotate.d The config files contain the name of the file to be acted on and directives which specify the actions to be taken, how often to take these actions, etc

Reining in Your Log Files logrotate # Logrotate file for psacct RPM /var/account/pacct { prerotate /usr/sbin/accton endscript compress notifempty daily rotate 31 create 0600 root root postrotate /usr/sbin/accton /var/account/pacct endscript }