Project

check_disk

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Sensu/Nagios CLI Command Check for disk inode and block usage.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 5.3.1, ~> 5.3
>= 10.3.0, ~> 10.3
>= 0.20.1, ~> 0.20
>= 0.8.2, ~> 0.8

Runtime

>= 1.1.0
>= 1.1.2, ~> 1.1
 Project Readme

check_disk

  • A sensu check for disks.
  • A Sensu Plugin to check disk block and inode usage by mountpoint.
  • Takes a mount point in as path.
  • Takes warning, and critical parameters that set a percentage [0-100].
  • Takes parameters to check either file serial numbers (inodes) or blocks.
  • Determines total number of inodes|blocks.
  • Determines baseline percent based on total number.
  • Determines usage by subtracting available from total number
  • Compares usage to see if greater than baseline.

See: statvfs(3) See: https://github.com/djberg96/sys-filesystem

"Because parsing the output of df is a bad idea."

Install

This project is laid out as a Ruby Gem.

You can add this repository to your Gemfile, or create a gem and install that.

Use

check_disk.rb -h
Usage: check_disk.rb (options)
    -b                               Boolean for enabling block code path.
    -c PERCENT                       The high water mark for `critical` alerts. eg; 75
    -i                               Boolean for enabling inode code path.
    -p PATH                          The `path` or `mount point` we are checking. eg; /mnt
    -w PERCENT                       The high water mark for `warning` alerts. eg; 50
$ check_disk.rb -i
CheckDisk::CLI WARNING: 65% of inodes used. path: / total: 121846308 available: 42055237

Build

gem build check_disk.gemspec

Test

make test

or

bundle exec rake test:all

Coverage

View test coverage executing make test then opening coverage/index.html