SlideShare une entreprise Scribd logo
1  sur  41
CHAPTER FOUR
Resource Monitoring and management
process and Disks
System and NetworkAdministration
● Controlling Processes
– Components of a process
– Life cycle of a process
– Signals
– Send signals using kill and killall
– Process states
– Influence scheduling priority with nice and renice
– Monitoring processes with ps and top
– Runaway processes
– Periodic processes
Components of a process
– A process is the instantiation of a program.
– From the kernel's perspective, a process is:
● An address space (the set of memory pages with code,
libraries, and data)
● Set of data structures (within the kernel)
– The process's address space map
– Current status
– Execution priority
– Resources used
– Signal mask (which signals are blocked)
– The owner
– Which instructions are currently being executed
Process attributes
● Process ID – PID
– Unique identifier, wraps around
● Parent PID – PPID
– When a process is cloned, there is a parent and a child
● Real and effective user ID – UID and EUID
– EUID is used to determine what permissions the process has
– Also records original EUID (saved UID)
● Can be re-accessed later in program (even after changing EUID)
● Real and effective group ID – GID and EGID
● Niceness
– The CPU time available depends on its scheduling priority
– Users can make their processes 'nicer' to the rest of the system
● Control terminal – where stdin, stdout, stderr are attached
Signals
● Signals are process-level interrupt requests
● Uses
– Inter-process communication
– Terminal driver can kill, interrupt or suspend
processes (Ctrl-C, Ctrl-Z)
– Can be sent by admin (with kill) for various purposes
– Can be sent by kernel when process breaks a rule
● e.g., division by zero
– Can be sent by kernel for i/o available, death of child
Handling signals
– Process can designate a signal handler for a
particular signal
– If no handler, kernel takes some default action
– When handler is finished catching signal, execution
continues where the signal was received
– Process can request that particular signals be
ignored, or blocked
– If signal is received while blocked, one instance of that
signal is buffered until it is unblocked
Important signals
Sending signals
# kill [-signal] pid
# kill sends TERM signal by default
# kill -9 pid === kill -KILL pid
– “Guarantees” that the process will die
# kill -USR1 910 3044
# sudo killall -USR1 httpd
– killall removes need for pid
Process states
● Process exist in one of four states
– Runnable – can be executed
– Sleeping – waiting for some resources
● Gets no CPU time until resource is available
– Zombie – trying to die (parent hasn't waited)
– Stopped – process is suspended (i.e., not
permitted to run)
● Like sleeping, but can't wake until CONT received
Scheduling priority
– “Niceness” is hint to kernel about how often to
schedule the process
– Linux ranges from -20 (high priority, not nice) to +19 (low
priority, very nice), 0 is default
– User/process can raise, but not lower niceness
● Root can lower
– Examples
% nice +5 ~/bin/longtask
% renice -5 8829
% sudo renice 5 -u boggs
Monitoring processes: ps
● /bin/ps primary tool
● Shows
– PID, UID, priority, control terminal
– Memory usage, CPU time, status
● Multiple variations of ps
– ps -aux (BSD, Linux)
– ps -Af (Solaris)
Example ps output
Monitoring processes: top
● /usr/bin/top is optional in some OSes
● Shows top-n CPU-using processes
– Plus other stats, like memory usage and
availability, system load
– Can renice within top
– Automatically refreshes screen every 5 seconds
– Can focus on a particular user
Sample top output
Runaway processes
● What can you do about processes using an
unusual amount of resources (memory, CPU,
disk space)?
– Identify resource hogs using top and/or ps
– Contact owner and ask about resource usage
– Suspend using STOP signal (might break job)
● Contact owner, restart or kill later
– Renice CPU hog
Creating periodic processes
● Automation, as you've heard, is key to efficiency
● Instead of manually performing tasks daily,
weekly, or monthly, you can schedule them
– cron
– anacron
● Includes tasks like:
– monitoring, log rotation, backups, file distribution
cron
– cron daemon performs tasks at scheduled times
– crontab files are examined by cron for schedule
● /etc/crontab, /etc/cron.d/*, /var/spool/cron/*
– cron wakes up each minute and checks to see if
anything needs to be executed
– cron is susceptible to changes in time
● doesn't compensate for when machine is down, or time
changes (clock adjustments or daylight savings time) that are
sufficiently large (3 hours, at least for some implementations)
– anacron works daily
● records when task last performed, and will catch up with
missing time
crontab files
– Filename provides username in /var/spool/cron/
– Example crontab entries:
# run make at 2:30 each Monday morning
30 2 * * 1 (cd /home/joe4/project; make)
Managing crontabs
● Use crontab -e to edit
– Checks out a copy
– Uses EDITOR environment variable
– Resubmits it to the /var/spool/cron/ directory
● crontab -l will list the contents to stdout
● /etc/cron.allow and /etc/cron.deny can control access to
cron facilities
Using cron
– Distributions set up crontab entries to automatically
run scripts in
● /etc/cron.monthly/
● /etc/cron.weekly/
● /etc/cron.daily/
● /etc/cron.hourly/
– Typical tasks:
● Cleaning the filesystem (editor files, core files) using find
● Distributing files (mail aliases, sendmail config, etc.)
using: rsync, rdist, or expect
● Log rotation
Disks
● Partitions
● Volumes
● Filesystems
● Files
Adding a disk to Linux
STEP-BY-STEP (w/out LVM)
– Install new hardware
● verify that hardware is recognized by BIOS or controller
– Boot, make certain device files already exist in /dev
● e.g., /dev/sdc
– Use fdisk/to partition the drive
● Verify the system type on each partition
– Use mke2fs (-t ext4) on each regular partition
● To create (an ext4) filesystem
– Use mkswap to initialize swap partitions
– Add entries to /etc/fstab
– Mount by hand, then reboot to verify everything
hdparm: test/set hd params
● hdparm will do simple performance tests
Disk partitions
– Drives are divided into one or more partitions that are
treated independently
● Partitions make backups easier, confine damage
– Typically have at least two or three
● root partition (one)
– everything needed to bring system up in single-user mode
(often copied onto another disk for emergencies)
● swap partition (at least one)
– stores virtual memory when physical memory is insufficient
● user partition(s)
– home directories, data files, etc.
● boot partition - boot loader, kernel, etc.
Logical Volumes
– Partitions are static, and sometimes you want to
change them
– LVM (Linux Logical Volume Manager) lets you combine
partitions and drives to present an aggregate volume as a
regular block device (just like a disk or partition)
● Use and allocate storage more efficiently
● Move logical volumes among different physical devices
● Grow and shrink logical volume sizes on the fly
● Take “snapshots” of whole filesystems
● Replace on-line drives without interrupting service
– Similar systems are available for other OSes
LVM
Sample organization:
Filesystems
– Linux filesystems are created in partitions or volumes
● ext2fs (2nd Extended File System) is old
● ext3fs (3rd Extended File System) is common
● ext4fs (Fourth Extended File System) is modern
– Speeds large directories
– Compatible with ext2 and ext3
● Other filesystems also supported
– ReiserFS, IBM's JFS, SGI's XFS
● Can read foreign filesystems (e.g., FAT, NTFS, ISO 9660)
ext# filesystems
– For ext2/ext3/ext4, mke2fs is used, which creates
● A set of inode storage cells
– each holds info about one file
● A set of scattered “superblocks”
– holds global filesystem info (multiple copies for reliability)
– size and location of inode tables, block map and usage,
etc.
● A map of the disk blocks in the filesystem (used and free)
● The set of data blocks
Mounting a filesystem
– Filesystem must be mounted before use
● Must be made part of root filesystem
– Can be mounted on (top of) any directory
# mount /dev/sda1 /usr/local
# df /usr/local
– Use /mnt for temporary mounts
– Want to set up automatic mounting
4.1. printers
● Printing and print services
– Printing policies and architecture
– Printing terms
– Types of printers
– Adding a printer
– Common printing software
Where should printers be located?
– Some want a printer on their
own desk
● Very convenient but expensive
– Some want to be able to print
to any printer, no matter where it is
● Flexible, able to borrow specialty printers as needed
– Finance people want to centralize everything
● A single high-speed printer, single high-quality printer,
and one color printer per building (most cost-effective)
– Others want to charge every expense
● Regardless of how much is out there, those who use it,
pay for it
Real world
● People need to be able to print to any printer
they have permission to use
● Centralized printing services can save money
– Ten people who might otherwise buy slow, lowquality
personal printers
● The sysadmin only has to support one printer
driver/printer rather than 10
Print architecture
● How centralized will printing be?
– How many people will share a printer for general
printing?
– Who qualifies for a personal printer?
– How will they be networked?
● Network printers can benefit from a central print-spool
– How will they be maintained?
Printing terms
● spooler
– Daemon that receives print
jobs,
stores, prioritizes, and sends
them sequentially to be printed
● PDL
– Page Description Language,
usually device and resolution
independent
– PostScript, PCL, PDF
● bitmap
– JPEG, TIFF, GIF, PNG
● RIP
– Raster image processor
– Accepts PDL input, generates
bitmap appropriate for a
particular device
● filters
– Modify print jobs on their way
to a printer
● PostScript
– Most common PDL – also a
full programming language
Types of printers
– Classified by connection interface
● Serial and parallel printers
– USB faster and the default today for personal printers
● Network printers
– Contain network interfaces (e.g., ethernet or wifi)
– Accept jobs via one or more printing protocols
● including via, IPP, HP JetDirect
CUPS
– Common UNIX Printing System
● Latest rewrite of the printing system
– Also supports secure printing (SSL, etc.)
– Implements IPP: Internet Printing Protocol (HTTPbased)
– Supports load-balancing across a class of printers
– Supports automatic network configuration
– Standard in most Linux distributions
http://www.cups.org/
Network and system monitoring tools
• The tools that monitor the infrastructure should be
designed to add the least performance impact on the
system that is being monitored. In other words, these
tools need to be as unobtrusive as possible to avoid any
added burden on the production services.
• Monitoring tools can be categorized as:
Command Line Tools
Desktop Monitoring Tools
Infrastructure Monitoring Tools
Log Monitoring Tools
Network Monitoring Tools
Considerations of Selecting Network
monitoring Tools
• When looking for a system monitoring software package
there are many things to consider. Apart from the basic
monitoring functionalities such as processes and system
performance, it is essential that the tool allows the
following features
Customizable alerts and notifications.
 Auto-discovery of systems.
Easy graphical user interface.
Automatic update measurements.
Easy Installation and operation.
Project on Network and system
monitoring tools
• Introduction about the tool
• Applications (usage) of tool
• Installation steps
• Additional tools or plugins that can enhance performance
of the tool
• Configuring network parameters
• Special features of the tool
• Steps to run the tool features (Note: support the steps
with example)
• Conclusion
Tools
1. Nagios
2. Gnome system monitor
3. Cacti
4. KDE system Guard
5. Solarwinds SAM (Server & Application Monitor)
6. PRTG by Paessler
7. OPManager by ManageEngine
8. WhatsUp Gold
9. Zabbix
10. Spiceworks
11. Sarg (Squid Analysis Report Generator)
12. GoAccess
Next chapter 5: Data center security

Contenu connexe

Tendances

User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanismsDuressa Teshome
 
Red Hat Certified engineer course
  Red Hat Certified engineer course   Red Hat Certified engineer course
Red Hat Certified engineer course Ali Abdo
 
Introduction to Network and System Administration
Introduction to Network and System AdministrationIntroduction to Network and System Administration
Introduction to Network and System AdministrationDuressa Teshome
 
Linux User Management
Linux User ManagementLinux User Management
Linux User ManagementGaurav Mishra
 
Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in LinuxSAMUEL OJO
 
Server configuration
Server configurationServer configuration
Server configurationAisha Talat
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in LinuxKnoldus Inc.
 
communication-protocols
 communication-protocols communication-protocols
communication-protocolsAli Kamil
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 

Tendances (20)

User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanisms
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Red Hat Certified engineer course
  Red Hat Certified engineer course   Red Hat Certified engineer course
Red Hat Certified engineer course
 
Introduction to Network and System Administration
Introduction to Network and System AdministrationIntroduction to Network and System Administration
Introduction to Network and System Administration
 
Windows server
Windows serverWindows server
Windows server
 
Nfs
NfsNfs
Nfs
 
Unix case-study
Unix case-studyUnix case-study
Unix case-study
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Presentation on linux
Presentation on linuxPresentation on linux
Presentation on linux
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Server configuration
Server configurationServer configuration
Server configuration
 
Kernels and its types
Kernels and its typesKernels and its types
Kernels and its types
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in Linux
 
Network monitoring tools
Network monitoring toolsNetwork monitoring tools
Network monitoring tools
 
communication-protocols
 communication-protocols communication-protocols
communication-protocols
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 

Similaire à Resource Monitoring and management

Unix Internals OS Architecture
Unix Internals OS ArchitectureUnix Internals OS Architecture
Unix Internals OS ArchitectureKhader Shaik
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architectureSHAJANA BASHEER
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & ApplicationsMaulen Bale
 
Ericas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-GuideEricas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-GuideErica StJohn
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Gaurav Aggarwal
 
linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning iman darabi
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systemsRai University
 
Mca i-fundamental of computer-u-3-functions operating systems
Mca  i-fundamental of  computer-u-3-functions operating systemsMca  i-fundamental of  computer-u-3-functions operating systems
Mca i-fundamental of computer-u-3-functions operating systemsRai University
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsRai University
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsRai University
 

Similaire à Resource Monitoring and management (20)

An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Unix Internals OS Architecture
Unix Internals OS ArchitectureUnix Internals OS Architecture
Unix Internals OS Architecture
 
Syslog.ppt
Syslog.pptSyslog.ppt
Syslog.ppt
 
Intro to operating_system
Intro to operating_systemIntro to operating_system
Intro to operating_system
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
Ch3 processes
Ch3   processesCh3   processes
Ch3 processes
 
Os
OsOs
Os
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Linux
LinuxLinux
Linux
 
Ericas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-GuideEricas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-Guide
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)
 
linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning
 
FUSE Filesystems
FUSE FilesystemsFUSE Filesystems
FUSE Filesystems
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systems
 
Mca i-fundamental of computer-u-3-functions operating systems
Mca  i-fundamental of  computer-u-3-functions operating systemsMca  i-fundamental of  computer-u-3-functions operating systems
Mca i-fundamental of computer-u-3-functions operating systems
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 
Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 

Dernier

Thane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call GirlsThane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call GirlsPooja Nehwal
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...Call Girls in Nagpur High Profile
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...tanu pandey
 
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Naicy mandal
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...anilsa9823
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gapedkojalkojal131
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhisoniya singh
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Pooja Nehwal
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...Pooja Nehwal
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...Pooja Nehwal
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Dernier (20)

Thane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call GirlsThane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call Girls
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
 
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
 
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Call Girls In Vaishali 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Vaishali 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Vaishali 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Vaishali 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
 

Resource Monitoring and management

  • 2. process and Disks System and NetworkAdministration ● Controlling Processes – Components of a process – Life cycle of a process – Signals – Send signals using kill and killall – Process states – Influence scheduling priority with nice and renice – Monitoring processes with ps and top – Runaway processes – Periodic processes
  • 3. Components of a process – A process is the instantiation of a program. – From the kernel's perspective, a process is: ● An address space (the set of memory pages with code, libraries, and data) ● Set of data structures (within the kernel) – The process's address space map – Current status – Execution priority – Resources used – Signal mask (which signals are blocked) – The owner – Which instructions are currently being executed
  • 4. Process attributes ● Process ID – PID – Unique identifier, wraps around ● Parent PID – PPID – When a process is cloned, there is a parent and a child ● Real and effective user ID – UID and EUID – EUID is used to determine what permissions the process has – Also records original EUID (saved UID) ● Can be re-accessed later in program (even after changing EUID) ● Real and effective group ID – GID and EGID ● Niceness – The CPU time available depends on its scheduling priority – Users can make their processes 'nicer' to the rest of the system ● Control terminal – where stdin, stdout, stderr are attached
  • 5. Signals ● Signals are process-level interrupt requests ● Uses – Inter-process communication – Terminal driver can kill, interrupt or suspend processes (Ctrl-C, Ctrl-Z) – Can be sent by admin (with kill) for various purposes – Can be sent by kernel when process breaks a rule ● e.g., division by zero – Can be sent by kernel for i/o available, death of child
  • 6. Handling signals – Process can designate a signal handler for a particular signal – If no handler, kernel takes some default action – When handler is finished catching signal, execution continues where the signal was received – Process can request that particular signals be ignored, or blocked – If signal is received while blocked, one instance of that signal is buffered until it is unblocked
  • 8. Sending signals # kill [-signal] pid # kill sends TERM signal by default # kill -9 pid === kill -KILL pid – “Guarantees” that the process will die # kill -USR1 910 3044 # sudo killall -USR1 httpd – killall removes need for pid
  • 9. Process states ● Process exist in one of four states – Runnable – can be executed – Sleeping – waiting for some resources ● Gets no CPU time until resource is available – Zombie – trying to die (parent hasn't waited) – Stopped – process is suspended (i.e., not permitted to run) ● Like sleeping, but can't wake until CONT received
  • 10. Scheduling priority – “Niceness” is hint to kernel about how often to schedule the process – Linux ranges from -20 (high priority, not nice) to +19 (low priority, very nice), 0 is default – User/process can raise, but not lower niceness ● Root can lower – Examples % nice +5 ~/bin/longtask % renice -5 8829 % sudo renice 5 -u boggs
  • 11. Monitoring processes: ps ● /bin/ps primary tool ● Shows – PID, UID, priority, control terminal – Memory usage, CPU time, status ● Multiple variations of ps – ps -aux (BSD, Linux) – ps -Af (Solaris)
  • 13. Monitoring processes: top ● /usr/bin/top is optional in some OSes ● Shows top-n CPU-using processes – Plus other stats, like memory usage and availability, system load – Can renice within top – Automatically refreshes screen every 5 seconds – Can focus on a particular user
  • 15. Runaway processes ● What can you do about processes using an unusual amount of resources (memory, CPU, disk space)? – Identify resource hogs using top and/or ps – Contact owner and ask about resource usage – Suspend using STOP signal (might break job) ● Contact owner, restart or kill later – Renice CPU hog
  • 16. Creating periodic processes ● Automation, as you've heard, is key to efficiency ● Instead of manually performing tasks daily, weekly, or monthly, you can schedule them – cron – anacron ● Includes tasks like: – monitoring, log rotation, backups, file distribution
  • 17. cron – cron daemon performs tasks at scheduled times – crontab files are examined by cron for schedule ● /etc/crontab, /etc/cron.d/*, /var/spool/cron/* – cron wakes up each minute and checks to see if anything needs to be executed – cron is susceptible to changes in time ● doesn't compensate for when machine is down, or time changes (clock adjustments or daylight savings time) that are sufficiently large (3 hours, at least for some implementations) – anacron works daily ● records when task last performed, and will catch up with missing time
  • 18. crontab files – Filename provides username in /var/spool/cron/ – Example crontab entries: # run make at 2:30 each Monday morning 30 2 * * 1 (cd /home/joe4/project; make)
  • 19. Managing crontabs ● Use crontab -e to edit – Checks out a copy – Uses EDITOR environment variable – Resubmits it to the /var/spool/cron/ directory ● crontab -l will list the contents to stdout ● /etc/cron.allow and /etc/cron.deny can control access to cron facilities
  • 20. Using cron – Distributions set up crontab entries to automatically run scripts in ● /etc/cron.monthly/ ● /etc/cron.weekly/ ● /etc/cron.daily/ ● /etc/cron.hourly/ – Typical tasks: ● Cleaning the filesystem (editor files, core files) using find ● Distributing files (mail aliases, sendmail config, etc.) using: rsync, rdist, or expect ● Log rotation
  • 21. Disks ● Partitions ● Volumes ● Filesystems ● Files
  • 22. Adding a disk to Linux STEP-BY-STEP (w/out LVM) – Install new hardware ● verify that hardware is recognized by BIOS or controller – Boot, make certain device files already exist in /dev ● e.g., /dev/sdc – Use fdisk/to partition the drive ● Verify the system type on each partition – Use mke2fs (-t ext4) on each regular partition ● To create (an ext4) filesystem – Use mkswap to initialize swap partitions – Add entries to /etc/fstab – Mount by hand, then reboot to verify everything
  • 23. hdparm: test/set hd params ● hdparm will do simple performance tests
  • 24. Disk partitions – Drives are divided into one or more partitions that are treated independently ● Partitions make backups easier, confine damage – Typically have at least two or three ● root partition (one) – everything needed to bring system up in single-user mode (often copied onto another disk for emergencies) ● swap partition (at least one) – stores virtual memory when physical memory is insufficient ● user partition(s) – home directories, data files, etc. ● boot partition - boot loader, kernel, etc.
  • 25. Logical Volumes – Partitions are static, and sometimes you want to change them – LVM (Linux Logical Volume Manager) lets you combine partitions and drives to present an aggregate volume as a regular block device (just like a disk or partition) ● Use and allocate storage more efficiently ● Move logical volumes among different physical devices ● Grow and shrink logical volume sizes on the fly ● Take “snapshots” of whole filesystems ● Replace on-line drives without interrupting service – Similar systems are available for other OSes
  • 27. Filesystems – Linux filesystems are created in partitions or volumes ● ext2fs (2nd Extended File System) is old ● ext3fs (3rd Extended File System) is common ● ext4fs (Fourth Extended File System) is modern – Speeds large directories – Compatible with ext2 and ext3 ● Other filesystems also supported – ReiserFS, IBM's JFS, SGI's XFS ● Can read foreign filesystems (e.g., FAT, NTFS, ISO 9660)
  • 28. ext# filesystems – For ext2/ext3/ext4, mke2fs is used, which creates ● A set of inode storage cells – each holds info about one file ● A set of scattered “superblocks” – holds global filesystem info (multiple copies for reliability) – size and location of inode tables, block map and usage, etc. ● A map of the disk blocks in the filesystem (used and free) ● The set of data blocks
  • 29. Mounting a filesystem – Filesystem must be mounted before use ● Must be made part of root filesystem – Can be mounted on (top of) any directory # mount /dev/sda1 /usr/local # df /usr/local – Use /mnt for temporary mounts – Want to set up automatic mounting
  • 30. 4.1. printers ● Printing and print services – Printing policies and architecture – Printing terms – Types of printers – Adding a printer – Common printing software
  • 31. Where should printers be located? – Some want a printer on their own desk ● Very convenient but expensive – Some want to be able to print to any printer, no matter where it is ● Flexible, able to borrow specialty printers as needed – Finance people want to centralize everything ● A single high-speed printer, single high-quality printer, and one color printer per building (most cost-effective) – Others want to charge every expense ● Regardless of how much is out there, those who use it, pay for it
  • 32. Real world ● People need to be able to print to any printer they have permission to use ● Centralized printing services can save money – Ten people who might otherwise buy slow, lowquality personal printers ● The sysadmin only has to support one printer driver/printer rather than 10
  • 33. Print architecture ● How centralized will printing be? – How many people will share a printer for general printing? – Who qualifies for a personal printer? – How will they be networked? ● Network printers can benefit from a central print-spool – How will they be maintained?
  • 34. Printing terms ● spooler – Daemon that receives print jobs, stores, prioritizes, and sends them sequentially to be printed ● PDL – Page Description Language, usually device and resolution independent – PostScript, PCL, PDF ● bitmap – JPEG, TIFF, GIF, PNG ● RIP – Raster image processor – Accepts PDL input, generates bitmap appropriate for a particular device ● filters – Modify print jobs on their way to a printer ● PostScript – Most common PDL – also a full programming language
  • 35. Types of printers – Classified by connection interface ● Serial and parallel printers – USB faster and the default today for personal printers ● Network printers – Contain network interfaces (e.g., ethernet or wifi) – Accept jobs via one or more printing protocols ● including via, IPP, HP JetDirect
  • 36. CUPS – Common UNIX Printing System ● Latest rewrite of the printing system – Also supports secure printing (SSL, etc.) – Implements IPP: Internet Printing Protocol (HTTPbased) – Supports load-balancing across a class of printers – Supports automatic network configuration – Standard in most Linux distributions http://www.cups.org/
  • 37. Network and system monitoring tools • The tools that monitor the infrastructure should be designed to add the least performance impact on the system that is being monitored. In other words, these tools need to be as unobtrusive as possible to avoid any added burden on the production services. • Monitoring tools can be categorized as: Command Line Tools Desktop Monitoring Tools Infrastructure Monitoring Tools Log Monitoring Tools Network Monitoring Tools
  • 38. Considerations of Selecting Network monitoring Tools • When looking for a system monitoring software package there are many things to consider. Apart from the basic monitoring functionalities such as processes and system performance, it is essential that the tool allows the following features Customizable alerts and notifications.  Auto-discovery of systems. Easy graphical user interface. Automatic update measurements. Easy Installation and operation.
  • 39. Project on Network and system monitoring tools • Introduction about the tool • Applications (usage) of tool • Installation steps • Additional tools or plugins that can enhance performance of the tool • Configuring network parameters • Special features of the tool • Steps to run the tool features (Note: support the steps with example) • Conclusion
  • 40. Tools 1. Nagios 2. Gnome system monitor 3. Cacti 4. KDE system Guard 5. Solarwinds SAM (Server & Application Monitor) 6. PRTG by Paessler 7. OPManager by ManageEngine 8. WhatsUp Gold 9. Zabbix 10. Spiceworks 11. Sarg (Squid Analysis Report Generator) 12. GoAccess
  • 41. Next chapter 5: Data center security