diff options
author | varac <varacanero@zeromail.org> | 2015-04-17 19:45:31 +0000 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2015-04-17 19:45:31 +0000 |
commit | 9930649228a509eda998699e213ed458685763f0 (patch) | |
tree | 6924b541a294483ee8e6bfa6a196ca96e31dacfd /manifests/ps.pp | |
parent | 35d358a4cdf90b3cdc90904ca82b160e9c4376ac (diff) | |
parent | 4ced0c5bbe605c322dc4103c3572ae18e69fa278 (diff) |
Merge branch 'Dec2014merge' into 'master'
riseup Dec2014merge
riseup changes from the last few months, rebased to be easier to deal with.
adds:
* mrpe support (to replace nrpe)
* ps support (to replace statd)
* storing ssh keys in an alternate location
* update docs
* some bug fixes
See merge request !2
Diffstat (limited to 'manifests/ps.pp')
-rw-r--r-- | manifests/ps.pp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/manifests/ps.pp b/manifests/ps.pp new file mode 100644 index 0000000..1171a13 --- /dev/null +++ b/manifests/ps.pp @@ -0,0 +1,34 @@ +define check_mk::ps ( + $target, + $host, + $desc, + $procname = "/usr/sbin/${desc}", + $levels = '1, 1, 1, 1', + $user = undef +) { + # This class is called on check-mk agent machines in order to create + # checks using the built-in ps check type. They create stored configs + # and then the check_mk::server::collect_ps class on the server + # generates the config file to set them up + + # lines in the ps.mk config file look like + # ( "foo.example.com", "ps", "NAME", ( "/usr/sbin/foo", 1, 1, 1, 1 ) ) + # or with a user + # ( "foo.example.com", "ps", "NAME", ( "/usr/sbin/foo", "user", 1, 1, 1, 1 ) ) + if $user { + $check = " ( \"${host}\", \"ps\", \"${desc}\", ( \"${procname}\", ${user}, ${levels} ) ),\n" + } else { + $check = " ( \"${host}\", \"ps\", \"${desc}\", ( \"${procname}\", ${levels} ) ),\n" + } + + # FIXME: we could be smarter about this and consolidate host checks + # that have identical settings and that would make the config file + # make more sense for humans. but for now we'll just do separate + # lines (which may result in a very large file, but check-mk is fine) + concat::fragment { "check_mk_ps-${host}_${desc}": + target => $target, + content => $check, + order => 20 + } +} + |