manual:config:triggers:prediction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:config:triggers:prediction [2015/10/09 14:52]
glebs.ivanovskis added examples of error handling
manual:config:triggers:prediction [2018/10/01 09:42] (current)
Line 1: Line 1:
-==== Predictive trigger functions ====+==== Predictive trigger functions ====
  
 === Overview === === Overview ===
Line 27: Line 27:
 (**timeleft** only)\\ Parameter ''​threshold''​ specifies a value the analysed item has to reach, no difference if from above or from below. Once we have determined f(t) (see below) we should solve equation f(t) = ''​threshold''​ and return the root which is closer to now and to the right from now or 999999999999.9999 if there is no such root. (**timeleft** only)\\ Parameter ''​threshold''​ specifies a value the analysed item has to reach, no difference if from above or from below. Once we have determined f(t) (see below) we should solve equation f(t) = ''​threshold''​ and return the root which is closer to now and to the right from now or 999999999999.9999 if there is no such root.
  
 +<note tip>When item values approach the threshold and then cross it, **timeleft** assumes that intersection is already in the past and therefore switches to the next intersection with ''​threshold''​ level, if any. Best practice should be to use predictions as a complement to ordinary problem diagnostics,​ not as a substitution.((For example, a simple trigger like <​code>​{host:​item.timeleft(1h,,​X)} < 1h</​code>​ may go into problem state when the item value approaches X and then suddenly recover once value X is reached. If the problem is item value being below X use: <​code>​{host:​item.last()} < X or {host:​item.timeleft(1h,,​X)} < 1h</​code>​ If the problem is item value being above X use: <​code>​{host:​item.last()} > X or {host:​item.timeleft(1h,,​X)} < 1h</​code>​))</​note>​
 == - Fit functions == == - Fit functions ==
  
Line 64: Line 65:
 )). )).
  
-Note: No warnings or errors are flagged if chosen fit poorly describes provided data or there is just too few data for accurate prediction.+<note tip>No warnings or errors are flagged if chosen fit poorly describes provided data or there is just too few data for accurate prediction.</​note>​
  
 === - Examples and dealing with errors === === - Examples and dealing with errors ===
Line 71: Line 72:
 <​code>​{host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<​1h</​code>​ <​code>​{host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<​1h</​code>​
  
-However, error code -1 may come into play and put your trigger in a problem state. Generally it's good because you get a warning that your predictions don't work correctly and you should look at them more thoroughly to find out why. But sometimes it's bad because -1 can simply mean that there was no data about the host free disk space obtained in the last hour. If you are getting too much false positive alerts consider using more complicated trigger expression:+However, error code -1 may come into play and put your trigger in a problem state. Generally it's good because you get a warning that your predictions don't work correctly and you should look at them more thoroughly to find out why. But sometimes it's bad because -1 can simply mean that there was no data about the host free disk space obtained in the last hour. If you are getting too many false positive alerts consider using more complicated trigger expression((But in this case -1 can cause your trigger to recover from the problem state. To be fully protected use: <​code>​{host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<​1h and ({TRIGGER.VALUE}=0 and {host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<>​-1 or {TRIGGER.VALUE}=1)</​code>​)):
 <​code>​{host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<​1h and {host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<>​-1</​code>​ <​code>​{host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<​1h and {host:​vfs.fs.size[/,​free].timeleft(1h,,​0)}<>​-1</​code>​