Skip to content

Instantly share code, notes, and snippets.

@skihero
Created October 27, 2014 16:16
Show Gist options
  • Save skihero/22078090a6b0cd31edb3 to your computer and use it in GitHub Desktop.
Save skihero/22078090a6b0cd31edb3 to your computer and use it in GitHub Desktop.
add or remove an nrpecheck
examples $ cat base_monitoring.rb
#
# Cookbook Name:: monitoring
# Recipe:: base_monitoring
#
# Copyright 2013, Example Company, Inc.
#
# This recipe defines the necessary NRPE commands for base system monitoring
# in Example Company Inc's Chef environment.
# Check for high load. This check defines warning levels and attributes
nagios_nrpecheck 'check_load' do
command "#{node['nagios']['plugin_dir']}/check_load"
warning_condition '6'
critical_condition '10'
action :add
end
# Check all non-NFS/tmp-fs disks.
nagios_nrpecheck 'check_all_disks' do
command "#{node['nagios']['plugin_dir']}/check_disk"
warning_condition '8%'
critical_condition '5%'
parameters '-A -x /dev/shm -X nfs -i /boot'
action :add
end
# Check for excessive users. This command relies on the service definition to
# define what the warning/critical levels and attributes are
nagios_nrpecheck 'check_users' do
command "#{node['nagios']['plugin_dir']}/check_users"
action :add
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment