fan-monitor: Capture more data on failure

When a fan gets set to nonfunctional, it is useful
to know how fast the rotor was actually going and
what the expected speed was.

Change-Id: I760d6fa7d193038f9740d241bf4d4d0039020f64
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index 195317c..f3937c2 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -187,7 +187,10 @@
     if (_functional && tooManySensorsNonfunctional())
     {
         log<level::ERR>("Setting a fan to nonfunctional",
-                        entry("FAN=%s", _name.c_str()));
+                entry("FAN=%s", _name.c_str()),
+                entry("TACH_SENSOR=%s", sensor.name().c_str()),
+                entry("ACTUAL_SPEED=%lld", sensor.getInput()),
+                entry("TARGET_SPEED=%lld", getTargetSpeed(sensor)));
 
         updateInventory(false);
     }
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 84e02fe..d564f73 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -111,6 +111,14 @@
          */
         std::chrono::microseconds getTimeout();
 
+        /**
+         * Returns the sensor name
+         */
+        inline const std::string& name() const
+        {
+            return _name;
+        };
+
     private:
 
         /**