####Table of Contents
- New stuff
- Breaking Changes
- Bug fixes
- Requirements
- Overview - What is the monitoring module?
- Module Description - What does the module do?
- Setup - The basics of getting started with monitoring
- Usage - The parameters available for configuration
- Implementation - An under-the-hood peek at what the module is doing
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Release Notes - Notes on the most recent updates to the module
Initial move towards using base class as primary API. Added metadata.json file for compatability with newer versions of puppet Fixed template variables
I recently started a consulting company called Abstract IT Pty Ltd. I have transfered ownership of all my puppet modules to a new organisation on Puppet Forge called abstractit. I am making one final release of my modules under rendhalver and abstractit to give you a chance to switch over to the new organisation. I have also added a licence. All my modules will be licenced under Apache v2.
As of version 1.1.x
$monitoring_service
is no longer a class variable monitoring::params
$monitoring_type
is used to set the server type (icinga or nagios currently) which determines the user and service to notify
I have removed some really old files I need to convert so if you were using those let me know.
I don't think you would be because they don't work with the current setup.
fixing some package dependencies for Fedora 19
added a define for creating nagios hostgroups
added getting hostgroup set by and ENC or other method that sets $::hostgroup
monitoring::params::host_groups
can now be an array or a , separated string
including sudo in base class as it's needed now
including more exported nagios resources
added a few new commands
check_http_port_string
for checking the existence of a string on a web page
check_https_port_string
for checking the existence of a string on a https web page
added a script so the check_route
command has something to run
removed a few commands that didn't have scripts
Stored configs on your puppetmaster (I highly recommend using puppetdb with a postgresql backend for this). Hiera is used for getting some variables so a puppet version that supports hiera is required. I have only tested this with puppet 3.x but it should work with 2.7. If anyone has gotten it working in other versions please let me know.
Puppet module for managing monitoring and nagios resources Node resources are exported to a monitoring server
Puppet module for managing puppet monitoring resources. The base module sets up a few basic servies to monitor.
what monitoring affects:
- Not a lot on the node itself most resources are exported
- On a server node the resources to monitor are put in /etc/nagios/ and can be read by icinga or nagios from there
This will manage a basic setup for monitoring a node. This will also pull in all the exported resources for a node that is also a monitoring server
include monitoring
Variables that need to be set for monitoring to work These are class params so use hiera or and ENC to set them up easily.
Using monitoring class:
$monitoring::monitoring_server
# node that will monitor this node
$monitoring::monitoring_type
# Type of the monitoring server (icinga or nagios currently)
Using monitoring::params $monitoring::params::monitoring_server # node that will monitor this node $monitoring::params::monitoring_type # Type of the monitoring server (icinga or nagios currently)
Extra params for this node. Using monitoring class
$monitoring::host_name
# for overriding the host_name of this node, defaults to $fqdn
$monitoring::host_ip
# for overriding the host_ip of this node, defaults to $ipaddress
$monitoring::host_groups
# comma separates list of host_groups to add this host to
$monitoring::parents
# parent for this host
$monitoring::host_type
# host template to use for this host default is linux_server
$monitoring::host_alias
# alias to set for this host
$monitoring::check_period
# when to check this host
$monitoring::notification_period
# when to send notifications for this host
using monitoring::params $monitoring::params::host_name # for overriding the host_name of this node, defaults to $fqdn $monitoring::params::host_ip # for overriding the host_ip of this node, defaults to $ipaddress $monitoring::params::host_groups # comma separates list of host_groups to add this host to $monitoring::params::parents # parent for this host $monitoring::params::host_type # host template to use for this host default is linux_server $monitoring::params::host_alias # alias to set for this host $monitoring::params::check_period # when to check this host $monitoring::params::notification_period # when to send notifications for this host
Extra params for setting up a notify script for sms alerts. I only have a script for clickatell right now so the defaults set that up. Using monitoring class
$monitoring::sms_notify_script_name
# name of the script
# this will get used in contact templates
$monitoring::sms_notify_script_template
# template to use for setting up the script
$monitoring::sms_host_notify_command_args
# args to use for the host notify command
$monitoring::sms_notify_command_args
# args to use for the service notify command
using monitoring::params class $monitoring::params::sms_notify_script_name # name of the script # this will get used in contact templates $monitoring::params::sms_notify_script_template # template to use for setting up the script $monitoring::params::sms_host_notify_command_args # args to use for the host notify command $monitoring::params::sms_notify_command_args # args to use for the service notify command
monitoring::script { "script_name":
ensure => present,
template => undef,
file => undef,
script_type => 'template',
}
installs a script in the $monitoring::params::nagios_extra_plugins
directory
Parameters within monitoring::script
Whether the script should exist or not default is taken from $monitoring::params::ensure
Location of the template
Full puppet location of the file
Type of the script, template or file
monitoring::command { "command_name":
command => "command_to_run",
command_args => '--args',
plugin_type => 'main',
sudo => false,
}
Sets up a command on the monitoring server
Parameters within monitoring::command
Whether the script should exist or not default is taken from $monitoring::params::ensure
Command to run.
Args for the command.
Type of plugin.
Whether to enable sudo for the command This sets up an sudo rule on the node for the user the monitoring server runs as (automagically determined)
monitoring::service { "service_name":
servicegroups => "blah,blah",
check_command => 'command!arg1!arg2',
service_description => 'what it does',
}
Sets up a command on the monitoring server
Parameters within monitoring::command
Whether the script should exist or not default is taken from $monitoring::params::ensure
servicegroups this command belongs to
command to run for the service check
description for the service
service template to use, default is standard_service
defaults to $monitoring::params::notifications
defaults to $monitoring::params::sms_alerts
defaults to admins
sms contats to append to contact_groups
if sms_alerts
is true
whether to register the service with the monitoring server
hostname for the serice to check, defaults to $monitoring::params::host_name
monitoring server for the serice to check, defaults to $monitoring::params::monitoring_server
for overriding the default set in the service template
for overriding the default set in the service template
for overriding the default set in the service template
for overriding the default set in the service template
for overriding the default set in the service template
monitoring::net_device { "router.example.com":
host_ip => "10.10.10.0",
}
Sets up a router to monitor
Parameters within monitoring::net_device
Whether the router should be defined. Defaults to true
ip adress of the router
parent of this router
host groups for the router, defaults to network_hardware
alias for the router, defaults to undef
for overriding the defualt 24x7 timeperiod
ping timout warning value for this router
ping timeout critical value for this router
whether to enable notifications, defaults to true
server that monitors this router, defaults to $monitoring::params::monitoring_server
Uses exported resources to specify which services get monitored on this node
Fedora 18 has some issue with importing the services. I think it is an issue with puppet or ruby itself but not completely sure at this stage. While I would it out you will have to delete the nagios_* files on your monitoring server before importing new resources. There may be others. Don't hesitate to let me know if you find any.
All development, testing and releasing is done by me at this stage. If you wish to join in let me know.
Check the CHANGELOG.md for release notes and bug fixes.