You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-12-21 13:41:50 +00:00 (in Redmine)
Backport?: Not yet backported
Include in Changelog: 1
I think there would be some advantages from collecting also community provided global functions in the ITL (like plugins-contrib.d/global-functions).
An example for time dependend thresholds without function:
apply Service "Disk - " for (disk in host.vars.disks) {
check_command = "disk"
vars.disk_partition = disk
vars.disk_wfree = {{
if (get_time_period("backup").is_inside) {
return "85%"
} else {
return "97%"
}
}}
vars.disk_cfree = {{
if (get_time_period("backup").is_inside) {
return "95%"
} else {
return "99%"
}
}}
}
And with function:
globals.timedependend_value = function(timeperiod, inside, outside) {
if (get_time_period(timeperiod).is_inside) {
return inside
} else {
return outside
}
}
apply Service "Disk - " for (disk in host.vars.disks) {
check_command = "disk"
vars.disk_partition = disk
vars.disk_wfree = {{ timedependend_value("backup","97%","85%") }}
vars.disk_cfree = {{ timedependend_value("backup","99%","95%") }}
}
Would do you think about the idea? If you like it, how should documentation for this look like (inline and markdown) and what type of functions should be included?
The text was updated successfully, but these errors were encountered:
This issue has been migrated from Redmine: https://dev.icinga.com/issues/13717
Created by dgoetz on 2016-12-21 13:41:50 +00:00
Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-12-21 13:41:50 +00:00 (in Redmine)
I think there would be some advantages from collecting also community provided global functions in the ITL (like plugins-contrib.d/global-functions).
An example for time dependend thresholds without function:
And with function:
Would do you think about the idea? If you like it, how should documentation for this look like (inline and markdown) and what type of functions should be included?
The text was updated successfully, but these errors were encountered: