Merge ~xavpaice/charm-nagios:lp1827159 into ~nagios-charmers/charm-nagios:master

Proposed by Xav Paice
Status: Superseded
Proposed branch: ~xavpaice/charm-nagios:lp1827159
Merge into: ~nagios-charmers/charm-nagios:master
Diff against target: 27 lines (+9/-1)
1 file modified
hooks/templates/localhost_nagios2.cfg.tmpl (+9/-1)
Reviewer Review Type Date Requested Status
James Hebden (community) Needs Fixing
Review via email: mp+366740@code.launchpad.net

This proposal has been superseded by a proposal from 2019-05-01.

Commit message

Add custom disk monitor for nagios host

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
James Hebden (ec0) wrote :

Just one comment on the name of the service, but other than that, the technical aspects of the change make sense and LGTM.

review: Needs Fixing

Unmerged commits

ab6f588... by Xav Paice

Add custom disk monitor for nagios host

When monitoring the local Nagios host and it's not in a container, we
use check_all_disks which reports critical when any snap is installed.
This change adds a custom command to the local cfg such that squashfs is
excluded from the check.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/templates/localhost_nagios2.cfg.tmpl b/hooks/templates/localhost_nagios2.cfg.tmpl
2index 3cd69e1..b5a6153 100644
3--- a/hooks/templates/localhost_nagios2.cfg.tmpl
4+++ b/hooks/templates/localhost_nagios2.cfg.tmpl
5@@ -20,6 +20,14 @@ define host{
6 icon_image base/ubuntu.png
7 }
8
9+
10+
11+# 'check_disks_custom' command definition
12+define command{
13+ command_name check_disks_custom
14+ command_line /usr/lib/nagios/plugins/check_disk -w '$ARG1$' -c '$ARG2$' -e -X squashfs
15+ }
16+
17 # Define a service to check the disk space of the root partition
18 # on the local machine. Warning if < 20% free, critical if
19 # < 10% free space on partition.
20@@ -31,7 +39,7 @@ define service{
21 {%- if is_container %}
22 check_command check_disk!20%!10%!/
23 {%- else %}
24- check_command check_all_disks!20%!10%
25+ check_command check_disks_custom!20%!10%
26 {%- endif %}
27 }
28

Subscribers

People subscribed via source and target branches