system_stats is a LightDB extension that provides functions to access system level statistics that can be used for monitoring.
Due to the nature of the information returned by these functions, access is restricted to superusers and members of the monitor_system_stats role which will be created when the extension is installed. To allow users to access the functions without granting them superuser access, add them to the monitor_system_stats role. For example:
GRANT monitor_system_stats to nagios;
The following functions are provided to fetch system level statistics for all platforms.
This interface allows the user to get operating system statistics.
This interface allows the user to get CPU information.
This interface allows the user to get CPU usage information. Values are a percentage of time spent by CPUs for all operations.
This interface allows the user to get memory usage information. All the values are in bytes.
This interface allows the user to get an I/O analysis of block devices.
This interface allows the user to get the disk information.
This interface allows the user to get the average load of the system over 1, 5, 10 and 15 minute intervals.
This interface allows the user to get process information.
This interface allows the user to get network interface information.
This interface allows the user to get the CPU and memory information for each process ID.
Name
Version
Host name
Domain name
Handle count
Process count
Thread count
Architecture
Last bootup time
Uptime in seconds
Vendor
Description
Model name
Processor type
Logical processor
Physical processor
Number of cores
Architecture
Clock speed in hz
CPU type
CPU family
Byte order
L1d cache size
L1i cache size
L2 cache size
L3 cache size
Percent time spent in processing usermode normal process
Percent time spent in processing usermode niced process
Percent time spent in kernel mode process
Percent time spent in idle mode
Percent time spent in io completion
Percent time spent in servicing interrupt
Percent time spent in servicing software interrupt
Percent user time spent
Percent processor time spent
Percent privileged time spent
Percent interrupt time spent
Total memory
Used memory
Free memory
Total swap memory
Used swap memory
Free swap memory
Total cache memory
Total kernel memory
Kernel paged memory
Kernel non paged memory
Total page file
Available page file
Block device name
Total number of reads
Total number of writes
Read bytes
Written bytes
Time spent in milliseconds for reading
Time spent in milliseconds for writing
File system of the disk
File system type
Mount point for the file system
Drive letter
Drive type
Total space in bytes
Used space in bytes
Available space in bytes
Number of total inodes
Number of used inodes
Number of free inodes
1 minute load average
5 minute load average
10 minute load average
15 minute load average
Number of total processes
Number of running processes
Number of sleeping processes
Number of stopped processes
Number of zombie processes
Name of the interface_name
ipv4 address of the interface
Number of total bytes transmitted
Number of total packets transmitted
Number of transmit errors by this network device
Number of packets dropped during transmission
Number of total bytes received
Number of total packets received
Number of receive errors by this network device
Number of packets dropped by this network device
Interface speed in mbps
PID of the process
Process name
CPU usage in bytes
Memory usage in bytes
Total memory used in bytes