examples: lang: Update examples to fix imports and port from yaml
Some small fixes that are useful for demos!
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user