Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,34 @@ To enable nagiosgraph for the client's services in the server web interface :
class { '::nagios::client':
service_use => 'generic-service,nagiosgraph-service',
}
```

To override the parameters of a default template using hiera :

```yaml
---
# Remove default warning notifications for services
nagios::server::template_generic_service:
notification_options: 'u,c,r'
```
### Log archive retention

Set `log_archives_retention_days` to automatically delete archives in
`/var/log/nagios/archives` older than the specified number of days
(default: keep everything).

Example:

```puppet
class { '::nagios::server':
log_archives_retention_days => 365,
}
```

Hiera:

```yaml
nagios::server::log_archives_retention_days: 365
```

## Hints

Expand Down
11 changes: 11 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
$plugin_redis_sentinel = false,
$selinux = true,
$check_for_updates = true,
Optional[Integer] $log_archives_mtime = undef,
# Original template entries
$template_generic_contact = {},
$template_generic_host = {},
Expand Down Expand Up @@ -1340,4 +1341,14 @@
}
}

# When $log_archives_mtime we configure the prune job
if $log_archives_mtime {
cron { 'nagios-archives-prune':
ensure => present,
user => 'nagios',
minute => '15',
hour => '3',
command => "/usr/bin/find /var/log/nagios/archives -type f -name 'nagios-*.log*' -mtime +${log_archives_mtime} -delete",
}
}
}