summaryrefslogtreecommitdiffstats
path: root/monitor
diff options
context:
space:
mode:
Diffstat (limited to 'monitor')
-rw-r--r--monitor/Makefile.am8
-rw-r--r--monitor/example/monitor.yaml35
-rw-r--r--monitor/generated.cpp54
3 files changed, 42 insertions, 55 deletions
diff --git a/monitor/Makefile.am b/monitor/Makefile.am
index 6c6f4b3..f54248e 100644
--- a/monitor/Makefile.am
+++ b/monitor/Makefile.am
@@ -6,10 +6,14 @@ sbin_PROGRAMS = \
phosphor_fan_monitor_SOURCES = \
fan.cpp \
- generated.cpp \
main.cpp \
tach_sensor.cpp
+nodist_phosphor_fan_monitor_SOURCES = \
+ fan_monitor_defs.cpp
+
+BUILT_SOURCES = fan_monitor_defs.cpp
+
phosphor_fan_monitor_LDADD = \
$(top_builddir)/libfan.la \
$(SDBUSPLUS_LIBS) \
@@ -19,3 +23,5 @@ phosphor_fan_monitor_CXXFLAGS = \
$(SDBUSPLUS_CFLAGS) \
$(PHOSPHOR_LOGGING_CFLAGS)
+fan_monitor_defs.cpp: ${srcdir}/gen-fan-monitor-defs.py
+ $(AM_V_GEN)$(GEN_FAN_MONITOR_DEFS)
diff --git a/monitor/example/monitor.yaml b/monitor/example/monitor.yaml
new file mode 100644
index 0000000..b3dd306
--- /dev/null
+++ b/monitor/example/monitor.yaml
@@ -0,0 +1,35 @@
+#Example fan monitor definitions for phosphor-fan-monitor
+
+#List the fans that need to be monitored, along with some
+#properties that define how much slack is allowed in the actual
+#tach value as compared to the target tach value.
+
+#- inventory:
+# [The system inventory location for the fan]
+# allowed_out_of_range_time:
+# [Time (in secs) actual speed can be outside of deviation of
+# target speed]
+# deviation:
+# [Percentage that actual speed must be within target speed]
+# num_sensors_nonfunc_for_fan_nonfunc:
+# [How many sensors on the fan must be faulted before fan
+# will be considered faulted]
+# sensors: [array of speed sensors for the fan]
+# - name [The name of the fan sensor]
+# has_target [true|false If this sensor has a Target property for
+# setting a fan speed (otherwise just for reads)]
+
+#The code uses these parameters as follows:
+# After a speed reading of a sensor is outside of the allowed deviation of
+# the target speed for the allowed out of range time, if at least
+# num_sensors_nonfunc_for_fan_nonfunc sensors meet this condition,
+# the fan will be set to nonfunctional in the inventory.
+
+#Example entries for 1 fan system:
+# - inventory: /system/chassis/motherboard/fan0
+# allowed_out_of_range_time: 15
+# deviation: 15
+# num_sensors_nonfunc_for_fan_nonfunc: 1
+# sensors:
+# - name: fan0
+# has_target: true
diff --git a/monitor/generated.cpp b/monitor/generated.cpp
deleted file mode 100644
index 7578b92..0000000
--- a/monitor/generated.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright © 2017 IBM Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "fan_defs.hpp"
-#include "types.hpp"
-
-//This file will be replaced by a generated version in a later commit
-
-using namespace phosphor::fan::monitor;
-
-const std::vector<FanDefinition> fanDefinitions
-{
-
- FanDefinition{"/system/chassis/motherboard/fan0",
- 15,
- 15,
- 1,
- std::vector<SensorDefinition>{
- SensorDefinition{"fan0", true}
- }},
- FanDefinition{"/system/chassis/motherboard/fan1",
- 15,
- 15,
- 1,
- std::vector<SensorDefinition>{
- SensorDefinition{"fan1", true}
- }},
- FanDefinition{"/system/chassis/motherboard/fan2",
- 15,
- 15,
- 1,
- std::vector<SensorDefinition>{
- SensorDefinition{"fan2", true}
- }},
- FanDefinition{"/system/chassis/motherboard/fan3",
- 15,
- 15,
- 1,
- std::vector<SensorDefinition>{
- SensorDefinition{"fan3", true}
- }}
-};
OpenPOWER on IntegriCloud