Commit ab02d473 authored by Jerome Charaoui's avatar Jerome Charaoui

Fix a few things related to nagios.

* Default nagios service name changed to "backups-${name}"
* Fix checkbackups cronjob command
* Add parameters for checkbackups warn/crit levels
* Update upgrade notice
parent e5e94332
......@@ -55,6 +55,18 @@ You will want to use the following resource:
Otherwise your backups may be duplicated!
Changes to nagios integration
-----------------------------
The default nagios passive service name has changed from "backups" to
"backups-${name}". If you want it to be automatically created on your
nagios host, you will need to set $backupninja::manage_nagios to true.
on the client.
Use the following resource to remove the old "backups" passive service.
nagios::service { 'backups': ensure => absent }
Getting started
---------------
......
......@@ -27,7 +27,8 @@ class backupninja (
$scriptdir = '/usr/share/backupninja',
$libdir = '/usr/lib/backupninja',
$usecolors = true,
$vservers = false
$vservers = false,
$manage_nagios = false,
) {
# install client dependencies
......
......@@ -27,7 +27,7 @@ define backupninja::rdiff(
$vsinclude = false, $keep = 30, $sshoptions = false, $options = '--force', $ssh_dir_manage = true,
$ssh_dir = "${home}/.ssh", $authorized_keys_file = 'authorized_keys', $installuser = true, $keymanage = $backupninja::keymanage, $key = false,
$backuptag = "backupninja-${::fqdn}", $backupkeytype = $backupninja::keytype, $backupkeystore = $backupninja::keystore,
$extras = false, $nagios_description = 'backups')
$extras = false, $nagios_description = "backups-${name}")
{
# install client dependencies
ensure_resource('package', 'rdiff-backup', {'ensure' => $backupninja::ensure_rdiffbackup_version})
......
......@@ -7,7 +7,7 @@ define backupninja::rsync(
$ssh_dir_manage = true, $ssh_dir = "${home}/.ssh", $authorized_keys_file = 'authorized_keys',
$installuser = true, $keymanage = $backupninja::keymanage, $key = false, $backuptag = "backupninja-${::fqdn}",
$backupkeytype = $backupninja::keytype, $backupkeystore = $backupninja::keystore, $extras = false,
$nagios_description = 'backups', $subfolder = 'rsync',
$nagios_description = "backups-${name}", $subfolder = 'rsync',
$log = false, $partition = false, $fscheck = false, $read_only = false,
$mountpoint = false, $backupdir = false, $format = false, $days = false,
......
......@@ -9,7 +9,9 @@ class backupninja::server (
$backupdir = '/backup',
$backupdir_ensure = 'directory',
$manage_nagios = false,
$nagios_server = undef
$nagios_server = undef,
$nagios_warn_level = 129600,
$nagios_crit_level = 216000,
) {
group { "backupninjas":
......@@ -28,9 +30,7 @@ class backupninja::server (
if $manage_nagios {
if $nagios_server == undef {
fail('Cannot manage nagios with undefined nagios_server parameter!')
}
case $nagios_server { undef: { err('Cannot manage nagios without nagios_server parameter!') } }
include nagios::nsca::client
......@@ -41,7 +41,7 @@ class backupninja::server (
}
cron { checkbackups:
command => "/usr/local/bin/checkbackups -d $backupdir | /usr/sbin/send_nsca -H $nagios_server -c /etc/send_nsca.cfg | grep -v 'sent to host successfully'",
command => "/usr/local/bin/checkbackups -d ${backupdir} -s ${nagios_server} -w ${nagios_warn_level} -c ${nagios_crit_level} | grep -v 'sent to host successfully",
user => "root",
hour => "8-23",
minute => 59,
......@@ -60,7 +60,7 @@ class backupninja::server (
$gid = "backupninjas", $backuptag = "backupninja-${::fqdn}", $nagios_description = 'backups')
{
if $manage_nagios {
if $backupninja::manage_nagios {
# configure a passive service check for backups
nagios::service::passive { $nagios_description: }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment