From e567dd24a8d943b4655ed2db74ce3639b05652bc Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Thu, 27 Apr 2017 12:27:17 -0500 Subject: phosphor-fan-monitor framework This application will monitor the actual speeds of fans (via their sensors) and compare them to their expected speeds. If a fan is too slow for too long, it will have its Functional property in the inventory set to false. If it starts working again, the property will be set back to true. It will use configuration data to say which fans to check and which values to use for various timeout and deviation parameters. Change-Id: Ic61613018a758727835b70f2df0ecd1bf12e8256 Signed-off-by: Matt Spinler --- .gitignore | 2 ++ Makefile.am | 3 +++ configure.ac | 4 ++++ monitor/Makefile.am | 17 +++++++++++++++++ monitor/main.cpp | 21 +++++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 monitor/Makefile.am create mode 100644 monitor/main.cpp diff --git a/.gitignore b/.gitignore index b49549b..8766eea 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ fan_detect_defs.cpp phosphor-fan-presence-tach phosphor-fan-control fan_zone_defs.cpp +phosphor-fan-monitor +phosphor-cooling-type diff --git a/Makefile.am b/Makefile.am index e118816..443dab7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,3 +21,6 @@ endif if WANT_COOLING_TYPE SUBDIRS += chassis-cooling-type endif +if WANT_MONITOR +SUBDIRS += monitor +endif diff --git a/configure.ac b/configure.ac index 1b6df27..eb6e086 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ AC_ARG_ENABLE([cooling-type], AM_CONDITIONAL([WANT_PRESENCE], [test "x$enable_presence" != "xno"]) AM_CONDITIONAL([WANT_CONTROL], [test "x$enable_control" != "xno"]) AM_CONDITIONAL([WANT_COOLING_TYPE], [test "x$enable_cooling-type" != "xno"]) +AM_CONDITIONAL([WANT_MONITOR], [test "x$enable_monitor" != "xno"]) # Package specific checks. AS_IF([test "x$enable_presence" != "xno"], [ @@ -113,6 +114,9 @@ AS_IF([test "x$enable_cooling-type" != "xno"], [ [AC_MSG_ERROR([The libevdev package is required])]) AC_CONFIG_FILES([chassis-cooling-type/Makefile]) ]) +AS_IF([test "x$enable_monitor" != "xno"], [ + AC_CONFIG_FILES([monitor/Makefile]) +]) # Create configured output AC_CONFIG_FILES([Makefile test/Makefile]) diff --git a/monitor/Makefile.am b/monitor/Makefile.am new file mode 100644 index 0000000..44458bd --- /dev/null +++ b/monitor/Makefile.am @@ -0,0 +1,17 @@ +AM_DEFAULT_SOURCE_EXT = .cpp +AM_CPPFLAGS = -iquote ${top_srcdir} + +sbin_PROGRAMS = \ + phosphor-fan-monitor + +phosphor_fan_monitor_SOURCES = \ + main.cpp + +phosphor_fan_monitor_LDADD = \ + $(SDBUSPLUS_LIBS) \ + $(PHOSPHOR_LOGGING_LIBS) + +phosphor_fan_monitor_CXXFLAGS = \ + $(SDBUSPLUS_CFLAGS) \ + $(PHOSPHOR_LOGGING_CFLAGS) + diff --git a/monitor/main.cpp b/monitor/main.cpp new file mode 100644 index 0000000..e468bac --- /dev/null +++ b/monitor/main.cpp @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +int main() +{ + return 0; +} -- cgit v1.2.1