Merge ~paulgear/charm-nrpe/+git/nrpe-charm:master into ~nrpe-charmers/charm-nrpe:master

Proposed by Paul Gear
Status: Merged
Approved by: Haw Loeung
Approved revision: 1e902f9d1c9a25f4b8f4956189569c61aa0a8e7e
Merged at revision: 59d13d70d78ce2e9b2392ad51929de0f91811781
Proposed branch: ~paulgear/charm-nrpe/+git/nrpe-charm:master
Merge into: ~nrpe-charmers/charm-nrpe:master
Diff against target: 52 lines (+16/-6)
2 files modified
files/plugins/check_conntrack.sh (+10/-2)
hooks/nrpe_helpers.py (+6/-4)
Reviewer Review Type Date Requested Status
Haw Loeung Approve
Review via email: mp+322170@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM, +1

review: Approve
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/files/plugins/check_conntrack.sh b/files/plugins/check_conntrack.sh
index 0cfaf28..1f08075 100755
--- a/files/plugins/check_conntrack.sh
+++ b/files/plugins/check_conntrack.sh
@@ -20,8 +20,16 @@ if ! lsmod | grep -q conntrack; then
20 exit $STATE_OK20 exit $STATE_OK
21fi21fi
2222
23max=$(sysctl net.netfilter.nf_conntrack_max | awk '{ print $3 }')23max=$(sysctl net.netfilter.nf_conntrack_max 2>/dev/null | awk '{ print $3 }')
24current=$(sysctl net.netfilter.nf_conntrack_count | awk '{ print $3 }')24if [ -z "$max" ]; then
25 echo "UNKNOWN: unable to retrieve value of net.netfilter.nf_conntrack_max"
26 exit $STATE_UNKNOWN
27fi
28current=$(sysctl net.netfilter.nf_conntrack_count 2>/dev/null | awk '{ print $3 }')
29if [ -z "$current" ]; then
30 echo "UNKNOWN: unable to retrieve value of net.netfilter.nf_conntrack_count"
31 exit $STATE_UNKNOWN
32fi
2533
26# default thresholds34# default thresholds
27crit=9035crit=90
diff --git a/hooks/nrpe_helpers.py b/hooks/nrpe_helpers.py
index 90a6f8e..d96b0a8 100644
--- a/hooks/nrpe_helpers.py
+++ b/hooks/nrpe_helpers.py
@@ -250,11 +250,11 @@ class SubordinateCheckDefinitions(dict):
250250
251 if hookenv.config('load') == 'auto':251 if hookenv.config('load') == 'auto':
252 # Give 1min load alerts higher thresholds than 15 min load alerts252 # Give 1min load alerts higher thresholds than 15 min load alerts
253 warn_multipliers = (4,2,1)253 warn_multipliers = (4, 2, 1)
254 crit_multipliers = (8,4,2)254 crit_multipliers = (8, 4, 2)
255 load_thresholds = ('-w %s -c %s') \255 load_thresholds = ('-w %s -c %s') \
256 % (','.join([str(m*procs) for m in warn_multipliers]),256 % (','.join([str(m * procs) for m in warn_multipliers]),
257 ','.join([str(m*procs) for m in crit_multipliers]))257 ','.join([str(m * procs) for m in crit_multipliers]))
258 else:258 else:
259 load_thresholds = hookenv.config('load')259 load_thresholds = hookenv.config('load')
260260
@@ -313,6 +313,8 @@ class SubordinateCheckDefinitions(dict):
313 self['checks'] = []313 self['checks'] = []
314 sub_postfix = str(hookenv.config("sub_postfix"))314 sub_postfix = str(hookenv.config("sub_postfix"))
315 for check in checks:315 for check in checks:
316 if check['cmd_params'] == "":
317 continue
316 check['description'] += " (sub)"318 check['description'] += " (sub)"
317 check['cmd_name'] += sub_postfix319 check['cmd_name'] += sub_postfix
318 self['checks'].append(check)320 self['checks'].append(check)

Subscribers

People subscribed via source and target branches