Kernel VMStat Telegraf Input Plugin

VMStat is part of the proc pseudo file system, which is included in Linux and creates an interface for kernel data structures. Kernel data structures store data about system status, such as details about new processes created in the system. VMStat specifically contains virtual memory statistics. Virtual memory is a technique computers use to make up for a temporary shortage in physical memory by sending data from random access memory (RAM) to disk storage. Some of the data VMStat collects includes information on system processes, memory, and central processing unit (CPU) activity.

Why use a Telegraf plugin for Kernel VMStat?

The Kernel VMStat Telegraf input plugin collects statistics from /proc/vmstat so you can access information on how your system is using virtual memory. The information you can fetch with Telegraf includes system processes, memory, CPU activity, block I/O, paging, interrupts, and traps. You can get this information in real time in a central location and ready for analysis. This helps you get a clear view of when and why your system is using virtual memory. You can figure out what files and processes are consuming most of your resources and how your computer handles these situations. This lets you test alternate processes to make your systems more efficient and save memory and CPU.

How to monitor Kernel VMStat using the Telegraf plugin

There's no configuration required for the Kernel VMStat Telegraf Input Plugin. One example of how you might use it is to find the amount of memory swapped in from the disk and the amount of memory swapped out to the disk since the last time your system booted. Consistently monitoring this statistic with Telegraf can help you find bottlenecks and optimize your system.

Key Kernel VMStat metrics to use for monitoring

Some of the important Kernel VMStat metrics that you should proactively monitor include:

  • kernel_vmstat
    • nr_free_pages (integer, nr_free_pages)
    • nr_inactive_anon (integer, nr_inactive_anon)
    • nr_active_anon (integer, nr_active_anon)
    • nr_inactive_file (integer, nr_inactive_file)
    • nr_active_file (integer, nr_active_file)
    • nr_unevictable (integer, nr_unevictable)
    • nr_mlock (integer, nr_mlock)
    • nr_anon_pages (integer, nr_anon_pages)
    • nr_mapped (integer, nr_mapped)
    • nr_file_pages (integer, nr_file_pages)
    • nr_dirty (integer, nr_dirty)
    • nr_writeback (integer, nr_writeback)
    • nr_slab_reclaimable (integer, nr_slab_reclaimable)
    • nr_slab_unreclaimable (integer, nr_slab_unreclaimable)
    • nr_page_table_pages (integer, nr_page_table_pages)
    • nr_kernel_stack (integer, nr_kernel_stack)
    • nr_unstable (integer, nr_unstable)
    • nr_bounce (integer, nr_bounce)
    • nr_vmscan_write (integer, nr_vmscan_write)
    • nr_writeback_temp (integer, nr_writeback_temp)
    • nr_isolated_anon (integer, nr_isolated_anon)
    • nr_isolated_file (integer, nr_isolated_file)
    • nr_shmem (integer, nr_shmem)
    • numa_hit (integer, numa_hit)
    • numa_miss (integer, numa_miss)
    • numa_foreign (integer, numa_foreign)
    • numa_interleave (integer, numa_interleave)
    • numa_local (integer, numa_local)
    • numa_other (integer, numa_other)
    • nr_anon_transparent_hugepages (integer, nr_anon_transparent_hugepages)
    • pgpgin (integer, pgpgin)
    • pgpgout (integer, pgpgout)
    • pswpin (integer, pswpin)
    • pswpout (integer, pswpout)
    • pgalloc_dma (integer, pgalloc_dma)
    • pgalloc_dma32 (integer, pgalloc_dma32)
    • pgalloc_normal (integer, pgalloc_normal)
    • pgalloc_movable (integer, pgalloc_movable)
    • pgfree (integer, pgfree)
    • pgactivate (integer, pgactivate)
    • pgdeactivate (integer, pgdeactivate)
    • pgfault (integer, pgfault)
    • pgmajfault (integer, pgmajfault)
    • pgrefill_dma (integer, pgrefill_dma)
    • pgrefill_dma32 (integer, pgrefill_dma32)
    • pgrefill_normal (integer, pgrefill_normal)
    • pgrefill_movable (integer, pgrefill_movable)
    • pgsteal_dma (integer, pgsteal_dma)
    • pgsteal_dma32 (integer, pgsteal_dma32)
    • pgsteal_normal (integer, pgsteal_normal)
    • pgsteal_movable (integer, pgsteal_movable)
    • pgscan_kswapd_dma (integer, pgscan_kswapd_dma)
    • pgscan_kswapd_dma32 (integer, pgscan_kswapd_dma32)
    • pgscan_kswapd_normal (integer, pgscan_kswapd_normal)
    • pgscan_kswapd_movable (integer, pgscan_kswapd_movable)
    • pgscan_direct_dma (integer, pgscan_direct_dma)
    • pgscan_direct_dma32 (integer, pgscan_direct_dma32)
    • pgscan_direct_normal (integer, pgscan_direct_normal)
    • pgscan_direct_movable (integer, pgscan_direct_movable)
    • zone_reclaim_failed (integer, zone_reclaim_failed)
    • pginodesteal (integer, pginodesteal)
    • slabs_scanned (integer, slabs_scanned)
    • kswapd_steal (integer, kswapd_steal)
    • kswapd_inodesteal (integer, kswapd_inodesteal)
    • kswapd_low_wmark_hit_quickly (integer, kswapd_low_wmark_hit_quickly)
    • kswapd_high_wmark_hit_quickly (integer, kswapd_high_wmark_hit_quickly)
    • kswapd_skip_congestion_wait (integer, kswapd_skip_congestion_wait)
    • pageoutrun (integer, pageoutrun)
    • allocstall (integer, allocstall)
    • pgrotated (integer, pgrotated)
    • compact_blocks_moved (integer, compact_blocks_moved)
    • compact_pages_moved (integer, compact_pages_moved)
    • compact_pagemigrate_failed (integer, compact_pagemigrate_failed)
    • compact_stall (integer, compact_stall)
    • compact_fail (integer, compact_fail)
    • compact_success (integer, compact_success)
    • htlb_buddy_alloc_success (integer, htlb_buddy_alloc_success)
    • htlb_buddy_alloc_fail (integer, htlb_buddy_alloc_fail)
    • unevictable_pgs_culled (integer, unevictable_pgs_culled)
    • unevictable_pgs_scanned (integer, unevictable_pgs_scanned)
    • unevictable_pgs_rescued (integer, unevictable_pgs_rescued)
    • unevictable_pgs_mlocked (integer, unevictable_pgs_mlocked)
    • unevictable_pgs_munlocked (integer, unevictable_pgs_munlocked)
    • unevictable_pgs_cleared (integer, unevictable_pgs_cleared)
    • unevictable_pgs_stranded (integer, unevictable_pgs_stranded)
    • unevictable_pgs_mlockfreed (integer, unevictable_pgs_mlockfreed)
    • thp_fault_alloc (integer, thp_fault_alloc)
    • thp_fault_fallback (integer, thp_fault_fallback)
    • thp_collapse_alloc (integer, thp_collapse_alloc)
    • thp_collapse_alloc_failed (integer, thp_collapse_alloc_failed)
    • thp_split (integer, thp_split)
For more information, please check out the documentation.

Project URL   Documentation

Related resources