1# method
2
3## Description
4The method to use in monitoring a fan's functional state. One method can be
5configured per fan and each supported method requires its own set of attributes
6to be provided.
7
8## Attribute Value(s)
9Methods:
10* ["timebased"](#timebased) - Default
11* ["count"](#count)
12
13### "timebased"
14Uses timers for determining when a fan's sensor should be marked nonfunctional
15or functional after its been in that state for that continuous amount of time.
16Separate timers are used to transition a fan from functional to
17nonfunctional(`allowed_out_of_range_time`) and nonfunctional to
18functional(`functional_delay`).
19
20* `allowed_out_of_range_time` - Time(in seconds) that each fan sensor is
21allowed to be calculated out of range of a current target before being marked
22nonfunctional.
23* `functional_delay` - Optional, default = 0
24  * Time(in seconds) that each fan sensor must be calculated within range of a
25  current target before being marked functional.
26
27```
28"method": "timebased",
29"allowed_out_of_range_time": 30,
30"functional_delay": 5
31```
32**Note: Since this method is the default, simply providing
33`allowed_out_of_range_time` and `functional_delay` attributes will result in
34this method being used.**
35* This is equivalent to above:
36  ```
37  "allowed_out_of_range_time": 30,
38  "functional_delay": 5
39  ```
40
41### "count"
42An up/down counter for determining when a fan's sensor should be marked
43nonfunctional based on a `threshold` or functional when the counter = 0. Each
44fan sensor update where its feedback speed is calculated out of range of the
45current target increments the counter by 1. Once the counter reaches the
46`threshold`, the fan is marked nonfunctional. However, at any point the
47sensor's feedback speed is within range, the counter is decremented by 1.
48Therefore the fan's sensor(s) do not have to continuously be in a faulted state
49to be marked nonfunctional and instead is deemed nonfunctional once it
50accumulates the `threshold` number of times deemed out of range. The same is
51true for a nonfunctional fan sensor to become functional, where the counter
52must accumulate enough times deemed within range to decrement the counter to 0.
53This checking occurs at an interval dictated by the `count_interval` field.
54
55* `threshold` - Number of total times a fan sensor must be calculated out of
56range before being marked nonfunctional.
57
58* `count_interval` - The interval, in seconds, to check the feedback speed and
59  increment/decrement the counter.  Defaults to 1s if not present.
60
61```
62"method": "count",
63"count_interval": 5,
64"sensors": [
65  {
66    "threshold": 30
67  }
68]
69```
70
71## Example
72<pre><code>
73{
74  "fans": [
75    {
76      "inventory": "/system/chassis/motherboard/fan0",
77      <b><i>"allowed_out_of_range_time": 30,
78      "functional_delay": 5</i></b>,
79      "deviation": 15,
80      "num_sensors_nonfunc_for_fan_nonfunc": 1,
81      "monitor_start_delay": 30,
82      "fan_missing_error_delay": 20,
83      "nonfunc_rotor_error_delay": 0,
84      "sensors": [
85        {
86          "name": "fan0_0",
87          "has_target": true
88        },
89        {
90          "name": "fan0_1",
91          "has_target": false,
92          "factor": 1.45,
93          "offset": -909
94        }
95      ]
96    },
97    {
98      "inventory": "/system/chassis/motherboard/fan1",
99      <b><i>"method": "count",
100      "count_interval": 1</i></b>,
101      "deviation": 15,
102      "num_sensors_nonfunc_for_fan_nonfunc": 1,
103      "monitor_start_delay": 30,
104      "fan_missing_error_delay": 20,
105      "nonfunc_rotor_error_delay": 0,
106      "sensors": [
107        {
108          "name": "fan0_0",
109          "has_target": true,
110          <b><i>"threshold": 30</i></b>
111        },
112        {
113          "name": "fan0_1",
114          "has_target": false,
115          "factor": 1.45,
116          "offset": -909,
117          <b><i>"threshold": 30</i></b>
118        }
119      ]
120    }
121  ]
122}
123</code></pre>
124