examples: lang: Update examples to fix imports and port from yaml

Some small fixes that are useful for demos!
This commit is contained in:
James Shubin
2019-02-01 03:47:18 -05:00
parent 5d0efce278
commit 78936c5ce8
4 changed files with 52 additions and 2 deletions

View File

@@ -1,10 +1,12 @@
import "sys"
file "/tmp/mgmt/systemload" {
content => template("load average: {{ .load }} threshold: {{ .threshold }}\n", $tmplvalues),
}
$tmplvalues = struct{load => $theload, threshold => $threshold,}
$theload = structlookup(load(), "x1")
$theload = structlookup(sys.load(), "x1")
$threshold = 1.5 # change me if you like
# simple hysteresis implementation