summaryrefslogtreecommitdiffstats
path: root/monitor/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Switch sd_event loops to sdeventplusWilliam A. Kennington III2018-10-291-25/+5
| | | | | | | | | This change is mostly focused around plumbing the sdeventplus::Event object everywhere and using the member functions provided for the event. No migration to the timer utility is performed yet. Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87 Signed-off-by: William A. Kennington III <wak@google.com>
* Fix exit status codesWilliam A. Kennington III2018-10-191-4/+4
| | | | | | | | | | Using an exit status of -1 everywhere leads to the status being converted to 255 when output to a calling application. While this does signify an error it has a reserved meaning for exit status out of range. Lets use a valid general exit status of 1 instead. Change-Id: I326701c78985e34c430c258fe31d9e910da10405 Signed-off-by: William A. Kennington III <wak@google.com>
* Support optional conditions on creating fansMatthew Barth2018-05-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the functional infrastructure to optionally attach a condition function to a fan definition. When a condition is defined on a fan, it must be true for a fan's associated functional properties to be created. When the given condition fails, that fan's functional properties will not be created by fan monitor. A fan without a defined condition will have all of its associated functional properties created. Example of generated condition (generation commit to follow): make_condition(condition::propertiesMatch( std::vector<PropertyState>{ PropertyState{ PropertyIdentity{ "/xyz/openbmc_project/inventory/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", "WaterCooled" }, static_cast<bool>(false) } } )), Tested: Fan functional properties are not created when a condition fails Fan functional properties are created when condition passes Fan functional properties are created when no condition exists Change-Id: I9ced2e520d2f97e6655c9417970b3e976d78fef4 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* monitor: Start checking tach trustMatt Spinler2017-10-111-1/+6
| | | | | | | | | The Fan class now uses the trust::Manager class to ask if a sensor value is trusted before analyzing its value against the upper and lower limits. Change-Id: I81dd468877873ba84753d76395b4a59129824c0b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Create fan monitor init modeMatthew Barth2017-08-231-14/+35
| | | | | | | | | | | | | Allowing fan monitor to run in an init mode will set the fans to a functional state at each poweron for fans that were non-functional at poweroff. Then fan monitor can be started in monitor mode after the fans have ramped up to full speed and can begin being monitored for faults. This also allows for the removal of fan monitor doing a sd_notify prior to fan control starting. Change-Id: I634c9b4ec8bb30860dea54c8abd1cd6c56831d25 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* fan-monitor: use sd_notify(READY=1)Matt Spinler2017-06-261-0/+10
| | | | | | | | | | | | | After the fans have initialized their Functional inventory property, send systemd the READY notification. If the service which runs this application is of type = notify, then systemd will hold off starting any dependent services until this is sent. In our case, we want phosphor-fan-control --control to not be started until this notification is done. Change-Id: Iec87418ce308aa9ca81a47c20039ade7e8fe66c3 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Move Fan objects back to heapMatt Spinler2017-05-121-2/+2
| | | | | | | | Turns out that with the objects on the stack, some of them were corrupt in the callbacks. Change-Id: Ifd4179839d4e05fdb1f05e417093cb14cec3addc Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Use unique_ptr for sd_event object wrapperMatt Spinler2017-05-111-8/+4
| | | | | | | | Convert the sd_event object wrapper from a shared_ptr to a unique_ptr. Requires a new header file. Change-Id: I868a9e88ed93878c2e0bb12e58f8d3a604510da0 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fill in main() functionMatt Spinler2017-05-111-1/+43
| | | | | | | Create the Fan objects, and start the dbus/event loop. Change-Id: I7c6a60bb5d2c20578b529e7e5f3dc13f50e55dd7 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* phosphor-fan-monitor frameworkMatt Spinler2017-05-111-0/+21
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 <spinler@us.ibm.com>
OpenPOWER on IntegriCloud