check_linux_metrics

A monitoring plugin for icinga/nagios/nsca, that reports basic system metrics of a linux host: cpu, load, threads, openfiles, procs, diskio, disku, memory, swap, network

check_linux_metrics

check_linux_metrics A monitoring plugin for icinga/nagios/nsca, that reports basic system metrics of a linux host: cpu, load, threads, openfiles, procs, diskio, disku, memory, swap, network

Key features

  • Minimal dependency: Only needs basic python libraries which are installed by default on linux, all the metrics are calculated from the /proc filesystem

  • Minimal privilege: Can be run by any non-priviliged user. Does not require root

  • No Sampling: Important metrics like CPU, DiskIO, NetworkIO and new process forks are calculated based on the cumulative values provided by the kernel. These cumulative values are provided by the kernel since uptime, when any of these checks are called the first time, the values are copied in the interim directory. Next time whenever the plugin is called, the diffrential/interim values are reported. This ensures that there is no peak/spike missed in between the plugin calls.

TODO

  • Improve and stanadardize argument handling
  • Print usage instructions if wrong/bad arguments are passed
  • Add more sanity checks for arguments
  • Add more warning and critical thresholds
  • Move the output printing part from each function to a single function
  • Enable/disable perfdata
  • Add a file age plugin?
  • Add a Process wise memory and cpu usage reporting function?
  • Add functionality of directly sending email (making this script usefull as a standalone monitoring)
  • Add graphite output support?

Program Structure

The Main function checks and validate arguments and call the respective independent functions check_cpu etc.

Usage Examples

  • CPU

`