SlideShare una empresa de Scribd logo
1 de 131
Descargar para leer sin conexión
Unix::Statgrab - System Monitoring
Jens Rehsack
2013
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 1 / 28
Overview
Part I
Introduction
1 Introduction
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 2 / 28
Introduction
Audience
Audience
Developer who wants to create or improve monitoring software
Developer who wants to evaluate system stats for content sensitive code
paths
Developer who wants to to learn the difference to earlier libstatgrab /
Unix::Statgrab API
Developers or Operators (Admins) who wants to learn about measurement of
statistic values of the machine
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 3 / 28
Introduction
Audience
Audience
Developer who wants to create or improve monitoring software
Developer who wants to evaluate system stats for content sensitive code
paths
Developer who wants to to learn the difference to earlier libstatgrab /
Unix::Statgrab API
Developers or Operators (Admins) who wants to learn about measurement of
statistic values of the machine
Prerequisites of the Audience
Following knowledge is expected:
advanced skills in at least one object oriented and procedural programming
language
more than one year practical experience in object oriented development
Experience with Unix or compatible operating systems
slightly above basic Perl experience
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 3 / 28
Introduction
Motivation
XS / C
use of native API to get OS stats
performance advantage
interoperability (most VM’s have a * native interface)
portability - widest calling convention support in C
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 4 / 28
Introduction
Platforms I
Tested and confirmed running
DragonFly BSD 3.4
FreeBSD 7,8 (i386, amd64), FreeBSD 9 (i386, amd64, sparc64, ia64),
FreeBSD 10-CURRENT (i386, amd64, sparc64, ia64)
HP-UX 11.11 (parisc) HP-UX 11.23 (parisc, ia64), HP-UX 11.31 (ia64)
Linux 2.6 (Ubuntu 10.04, SLES 9-11, Redhat 6, CentOS 6, µCLinux/arm7),
Linux 3.X (Ubuntu 12.04)
MacOS X 10.6, 10.8 (amd64)
NetBSD 5.1-6.1 (amd64), NetBSD-CURRENT (amd64)
OpenBSD 4.9, 5.3 (amd64)
Solaris 8,9 (sparc), Solaris 10 (sparc, x86 & amd64), Solaris 11 (amd64)
AIX 5.2, 5.3, 6.1 (ppc64)
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 5 / 28
Introduction
Platforms II
in progress . . .
Windows (using Interix, maybe mSys)
kFreeBSD
Hurd
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 6 / 28
Introduction
Platforms II
in progress . . .
Windows (using Interix, maybe mSys)
kFreeBSD
Hurd
Wishlist
Digital Unix / Tru64 / OSF1
Haiku
VMS
zOS
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 6 / 28
Overview
Part II
libstatgrab
2 Host Information
3 CPU statistics
4 Memory statistics
5 Disk / Storage statistics
6 User statistics
7 Process statistics
8 Network statistics
9 Error management
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 7 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
hostname name of the host.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
hostname name of the host.
bitwidth (usually 32 or 64),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
hostname name of the host.
bitwidth (usually 32 or 64),
host state - one of sg physical host,
sg virtual machine, sg paravirtual machine,
sg hardware virtualized or
sg unknown configuration),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
hostname name of the host.
bitwidth (usually 32 or 64),
host state - one of sg physical host,
sg virtual machine, sg paravirtual machine,
sg hardware virtualized or
sg unknown configuration),
current number of CPU’s,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
hostname name of the host.
bitwidth (usually 32 or 64),
host state - one of sg physical host,
sg virtual machine, sg paravirtual machine,
sg hardware virtualized or
sg unknown configuration),
current number of CPU’s,
maximum number of CPU’s.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
Host Information
Host Info
sg host info
typedef struct {
char *os_name;
char * os_release ;
char * os_version ;
char *platform;
char *hostname;
unsigned bitwidth ;
sg_host_state host_state ;
unsigned ncpus;
unsigned maxcpus;
time_t uptime;
time_t systime;
} sg_host_info ;
bundles some operating system information as
name (Linux, FreeBSD, AIX),
release (eg. kernel version),
entire OS version string (eg. Darwin Kernel
Version 12.4.0: Wed May 1 17:57:12 PDT 2013;
root:xnu-2050.24.15 1/RELEASE X86 64),
platform, what finally means CPU information
from OS perspective,
hostname name of the host.
bitwidth (usually 32 or 64),
host state - one of sg physical host,
sg virtual machine, sg paravirtual machine,
sg hardware virtualized or
sg unknown configuration),
current number of CPU’s,
maximum number of CPU’s.
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
CPU statistics
CPU stats
sg cpu stats
typedef struct {
unsigned long long user , kernel , idle , iowait , swap , nice , total;
unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches ,
syscalls , interrupts , soft_interrupts ,
time_t systime ;
} sg_cpu_stats ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
CPU statistics
CPU stats
sg cpu stats
typedef struct {
unsigned long long user , kernel , idle , iowait , swap , nice , total;
unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches ,
syscalls , interrupts , soft_interrupts ,
time_t systime ;
} sg_cpu_stats ;
absolute ticks of measurable CPU states,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
CPU statistics
CPU stats
sg cpu stats
typedef struct {
unsigned long long user , kernel , idle , iowait , swap , nice , total;
unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches ,
syscalls , interrupts , soft_interrupts ,
time_t systime ;
} sg_cpu_stats ;
absolute ticks of measurable CPU states,
context switches over all CPU’s, also separated by voluntary and involuntary,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
CPU statistics
CPU stats
sg cpu stats
typedef struct {
unsigned long long user , kernel , idle , iowait , swap , nice , total;
unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches ,
syscalls , interrupts , soft_interrupts ,
time_t systime ;
} sg_cpu_stats ;
absolute ticks of measurable CPU states,
context switches over all CPU’s, also separated by voluntary and involuntary,
syscalls made, interrupts and soft-interrupts occured,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
CPU statistics
CPU stats
sg cpu stats
typedef struct {
unsigned long long user , kernel , idle , iowait , swap , nice , total;
unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches ,
syscalls , interrupts , soft_interrupts ,
time_t systime ;
} sg_cpu_stats ;
absolute ticks of measurable CPU states,
context switches over all CPU’s, also separated by voluntary and involuntary,
syscalls made, interrupts and soft-interrupts occured,
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states:
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode, kernel mode,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o,
during page swap,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o,
during page swap, nice rescheduled
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
CPU percents
sg cpu percents
typedef struct {
double user;
double kernel;
double idle;
double iowait;
double swap;
double nice;
time_t time_taken ;
} sg_cpu_percents ;
relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o,
during page swap, nice rescheduled
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
CPU statistics
Load percents
sg load stats
typedef struct {
double min1;
double min5;
double min15;
time_t systime;
} sg_load_stats;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
CPU statistics
Load percents
sg load stats
typedef struct {
double min1;
double min5;
double min15;
time_t systime;
} sg_load_stats;
percentage of cpu usage per
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
CPU statistics
Load percents
sg load stats
typedef struct {
double min1;
double min5;
double min15;
time_t systime;
} sg_load_stats;
percentage of cpu usage per 1 minute,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
CPU statistics
Load percents
sg load stats
typedef struct {
double min1;
double min5;
double min15;
time_t systime;
} sg_load_stats;
percentage of cpu usage per 1 minute, 5 minutes and
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
CPU statistics
Load percents
sg load stats
typedef struct {
double min1;
double min5;
double min15;
time_t systime;
} sg_load_stats;
percentage of cpu usage per 1 minute, 5 minutes and 15 minutes.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
CPU statistics
Load percents
sg load stats
typedef struct {
double min1;
double min5;
double min15;
time_t systime;
} sg_load_stats;
percentage of cpu usage per 1 minute, 5 minutes and 15 minutes.
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
information about main memory of the system:
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
information about main memory of the system: total,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
information about main memory of the system: total, free,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
information about main memory of the system: total, free, used,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
information about main memory of the system: total, free, used, cache,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Memory stats
sg mem stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
unsigned long long cache;
time_t systime;
} sg_mem_stats ;
information about main memory of the system: total, free, used, cache,
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
Memory statistics
Swap stats
sg swap stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
time_t systime;
} sg_swap_stats;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
Memory statistics
Swap stats
sg swap stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
time_t systime;
} sg_swap_stats;
information about swap memory of the system:
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
Memory statistics
Swap stats
sg swap stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
time_t systime;
} sg_swap_stats;
information about swap memory of the system: total,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
Memory statistics
Swap stats
sg swap stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
time_t systime;
} sg_swap_stats;
information about swap memory of the system: total, free,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
Memory statistics
Swap stats
sg swap stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
time_t systime;
} sg_swap_stats;
information about swap memory of the system: total, free, used,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
Memory statistics
Swap stats
sg swap stats
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
time_t systime;
} sg_swap_stats;
information about swap memory of the system: total, free, used,
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
Disk / Storage statistics
Disk I/O stats
sg disk io stats
typedef struct {
char *disk_name;
unsigned long long read_bytes ;
unsigned long long write_bytes;
time_t systime;
} sg_disk_io_stats ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
Disk / Storage statistics
Disk I/O stats
sg disk io stats
typedef struct {
char *disk_name;
unsigned long long read_bytes ;
unsigned long long write_bytes;
time_t systime;
} sg_disk_io_stats ;
for each block device known to the system
name of the block device,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
Disk / Storage statistics
Disk I/O stats
sg disk io stats
typedef struct {
char *disk_name;
unsigned long long read_bytes ;
unsigned long long write_bytes;
time_t systime;
} sg_disk_io_stats ;
for each block device known to the system
name of the block device,
amount of bytes read
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
Disk / Storage statistics
Disk I/O stats
sg disk io stats
typedef struct {
char *disk_name;
unsigned long long read_bytes ;
unsigned long long write_bytes;
time_t systime;
} sg_disk_io_stats ;
for each block device known to the system
name of the block device,
amount of bytes read
amount of bytes written
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
Disk / Storage statistics
Disk I/O stats
sg disk io stats
typedef struct {
char *disk_name;
unsigned long long read_bytes ;
unsigned long long write_bytes;
time_t systime;
} sg_disk_io_stats ;
for each block device known to the system
name of the block device,
amount of bytes read
amount of bytes written
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
Disk / Storage statistics
Paging stats
sg page stats
typedef struct {
unsigned long long pages_pagein ;
unsigned long long pages_pageout;
time_t systime;
} sg_page_stats;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
Disk / Storage statistics
Paging stats
sg page stats
typedef struct {
unsigned long long pages_pagein ;
unsigned long long pages_pageout;
time_t systime;
} sg_page_stats;
for entire system
amount of bytes paged in,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
Disk / Storage statistics
Paging stats
sg page stats
typedef struct {
unsigned long long pages_pagein ;
unsigned long long pages_pageout;
time_t systime;
} sg_page_stats;
for entire system
amount of bytes paged in,
amount of bytes paged out
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
Disk / Storage statistics
Paging stats
sg page stats
typedef struct {
unsigned long long pages_pagein ;
unsigned long long pages_pageout;
time_t systime;
} sg_page_stats;
for entire system
amount of bytes paged in,
amount of bytes paged out
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
also separated into used, free and avail
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
also separated into used, free and avail
optimal size of the I/O blocks when accessing
the file system in bytes
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
also separated into used, free and avail
optimal size of the I/O blocks when accessing
the file system in bytes
block size (minimum allocation size) of the file
system in bytes
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
also separated into used, free and avail
optimal size of the I/O blocks when accessing
the file system in bytes
block size (minimum allocation size) of the file
system in bytes
amount of blocks of the file system
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
also separated into used, free and avail
optimal size of the I/O blocks when accessing
the file system in bytes
block size (minimum allocation size) of the file
system in bytes
amount of blocks of the file system
also separated into used, free and avail
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
Disk / Storage statistics
Filesystem stats
sg fs stats
typedef struct {
char * device_name;
char *fs_type;
char *mnt_point;
sg_fs_device_type device_type;
unsigned long long size;
unsigned long long used;
unsigned long long free;
unsigned long long avail;
unsigned long long total_inodes ;
unsigned long long used_inodes;
unsigned long long free_inodes;
unsigned long long avail_inodes ;
unsigned long long io_size ;
unsigned long long block_size ;
unsigned long long total_blocks ;
unsigned long long free_blocks;
unsigned long long used_blocks;
unsigned long long avail_blocks ;
time_t systime;
} sg_fs_stats;
for each mounted (and not filtered) file system
name of the mounted block device,
name of the file system type (eg. ext3, ffs, zfs)
full qualified path name of the mount point
device type: one of sg fs unknown,
sg fs regular, sg fs special,
sg fs loopback, sg fs remote or any
combination
Anything but unknown is covered by
sg fs alltypes, any local type by sg fs local
size of the file system in bytes
also separated into used, free and avail
inodes of the file system
also separated into used, free and avail
optimal size of the I/O blocks when accessing
the file system in bytes
block size (minimum allocation size) of the file
system in bytes
amount of blocks of the file system
also separated into used, free and avail
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
record id and size of that field (not ’0’ terminated),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
record id and size of that field (not ’0’ terminated),
device where user logged in,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
record id and size of that field (not ’0’ terminated),
device where user logged in,
hostname when remote login
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
record id and size of that field (not ’0’ terminated),
device where user logged in,
hostname when remote login
process id of the session’s ”root” process
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
record id and size of that field (not ’0’ terminated),
device where user logged in,
hostname when remote login
process id of the session’s ”root” process
login time of that session
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
User statistics
User stats
sg user stats
typedef struct {
char * login_name ;
char *record_id;
size_t record_id_size;
char *device;
char *hostname;
pid_t pid;
time_t login_time ;
time_t systime;
} sg_user_stats;
statistics about logged in users, as
login name,
record id and size of that field (not ’0’ terminated),
device where user logged in,
hostname when remote login
process id of the session’s ”root” process
login time of that session
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id,
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
context switches done by the process, also
separated by voluntary and involuntary
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
context switches done by the process, also
separated by voluntary and involuntary
virtual memory size of the process, thereof
resident
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
context switches done by the process, also
separated by voluntary and involuntary
virtual memory size of the process, thereof
resident
start time of the process, time spent on CPU
during lifetime, relative to system usage
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
context switches done by the process, also
separated by voluntary and involuntary
virtual memory size of the process, thereof
resident
start time of the process, time spent on CPU
during lifetime, relative to system usage
nice value of the process (process scheduling
increment)
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
context switches done by the process, also
separated by voluntary and involuntary
virtual memory size of the process, thereof
resident
start time of the process, time spent on CPU
during lifetime, relative to system usage
nice value of the process (process scheduling
increment)
device type: one of SG PROCESS STATE RUNNING,
SG PROCESS STATE SLEEPING,
SG PROCESS STATE STOPPED,
SG PROCESS STATE ZOMBIE or
SG PROCESS STATE UNKNOWN
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Process statistics
Process stats
sg process stats
typedef struct {
char * process_name ;
char *proctitle;
pid_t pid;
pid_t parent;
pid_t pgid;
pid_t sessid;
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
unsigned long long context_switches ;
unsigned long long voluntary_context_switches;
unsigned long long involuntary_context_switches;
unsigned long long proc_size;
unsigned long long proc_resident;
time_t start_time ;
time_t time_spent ;
double cpu_percent;
int nice;
sg_process_state state;
time_t systime;
} sg_process_stats ;
for each existing process
name of the process image,
title of the process (usually FQPN + args)
process id of the process, the parent process, the
process group leader and the session id of the
session the process belongs to
process’ user id, group id, effective user id and
effective group id
context switches done by the process, also
separated by voluntary and involuntary
virtual memory size of the process, thereof
resident
start time of the process, time spent on CPU
during lifetime, relative to system usage
nice value of the process (process scheduling
increment)
device type: one of SG PROCESS STATE RUNNING,
SG PROCESS STATE SLEEPING,
SG PROCESS STATE STOPPED,
SG PROCESS STATE ZOMBIE or
SG PROCESS STATE UNKNOWN
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
bytes transmitted and received
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
bytes transmitted and received
packets transmitted and received
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
bytes transmitted and received
packets transmitted and received
errors transmitting and receiving packets
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
bytes transmitted and received
packets transmitted and received
errors transmitting and receiving packets
detected collisions
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network I/O stats
sg network io stats
typedef struct {
char * interface_name;
unsigned long long tx;
unsigned long long rx;
unsigned long long ipackets ;
unsigned long long opackets;
unsigned long long ierrors ;
unsigned long long oerrors ;
unsigned long long collisions ;
time_t systime;
} sg_network_io_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
bytes transmitted and received
packets transmitted and received
errors transmitting and receiving packets
detected collisions
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
Network statistics
Network Interface stats
sg network iface stats
typedef struct {
char * interface_name;
unsigned long long speed;
unsigned long long factor;
sg_iface_duplex duplex;
sg_iface_updown up;
time_t systime;
} sg_network_iface_stats ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
Network statistics
Network Interface stats
sg network iface stats
typedef struct {
char * interface_name;
unsigned long long speed;
unsigned long long factor;
sg_iface_duplex duplex;
sg_iface_updown up;
time_t systime;
} sg_network_iface_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
Network statistics
Network Interface stats
sg network iface stats
typedef struct {
char * interface_name;
unsigned long long speed;
unsigned long long factor;
sg_iface_duplex duplex;
sg_iface_updown up;
time_t systime;
} sg_network_iface_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
capable to transfer times of sized units per second
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
Network statistics
Network Interface stats
sg network iface stats
typedef struct {
char * interface_name;
unsigned long long speed;
unsigned long long factor;
sg_iface_duplex duplex;
sg_iface_updown up;
time_t systime;
} sg_network_iface_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
capable to transfer times of sized units per second
capable to transmit and receive simultanously (SG IFACE DUPLEX FULL, SG IFACE DUPLEX HALF or
SG IFACE DUPLEX UNKNOWN)
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
Network statistics
Network Interface stats
sg network iface stats
typedef struct {
char * interface_name;
unsigned long long speed;
unsigned long long factor;
sg_iface_duplex duplex;
sg_iface_updown up;
time_t systime;
} sg_network_iface_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
capable to transfer times of sized units per second
capable to transmit and receive simultanously (SG IFACE DUPLEX FULL, SG IFACE DUPLEX HALF or
SG IFACE DUPLEX UNKNOWN)
NIC is SG IFACE UP or SG IFACE DOWN
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
Network statistics
Network Interface stats
sg network iface stats
typedef struct {
char * interface_name;
unsigned long long speed;
unsigned long long factor;
sg_iface_duplex duplex;
sg_iface_updown up;
time_t systime;
} sg_network_iface_stats ;
for each network interface
interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ),
capable to transfer times of sized units per second
capable to transmit and receive simultanously (SG IFACE DUPLEX FULL, SG IFACE DUPLEX HALF or
SG IFACE DUPLEX UNKNOWN)
NIC is SG IFACE UP or SG IFACE DOWN
timestamp when collected this stats.
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
Error management
Error information
sg error details
typedef struct sg_error_details {
sg_error error;
int errno_value;
const char *error_arg;
} sg_error_details ;
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
Error management
Error information
sg error details
typedef struct sg_error_details {
sg_error error;
int errno_value;
const char *error_arg;
} sg_error_details ;
when an error occured (no stats are resulted upon querying):
libstatgrab error code (eg. SG ERROR INVALID ARGUMENT)
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
Error management
Error information
sg error details
typedef struct sg_error_details {
sg_error error;
int errno_value;
const char *error_arg;
} sg_error_details ;
when an error occured (no stats are resulted upon querying):
libstatgrab error code (eg. SG ERROR INVALID ARGUMENT)
system (errno.h) error code (eg. EBUSY
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
Error management
Error information
sg error details
typedef struct sg_error_details {
sg_error error;
int errno_value;
const char *error_arg;
} sg_error_details ;
when an error occured (no stats are resulted upon querying):
libstatgrab error code (eg. SG ERROR INVALID ARGUMENT)
system (errno.h) error code (eg. EBUSY
optional error explanation message (eg. file name, process id, . . . )
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
Overview
Part III
Unix::Statgrab
10 Entry Functions
11 SYNOPSIS
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 22 / 28
Entry Functions
Entry Functions
get_error (); # return details about last error
get_host_info (); # returns sg_host_info
get_cpu_stats (); # returns sg_cpu_stats
get_disk_io_stats (); # returns sg_disk_io_stats
get_fs_stats (); # returns sg_fs_stats
get_load_stats (); # returns sg_load_stats
get_mem_stats (); # returns sg_mem_stats
get_swap_stats (); # returns sg_swap_stats
get_network_io_stats (); # returns sg_network_io_stats
get_network_iface_stats (); # returns sg_network_iface_stats
get_page_stats (); # returns sg_page_stats
get_user_stats (); # returns sg_user_stats
get_process_stats (); # returns sg_process_stats
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 23 / 28
SYNOPSIS
Common . . .
Common . . .
use Unix :: Statgrab ;
my $host_info = get_host_info () or croak( get_error ()-> strperror () );
printf( "%dn", $host_info ->entries () );
my $cpu_stats = get_cpu_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $cpu_stats ->entries () );
my $disk_io_stats = get_disk_io_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $disk_io_stats ->entries () );
my $fs_stats = get_fs_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $fs_stats ->entries () );
my $load_stats = get_load_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $load_stats ->entries () );
my $mem_stats = get_mem_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $mem_stats ->entries () );
my $swap_stats = get_swap_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $swap_stats ->entries () );
my $net_io_stats = get_network_io_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $net_io_stats ->entries () );
my $net_iface_stats = get_network_iface_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $net_iface_stats ->entries () );
my $paging_stats = get_page_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $paging ->entries () );
my $user_stats = get_user_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $user_stats ->entries () );
my $proc_stats = get_process_stats () or croak( get_error ()-> strperror () );
printf( "%dn", $proc_stats ->entries () );
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 24 / 28
SYNOPSIS
SYNOPSIS
SYNOPSIS
use Unix :: Statgrab ;
my $host_stats = get_host_info ();
print $host_stats ->hostname . " is a " . $host_stats ->bitwidth . " " . $host_stats ->os_name . "n";
my $filesystems = get_fs_stats ();
my @mount_points = map { $filesystems ->mnt_point($_) } (0 .. $filesystems ->entries () - 1);
print $host_stats ->hostname . " has " . join( ", ", @mount_points ) . " mounted n";
my $proc_list = get_process_stats ();
my @proc_by_type;
foreach my $proc_entry (0 .. $proc_list ->entries () - 1) {
$proc_by_type[$proc_list ->state( $proc_entry )]++;
}
my $total_procs = 0;
$total_procs += $_ for grep { defined $_ } @proc_by_type;
foreach my $state (qw( SG_PROCESS_STATE_RUNNING SG_PROCESS_STATE_SLEEPING
SG_PROCESS_STATE_STOPPED SG_PROCESS_STATE_ZOMBIE
SG_PROCESS_STATE_UNKNOWN )) {
defined $proc_by_type[Unix :: Statgrab ->$state] or next;
print $proc_by_type[Unix :: Statgrab ->$state ] . " of " . $total_procs . " procs in $staten";
}
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 25 / 28
SYNOPSIS
SYNOPSIS II
SYNOPSIS diff / percent
use Unix :: Statgrab ;
my $last_cpu_stats = get_cpu_stats () or croak( get_error ()-> strperror () );
do_sth_way_longer ();
my $cpu_diff = get_cpu_stats ()-> get_cpu_stats_diff( $last_cpu_stats );
my $last_cpu_percent = $last_cpu_percent -> get_cpu_percents ();
my $diff_cpu_percent = $cpu_diff -> get_cpu_percents ();
my $now_cpu_percent = get_cpu_stats ()-> get_cpu_percents ();
my $last_disk_io_stats = get_disk_io_stats () or croak( get_error ()-> strperror () );
do_sth_way_longer ();
my $disk_io_diff = get_disk_io_stats()-> get_disk_io_stats_diff ( $last_disk_io_stats );
my $last_fs_stats = get_fs_stats () or croak( get_error ()-> strperror () );
do_sth_way_longer ();
my $fs_diff = get_fs_stats ()-> get_fs_stats_diff( $last_fs_stats );
my $last_net_io_stats = get_network_io_stats () or croak( get_error ()-> strperror () );
do_sth_way_longer ();
my $net_io_diff = get_network_io_stats ()-> get_network_io_stats_diff( $last_net_io_stats );
my $last_paging_stats = get_page_stats () or croak( get_error ()-> strperror () );
do_sth_way_longer ();
my $paging_diff = get_page_stats ()-> get_page_stats_diff ( $last_paging_stats );
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 26 / 28
SYNOPSIS
Resources
Software
http://www.i-scream.org/libstatgrab/
http://search.cpan.org/dist/Unix-Statgrab/
https://metacpan.org/module/Unix::Statgrab
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 27 / 28
SYNOPSIS
Resources
Software
http://www.i-scream.org/libstatgrab/
http://search.cpan.org/dist/Unix-Statgrab/
https://metacpan.org/module/Unix::Statgrab
Mailing List
https://lists.i-scream.org/pipermail/users/
users@i-scream.org
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 27 / 28
SYNOPSIS
Resources
Software
http://www.i-scream.org/libstatgrab/
http://search.cpan.org/dist/Unix-Statgrab/
https://metacpan.org/module/Unix::Statgrab
Mailing List
https://lists.i-scream.org/pipermail/users/
users@i-scream.org
IRC
irc://irc.freenode.net/#libstatgrab
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 27 / 28
SYNOPSIS
Thank You
Thank you
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
SYNOPSIS
Thank You
Thank you
Tim Bishop for caring for high quality release
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
SYNOPSIS
Thank You
Thank you
Tim Bishop for caring for high quality release
H. Merijn Brand for doing additional tests on more exotic platforms
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
SYNOPSIS
Thank You
Thank you
Tim Bishop for caring for high quality release
H. Merijn Brand for doing additional tests on more exotic platforms
Reini Urban for proving on commodity hardware for being sane
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
SYNOPSIS
Thank You
Thank you
Tim Bishop for caring for high quality release
H. Merijn Brand for doing additional tests on more exotic platforms
Reini Urban for proving on commodity hardware for being sane
Questions?
Jens Rehsack <rehsack@cpan.org>
Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28

Más contenido relacionado

La actualidad más candente

OpenWrt From Top to Bottom
OpenWrt From Top to BottomOpenWrt From Top to Bottom
OpenWrt From Top to BottomKernel TLV
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelDivye Kapoor
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and DriversKernel TLV
 
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkLecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkMohammed Farrag
 
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with VolatlityOMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with VolatlityAndrew Case
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemdYusaku OGAWA
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack monad bobo
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitlinuxlab_conf
 
ARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/SpectreARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/SpectreGlobalLogic Ukraine
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux Kuldeep Tiwari
 
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)PROIDEA
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0GlobalLogic Ukraine
 
Terminals and Shells
Terminals and ShellsTerminals and Shells
Terminals and ShellsHoffman Lab
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practicalMoabi.com
 
Sistemas operacionais 8
Sistemas operacionais 8Sistemas operacionais 8
Sistemas operacionais 8Nauber Gois
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slidesMoabi.com
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Kernel TLV
 

La actualidad más candente (20)

OpenWrt From Top to Bottom
OpenWrt From Top to BottomOpenWrt From Top to Bottom
OpenWrt From Top to Bottom
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
Lecture1 Introduction
Lecture1  IntroductionLecture1  Introduction
Lecture1 Introduction
 
[ArabBSD] Unix Basics
[ArabBSD] Unix Basics[ArabBSD] Unix Basics
[ArabBSD] Unix Basics
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkLecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
 
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with VolatlityOMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemd
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
ARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/SpectreARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/Spectre
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux
 
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0
 
Terminals and Shells
Terminals and ShellsTerminals and Shells
Terminals and Shells
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
 
Sistemas operacionais 8
Sistemas operacionais 8Sistemas operacionais 8
Sistemas operacionais 8
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
 

Similar a Unix::Statgrab

X64 Workshop Linux Information Gathering
X64 Workshop Linux Information GatheringX64 Workshop Linux Information Gathering
X64 Workshop Linux Information GatheringAero Plane
 
lxc-namespace.pdf
lxc-namespace.pdflxc-namespace.pdf
lxc-namespace.pdf-
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubDevang Garach
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDPlcplcp1
 
2008-11-13 CAVMEN RHEL for System z Deep Dive
2008-11-13 CAVMEN RHEL for System z Deep Dive2008-11-13 CAVMEN RHEL for System z Deep Dive
2008-11-13 CAVMEN RHEL for System z Deep DiveShawn Wells
 
Volatile memory analysis
Volatile memory analysisVolatile memory analysis
Volatile memory analysisHimanshu0734
 
Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)Peter Tröger
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linuxrowiebornia
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptxDavidMaina47
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiicmdept1
 
Open Source Tools for the Systems Administrator
Open Source Tools for the Systems AdministratorOpen Source Tools for the Systems Administrator
Open Source Tools for the Systems AdministratorCharles Profitt
 

Similar a Unix::Statgrab (20)

Rhce ppt
Rhce pptRhce ppt
Rhce ppt
 
Genode Compositions
Genode CompositionsGenode Compositions
Genode Compositions
 
Linuxnetworkingcommands
LinuxnetworkingcommandsLinuxnetworkingcommands
Linuxnetworkingcommands
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
unix-rosetta
unix-rosettaunix-rosetta
unix-rosetta
 
X64 Workshop Linux Information Gathering
X64 Workshop Linux Information GatheringX64 Workshop Linux Information Gathering
X64 Workshop Linux Information Gathering
 
lxc-namespace.pdf
lxc-namespace.pdflxc-namespace.pdf
lxc-namespace.pdf
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
 
Driver_linux
Driver_linuxDriver_linux
Driver_linux
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
2008-11-13 CAVMEN RHEL for System z Deep Dive
2008-11-13 CAVMEN RHEL for System z Deep Dive2008-11-13 CAVMEN RHEL for System z Deep Dive
2008-11-13 CAVMEN RHEL for System z Deep Dive
 
Volatile memory analysis
Volatile memory analysisVolatile memory analysis
Volatile memory analysis
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkii
 
Open Source Tools for the Systems Administrator
Open Source Tools for the Systems AdministratorOpen Source Tools for the Systems Administrator
Open Source Tools for the Systems Administrator
 

Más de Jens Rehsack

Perl6 for-beginners
Perl6 for-beginnersPerl6 for-beginners
Perl6 for-beginnersJens Rehsack
 
Moo at System::Image::Update
Moo at System::Image::UpdateMoo at System::Image::Update
Moo at System::Image::UpdateJens Rehsack
 
A CMDB Driven by Perl
A CMDB Driven by PerlA CMDB Driven by Perl
A CMDB Driven by PerlJens Rehsack
 
PkgSrc in Five Minutes
PkgSrc in Five MinutesPkgSrc in Five Minutes
PkgSrc in Five MinutesJens Rehsack
 
Moo at App::Math::Trainer
Moo at App::Math::TrainerMoo at App::Math::Trainer
Moo at App::Math::TrainerJens Rehsack
 
Cross Compiling for Perl Hackers
Cross Compiling for Perl HackersCross Compiling for Perl Hackers
Cross Compiling for Perl HackersJens Rehsack
 
Perl on-embedded-devices
Perl on-embedded-devicesPerl on-embedded-devices
Perl on-embedded-devicesJens Rehsack
 

Más de Jens Rehsack (7)

Perl6 for-beginners
Perl6 for-beginnersPerl6 for-beginners
Perl6 for-beginners
 
Moo at System::Image::Update
Moo at System::Image::UpdateMoo at System::Image::Update
Moo at System::Image::Update
 
A CMDB Driven by Perl
A CMDB Driven by PerlA CMDB Driven by Perl
A CMDB Driven by Perl
 
PkgSrc in Five Minutes
PkgSrc in Five MinutesPkgSrc in Five Minutes
PkgSrc in Five Minutes
 
Moo at App::Math::Trainer
Moo at App::Math::TrainerMoo at App::Math::Trainer
Moo at App::Math::Trainer
 
Cross Compiling for Perl Hackers
Cross Compiling for Perl HackersCross Compiling for Perl Hackers
Cross Compiling for Perl Hackers
 
Perl on-embedded-devices
Perl on-embedded-devicesPerl on-embedded-devices
Perl on-embedded-devices
 

Último

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 

Último (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 

Unix::Statgrab

  • 1. Unix::Statgrab - System Monitoring Jens Rehsack 2013 Jens Rehsack () Unix::Statgrab - System Monitoring 2013 1 / 28
  • 2. Overview Part I Introduction 1 Introduction Jens Rehsack () Unix::Statgrab - System Monitoring 2013 2 / 28
  • 3. Introduction Audience Audience Developer who wants to create or improve monitoring software Developer who wants to evaluate system stats for content sensitive code paths Developer who wants to to learn the difference to earlier libstatgrab / Unix::Statgrab API Developers or Operators (Admins) who wants to learn about measurement of statistic values of the machine Jens Rehsack () Unix::Statgrab - System Monitoring 2013 3 / 28
  • 4. Introduction Audience Audience Developer who wants to create or improve monitoring software Developer who wants to evaluate system stats for content sensitive code paths Developer who wants to to learn the difference to earlier libstatgrab / Unix::Statgrab API Developers or Operators (Admins) who wants to learn about measurement of statistic values of the machine Prerequisites of the Audience Following knowledge is expected: advanced skills in at least one object oriented and procedural programming language more than one year practical experience in object oriented development Experience with Unix or compatible operating systems slightly above basic Perl experience Jens Rehsack () Unix::Statgrab - System Monitoring 2013 3 / 28
  • 5. Introduction Motivation XS / C use of native API to get OS stats performance advantage interoperability (most VM’s have a * native interface) portability - widest calling convention support in C Jens Rehsack () Unix::Statgrab - System Monitoring 2013 4 / 28
  • 6. Introduction Platforms I Tested and confirmed running DragonFly BSD 3.4 FreeBSD 7,8 (i386, amd64), FreeBSD 9 (i386, amd64, sparc64, ia64), FreeBSD 10-CURRENT (i386, amd64, sparc64, ia64) HP-UX 11.11 (parisc) HP-UX 11.23 (parisc, ia64), HP-UX 11.31 (ia64) Linux 2.6 (Ubuntu 10.04, SLES 9-11, Redhat 6, CentOS 6, µCLinux/arm7), Linux 3.X (Ubuntu 12.04) MacOS X 10.6, 10.8 (amd64) NetBSD 5.1-6.1 (amd64), NetBSD-CURRENT (amd64) OpenBSD 4.9, 5.3 (amd64) Solaris 8,9 (sparc), Solaris 10 (sparc, x86 & amd64), Solaris 11 (amd64) AIX 5.2, 5.3, 6.1 (ppc64) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 5 / 28
  • 7. Introduction Platforms II in progress . . . Windows (using Interix, maybe mSys) kFreeBSD Hurd Jens Rehsack () Unix::Statgrab - System Monitoring 2013 6 / 28
  • 8. Introduction Platforms II in progress . . . Windows (using Interix, maybe mSys) kFreeBSD Hurd Wishlist Digital Unix / Tru64 / OSF1 Haiku VMS zOS Jens Rehsack () Unix::Statgrab - System Monitoring 2013 6 / 28
  • 9. Overview Part II libstatgrab 2 Host Information 3 CPU statistics 4 Memory statistics 5 Disk / Storage statistics 6 User statistics 7 Process statistics 8 Network statistics 9 Error management Jens Rehsack () Unix::Statgrab - System Monitoring 2013 7 / 28
  • 10. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 11. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 12. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 13. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 14. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 15. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, hostname name of the host. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 16. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, hostname name of the host. bitwidth (usually 32 or 64), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 17. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, hostname name of the host. bitwidth (usually 32 or 64), host state - one of sg physical host, sg virtual machine, sg paravirtual machine, sg hardware virtualized or sg unknown configuration), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 18. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, hostname name of the host. bitwidth (usually 32 or 64), host state - one of sg physical host, sg virtual machine, sg paravirtual machine, sg hardware virtualized or sg unknown configuration), current number of CPU’s, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 19. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, hostname name of the host. bitwidth (usually 32 or 64), host state - one of sg physical host, sg virtual machine, sg paravirtual machine, sg hardware virtualized or sg unknown configuration), current number of CPU’s, maximum number of CPU’s. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 20. Host Information Host Info sg host info typedef struct { char *os_name; char * os_release ; char * os_version ; char *platform; char *hostname; unsigned bitwidth ; sg_host_state host_state ; unsigned ncpus; unsigned maxcpus; time_t uptime; time_t systime; } sg_host_info ; bundles some operating system information as name (Linux, FreeBSD, AIX), release (eg. kernel version), entire OS version string (eg. Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15 1/RELEASE X86 64), platform, what finally means CPU information from OS perspective, hostname name of the host. bitwidth (usually 32 or 64), host state - one of sg physical host, sg virtual machine, sg paravirtual machine, sg hardware virtualized or sg unknown configuration), current number of CPU’s, maximum number of CPU’s. timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 8 / 28
  • 21. CPU statistics CPU stats sg cpu stats typedef struct { unsigned long long user , kernel , idle , iowait , swap , nice , total; unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches , syscalls , interrupts , soft_interrupts , time_t systime ; } sg_cpu_stats ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
  • 22. CPU statistics CPU stats sg cpu stats typedef struct { unsigned long long user , kernel , idle , iowait , swap , nice , total; unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches , syscalls , interrupts , soft_interrupts , time_t systime ; } sg_cpu_stats ; absolute ticks of measurable CPU states, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
  • 23. CPU statistics CPU stats sg cpu stats typedef struct { unsigned long long user , kernel , idle , iowait , swap , nice , total; unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches , syscalls , interrupts , soft_interrupts , time_t systime ; } sg_cpu_stats ; absolute ticks of measurable CPU states, context switches over all CPU’s, also separated by voluntary and involuntary, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
  • 24. CPU statistics CPU stats sg cpu stats typedef struct { unsigned long long user , kernel , idle , iowait , swap , nice , total; unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches , syscalls , interrupts , soft_interrupts , time_t systime ; } sg_cpu_stats ; absolute ticks of measurable CPU states, context switches over all CPU’s, also separated by voluntary and involuntary, syscalls made, interrupts and soft-interrupts occured, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
  • 25. CPU statistics CPU stats sg cpu stats typedef struct { unsigned long long user , kernel , idle , iowait , swap , nice , total; unsigned long long context_switches , voluntary_context_switches , involuntary_context_switches , syscalls , interrupts , soft_interrupts , time_t systime ; } sg_cpu_stats ; absolute ticks of measurable CPU states, context switches over all CPU’s, also separated by voluntary and involuntary, syscalls made, interrupts and soft-interrupts occured, timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 9 / 28
  • 26. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 27. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 28. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 29. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, kernel mode, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 30. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 31. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 32. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o, during page swap, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 33. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o, during page swap, nice rescheduled Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 34. CPU statistics CPU percents sg cpu percents typedef struct { double user; double kernel; double idle; double iowait; double swap; double nice; time_t time_taken ; } sg_cpu_percents ; relative ticks of measurable CPU states: ticks in user mode, kernel mode, idle time, waiting for i/o, during page swap, nice rescheduled timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 10 / 28
  • 35. CPU statistics Load percents sg load stats typedef struct { double min1; double min5; double min15; time_t systime; } sg_load_stats; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
  • 36. CPU statistics Load percents sg load stats typedef struct { double min1; double min5; double min15; time_t systime; } sg_load_stats; percentage of cpu usage per Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
  • 37. CPU statistics Load percents sg load stats typedef struct { double min1; double min5; double min15; time_t systime; } sg_load_stats; percentage of cpu usage per 1 minute, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
  • 38. CPU statistics Load percents sg load stats typedef struct { double min1; double min5; double min15; time_t systime; } sg_load_stats; percentage of cpu usage per 1 minute, 5 minutes and Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
  • 39. CPU statistics Load percents sg load stats typedef struct { double min1; double min5; double min15; time_t systime; } sg_load_stats; percentage of cpu usage per 1 minute, 5 minutes and 15 minutes. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
  • 40. CPU statistics Load percents sg load stats typedef struct { double min1; double min5; double min15; time_t systime; } sg_load_stats; percentage of cpu usage per 1 minute, 5 minutes and 15 minutes. timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 11 / 28
  • 41. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 42. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; information about main memory of the system: Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 43. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; information about main memory of the system: total, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 44. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; information about main memory of the system: total, free, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 45. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; information about main memory of the system: total, free, used, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 46. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; information about main memory of the system: total, free, used, cache, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 47. Memory statistics Memory stats sg mem stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; unsigned long long cache; time_t systime; } sg_mem_stats ; information about main memory of the system: total, free, used, cache, timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 12 / 28
  • 48. Memory statistics Swap stats sg swap stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; time_t systime; } sg_swap_stats; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
  • 49. Memory statistics Swap stats sg swap stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; time_t systime; } sg_swap_stats; information about swap memory of the system: Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
  • 50. Memory statistics Swap stats sg swap stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; time_t systime; } sg_swap_stats; information about swap memory of the system: total, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
  • 51. Memory statistics Swap stats sg swap stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; time_t systime; } sg_swap_stats; information about swap memory of the system: total, free, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
  • 52. Memory statistics Swap stats sg swap stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; time_t systime; } sg_swap_stats; information about swap memory of the system: total, free, used, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
  • 53. Memory statistics Swap stats sg swap stats typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; time_t systime; } sg_swap_stats; information about swap memory of the system: total, free, used, timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 13 / 28
  • 54. Disk / Storage statistics Disk I/O stats sg disk io stats typedef struct { char *disk_name; unsigned long long read_bytes ; unsigned long long write_bytes; time_t systime; } sg_disk_io_stats ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
  • 55. Disk / Storage statistics Disk I/O stats sg disk io stats typedef struct { char *disk_name; unsigned long long read_bytes ; unsigned long long write_bytes; time_t systime; } sg_disk_io_stats ; for each block device known to the system name of the block device, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
  • 56. Disk / Storage statistics Disk I/O stats sg disk io stats typedef struct { char *disk_name; unsigned long long read_bytes ; unsigned long long write_bytes; time_t systime; } sg_disk_io_stats ; for each block device known to the system name of the block device, amount of bytes read Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
  • 57. Disk / Storage statistics Disk I/O stats sg disk io stats typedef struct { char *disk_name; unsigned long long read_bytes ; unsigned long long write_bytes; time_t systime; } sg_disk_io_stats ; for each block device known to the system name of the block device, amount of bytes read amount of bytes written Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
  • 58. Disk / Storage statistics Disk I/O stats sg disk io stats typedef struct { char *disk_name; unsigned long long read_bytes ; unsigned long long write_bytes; time_t systime; } sg_disk_io_stats ; for each block device known to the system name of the block device, amount of bytes read amount of bytes written timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 14 / 28
  • 59. Disk / Storage statistics Paging stats sg page stats typedef struct { unsigned long long pages_pagein ; unsigned long long pages_pageout; time_t systime; } sg_page_stats; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
  • 60. Disk / Storage statistics Paging stats sg page stats typedef struct { unsigned long long pages_pagein ; unsigned long long pages_pageout; time_t systime; } sg_page_stats; for entire system amount of bytes paged in, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
  • 61. Disk / Storage statistics Paging stats sg page stats typedef struct { unsigned long long pages_pagein ; unsigned long long pages_pageout; time_t systime; } sg_page_stats; for entire system amount of bytes paged in, amount of bytes paged out Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
  • 62. Disk / Storage statistics Paging stats sg page stats typedef struct { unsigned long long pages_pagein ; unsigned long long pages_pageout; time_t systime; } sg_page_stats; for entire system amount of bytes paged in, amount of bytes paged out timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 15 / 28
  • 63. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 64. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 65. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 66. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 67. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 68. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 69. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 70. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 71. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system also separated into used, free and avail Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 72. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system also separated into used, free and avail optimal size of the I/O blocks when accessing the file system in bytes Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 73. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system also separated into used, free and avail optimal size of the I/O blocks when accessing the file system in bytes block size (minimum allocation size) of the file system in bytes Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 74. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system also separated into used, free and avail optimal size of the I/O blocks when accessing the file system in bytes block size (minimum allocation size) of the file system in bytes amount of blocks of the file system Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 75. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system also separated into used, free and avail optimal size of the I/O blocks when accessing the file system in bytes block size (minimum allocation size) of the file system in bytes amount of blocks of the file system also separated into used, free and avail Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 76. Disk / Storage statistics Filesystem stats sg fs stats typedef struct { char * device_name; char *fs_type; char *mnt_point; sg_fs_device_type device_type; unsigned long long size; unsigned long long used; unsigned long long free; unsigned long long avail; unsigned long long total_inodes ; unsigned long long used_inodes; unsigned long long free_inodes; unsigned long long avail_inodes ; unsigned long long io_size ; unsigned long long block_size ; unsigned long long total_blocks ; unsigned long long free_blocks; unsigned long long used_blocks; unsigned long long avail_blocks ; time_t systime; } sg_fs_stats; for each mounted (and not filtered) file system name of the mounted block device, name of the file system type (eg. ext3, ffs, zfs) full qualified path name of the mount point device type: one of sg fs unknown, sg fs regular, sg fs special, sg fs loopback, sg fs remote or any combination Anything but unknown is covered by sg fs alltypes, any local type by sg fs local size of the file system in bytes also separated into used, free and avail inodes of the file system also separated into used, free and avail optimal size of the I/O blocks when accessing the file system in bytes block size (minimum allocation size) of the file system in bytes amount of blocks of the file system also separated into used, free and avail timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 16 / 28
  • 77. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 78. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 79. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, record id and size of that field (not ’0’ terminated), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 80. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, record id and size of that field (not ’0’ terminated), device where user logged in, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 81. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, record id and size of that field (not ’0’ terminated), device where user logged in, hostname when remote login Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 82. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, record id and size of that field (not ’0’ terminated), device where user logged in, hostname when remote login process id of the session’s ”root” process Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 83. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, record id and size of that field (not ’0’ terminated), device where user logged in, hostname when remote login process id of the session’s ”root” process login time of that session Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 84. User statistics User stats sg user stats typedef struct { char * login_name ; char *record_id; size_t record_id_size; char *device; char *hostname; pid_t pid; time_t login_time ; time_t systime; } sg_user_stats; statistics about logged in users, as login name, record id and size of that field (not ’0’ terminated), device where user logged in, hostname when remote login process id of the session’s ”root” process login time of that session timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 17 / 28
  • 85. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 86. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 87. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 88. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 89. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 90. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 91. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 92. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 93. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 94. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 95. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 96. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id context switches done by the process, also separated by voluntary and involuntary Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 97. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id context switches done by the process, also separated by voluntary and involuntary virtual memory size of the process, thereof resident Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 98. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id context switches done by the process, also separated by voluntary and involuntary virtual memory size of the process, thereof resident start time of the process, time spent on CPU during lifetime, relative to system usage Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 99. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id context switches done by the process, also separated by voluntary and involuntary virtual memory size of the process, thereof resident start time of the process, time spent on CPU during lifetime, relative to system usage nice value of the process (process scheduling increment) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 100. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id context switches done by the process, also separated by voluntary and involuntary virtual memory size of the process, thereof resident start time of the process, time spent on CPU during lifetime, relative to system usage nice value of the process (process scheduling increment) device type: one of SG PROCESS STATE RUNNING, SG PROCESS STATE SLEEPING, SG PROCESS STATE STOPPED, SG PROCESS STATE ZOMBIE or SG PROCESS STATE UNKNOWN Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 101. Process statistics Process stats sg process stats typedef struct { char * process_name ; char *proctitle; pid_t pid; pid_t parent; pid_t pgid; pid_t sessid; uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long context_switches ; unsigned long long voluntary_context_switches; unsigned long long involuntary_context_switches; unsigned long long proc_size; unsigned long long proc_resident; time_t start_time ; time_t time_spent ; double cpu_percent; int nice; sg_process_state state; time_t systime; } sg_process_stats ; for each existing process name of the process image, title of the process (usually FQPN + args) process id of the process, the parent process, the process group leader and the session id of the session the process belongs to process’ user id, group id, effective user id and effective group id context switches done by the process, also separated by voluntary and involuntary virtual memory size of the process, thereof resident start time of the process, time spent on CPU during lifetime, relative to system usage nice value of the process (process scheduling increment) device type: one of SG PROCESS STATE RUNNING, SG PROCESS STATE SLEEPING, SG PROCESS STATE STOPPED, SG PROCESS STATE ZOMBIE or SG PROCESS STATE UNKNOWN timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 18 / 28
  • 102. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 103. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 104. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), bytes transmitted and received Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 105. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), bytes transmitted and received packets transmitted and received Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 106. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), bytes transmitted and received packets transmitted and received errors transmitting and receiving packets Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 107. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), bytes transmitted and received packets transmitted and received errors transmitting and receiving packets detected collisions Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 108. Network statistics Network I/O stats sg network io stats typedef struct { char * interface_name; unsigned long long tx; unsigned long long rx; unsigned long long ipackets ; unsigned long long opackets; unsigned long long ierrors ; unsigned long long oerrors ; unsigned long long collisions ; time_t systime; } sg_network_io_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), bytes transmitted and received packets transmitted and received errors transmitting and receiving packets detected collisions timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 19 / 28
  • 109. Network statistics Network Interface stats sg network iface stats typedef struct { char * interface_name; unsigned long long speed; unsigned long long factor; sg_iface_duplex duplex; sg_iface_updown up; time_t systime; } sg_network_iface_stats ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
  • 110. Network statistics Network Interface stats sg network iface stats typedef struct { char * interface_name; unsigned long long speed; unsigned long long factor; sg_iface_duplex duplex; sg_iface_updown up; time_t systime; } sg_network_iface_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
  • 111. Network statistics Network Interface stats sg network iface stats typedef struct { char * interface_name; unsigned long long speed; unsigned long long factor; sg_iface_duplex duplex; sg_iface_updown up; time_t systime; } sg_network_iface_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), capable to transfer times of sized units per second Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
  • 112. Network statistics Network Interface stats sg network iface stats typedef struct { char * interface_name; unsigned long long speed; unsigned long long factor; sg_iface_duplex duplex; sg_iface_updown up; time_t systime; } sg_network_iface_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), capable to transfer times of sized units per second capable to transmit and receive simultanously (SG IFACE DUPLEX FULL, SG IFACE DUPLEX HALF or SG IFACE DUPLEX UNKNOWN) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
  • 113. Network statistics Network Interface stats sg network iface stats typedef struct { char * interface_name; unsigned long long speed; unsigned long long factor; sg_iface_duplex duplex; sg_iface_updown up; time_t systime; } sg_network_iface_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), capable to transfer times of sized units per second capable to transmit and receive simultanously (SG IFACE DUPLEX FULL, SG IFACE DUPLEX HALF or SG IFACE DUPLEX UNKNOWN) NIC is SG IFACE UP or SG IFACE DOWN Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
  • 114. Network statistics Network Interface stats sg network iface stats typedef struct { char * interface_name; unsigned long long speed; unsigned long long factor; sg_iface_duplex duplex; sg_iface_updown up; time_t systime; } sg_network_iface_stats ; for each network interface interface name (eg. ”em0”, ”fxp0”, ”en0”, ”eth0” . . . ), capable to transfer times of sized units per second capable to transmit and receive simultanously (SG IFACE DUPLEX FULL, SG IFACE DUPLEX HALF or SG IFACE DUPLEX UNKNOWN) NIC is SG IFACE UP or SG IFACE DOWN timestamp when collected this stats. Jens Rehsack () Unix::Statgrab - System Monitoring 2013 20 / 28
  • 115. Error management Error information sg error details typedef struct sg_error_details { sg_error error; int errno_value; const char *error_arg; } sg_error_details ; Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
  • 116. Error management Error information sg error details typedef struct sg_error_details { sg_error error; int errno_value; const char *error_arg; } sg_error_details ; when an error occured (no stats are resulted upon querying): libstatgrab error code (eg. SG ERROR INVALID ARGUMENT) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
  • 117. Error management Error information sg error details typedef struct sg_error_details { sg_error error; int errno_value; const char *error_arg; } sg_error_details ; when an error occured (no stats are resulted upon querying): libstatgrab error code (eg. SG ERROR INVALID ARGUMENT) system (errno.h) error code (eg. EBUSY Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
  • 118. Error management Error information sg error details typedef struct sg_error_details { sg_error error; int errno_value; const char *error_arg; } sg_error_details ; when an error occured (no stats are resulted upon querying): libstatgrab error code (eg. SG ERROR INVALID ARGUMENT) system (errno.h) error code (eg. EBUSY optional error explanation message (eg. file name, process id, . . . ) Jens Rehsack () Unix::Statgrab - System Monitoring 2013 21 / 28
  • 119. Overview Part III Unix::Statgrab 10 Entry Functions 11 SYNOPSIS Jens Rehsack () Unix::Statgrab - System Monitoring 2013 22 / 28
  • 120. Entry Functions Entry Functions get_error (); # return details about last error get_host_info (); # returns sg_host_info get_cpu_stats (); # returns sg_cpu_stats get_disk_io_stats (); # returns sg_disk_io_stats get_fs_stats (); # returns sg_fs_stats get_load_stats (); # returns sg_load_stats get_mem_stats (); # returns sg_mem_stats get_swap_stats (); # returns sg_swap_stats get_network_io_stats (); # returns sg_network_io_stats get_network_iface_stats (); # returns sg_network_iface_stats get_page_stats (); # returns sg_page_stats get_user_stats (); # returns sg_user_stats get_process_stats (); # returns sg_process_stats Jens Rehsack () Unix::Statgrab - System Monitoring 2013 23 / 28
  • 121. SYNOPSIS Common . . . Common . . . use Unix :: Statgrab ; my $host_info = get_host_info () or croak( get_error ()-> strperror () ); printf( "%dn", $host_info ->entries () ); my $cpu_stats = get_cpu_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $cpu_stats ->entries () ); my $disk_io_stats = get_disk_io_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $disk_io_stats ->entries () ); my $fs_stats = get_fs_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $fs_stats ->entries () ); my $load_stats = get_load_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $load_stats ->entries () ); my $mem_stats = get_mem_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $mem_stats ->entries () ); my $swap_stats = get_swap_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $swap_stats ->entries () ); my $net_io_stats = get_network_io_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $net_io_stats ->entries () ); my $net_iface_stats = get_network_iface_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $net_iface_stats ->entries () ); my $paging_stats = get_page_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $paging ->entries () ); my $user_stats = get_user_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $user_stats ->entries () ); my $proc_stats = get_process_stats () or croak( get_error ()-> strperror () ); printf( "%dn", $proc_stats ->entries () ); Jens Rehsack () Unix::Statgrab - System Monitoring 2013 24 / 28
  • 122. SYNOPSIS SYNOPSIS SYNOPSIS use Unix :: Statgrab ; my $host_stats = get_host_info (); print $host_stats ->hostname . " is a " . $host_stats ->bitwidth . " " . $host_stats ->os_name . "n"; my $filesystems = get_fs_stats (); my @mount_points = map { $filesystems ->mnt_point($_) } (0 .. $filesystems ->entries () - 1); print $host_stats ->hostname . " has " . join( ", ", @mount_points ) . " mounted n"; my $proc_list = get_process_stats (); my @proc_by_type; foreach my $proc_entry (0 .. $proc_list ->entries () - 1) { $proc_by_type[$proc_list ->state( $proc_entry )]++; } my $total_procs = 0; $total_procs += $_ for grep { defined $_ } @proc_by_type; foreach my $state (qw( SG_PROCESS_STATE_RUNNING SG_PROCESS_STATE_SLEEPING SG_PROCESS_STATE_STOPPED SG_PROCESS_STATE_ZOMBIE SG_PROCESS_STATE_UNKNOWN )) { defined $proc_by_type[Unix :: Statgrab ->$state] or next; print $proc_by_type[Unix :: Statgrab ->$state ] . " of " . $total_procs . " procs in $staten"; } Jens Rehsack () Unix::Statgrab - System Monitoring 2013 25 / 28
  • 123. SYNOPSIS SYNOPSIS II SYNOPSIS diff / percent use Unix :: Statgrab ; my $last_cpu_stats = get_cpu_stats () or croak( get_error ()-> strperror () ); do_sth_way_longer (); my $cpu_diff = get_cpu_stats ()-> get_cpu_stats_diff( $last_cpu_stats ); my $last_cpu_percent = $last_cpu_percent -> get_cpu_percents (); my $diff_cpu_percent = $cpu_diff -> get_cpu_percents (); my $now_cpu_percent = get_cpu_stats ()-> get_cpu_percents (); my $last_disk_io_stats = get_disk_io_stats () or croak( get_error ()-> strperror () ); do_sth_way_longer (); my $disk_io_diff = get_disk_io_stats()-> get_disk_io_stats_diff ( $last_disk_io_stats ); my $last_fs_stats = get_fs_stats () or croak( get_error ()-> strperror () ); do_sth_way_longer (); my $fs_diff = get_fs_stats ()-> get_fs_stats_diff( $last_fs_stats ); my $last_net_io_stats = get_network_io_stats () or croak( get_error ()-> strperror () ); do_sth_way_longer (); my $net_io_diff = get_network_io_stats ()-> get_network_io_stats_diff( $last_net_io_stats ); my $last_paging_stats = get_page_stats () or croak( get_error ()-> strperror () ); do_sth_way_longer (); my $paging_diff = get_page_stats ()-> get_page_stats_diff ( $last_paging_stats ); Jens Rehsack () Unix::Statgrab - System Monitoring 2013 26 / 28
  • 127. SYNOPSIS Thank You Thank you Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
  • 128. SYNOPSIS Thank You Thank you Tim Bishop for caring for high quality release Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
  • 129. SYNOPSIS Thank You Thank you Tim Bishop for caring for high quality release H. Merijn Brand for doing additional tests on more exotic platforms Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
  • 130. SYNOPSIS Thank You Thank you Tim Bishop for caring for high quality release H. Merijn Brand for doing additional tests on more exotic platforms Reini Urban for proving on commodity hardware for being sane Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28
  • 131. SYNOPSIS Thank You Thank you Tim Bishop for caring for high quality release H. Merijn Brand for doing additional tests on more exotic platforms Reini Urban for proving on commodity hardware for being sane Questions? Jens Rehsack <rehsack@cpan.org> Jens Rehsack () Unix::Statgrab - System Monitoring 2013 28 / 28