nut: Configure collectd NUT plugin
infra/cfg/pipeline/head This commit looks good
Details
infra/cfg/pipeline/head This commit looks good
Details
parent
44926c944f
commit
52642d37d9
|
@ -55,3 +55,9 @@ nut: n.#Nut & {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
let _nut = nut
|
||||
|
||||
collectd: nut: n.#CollectdNut & {
|
||||
ups: [for k, v in _nut.ups {k + "@localhost"}]
|
||||
}
|
||||
|
|
|
@ -5,3 +5,5 @@ import (
|
|||
)
|
||||
|
||||
nut: prod.nut
|
||||
|
||||
collectd: prod.collectd
|
||||
|
|
|
@ -4,4 +4,4 @@ import (
|
|||
"du5t1n.me/cfg/schema/app/nut"
|
||||
)
|
||||
|
||||
render: nut.templates
|
||||
render: nut.templates + nut.collectd.templates
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package nut
|
||||
|
||||
#CollectdNut: {
|
||||
ups: [...string]
|
||||
load_plugin: bool | *true
|
||||
}
|
||||
|
||||
collectd: {
|
||||
templates: [
|
||||
{
|
||||
template: "nut/collectd.conf"
|
||||
dest: "/etc/collectd.d/nut.conf"
|
||||
hooks: {
|
||||
changed: [
|
||||
{run: "systemctl try-restart collectd"},
|
||||
]
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{% if collectd.nut.load_plugin -%}
|
||||
LoadPlugin nut
|
||||
{% endif %}
|
||||
<Plugin nut>
|
||||
{%- for ups in collectd.nut.ups %}
|
||||
UPS "{{ ups }}"
|
||||
{%- endfor %}
|
||||
</Plugin>
|
Loading…
Reference in New Issue