fault-monitor: Add OperationalStatus Functional monitoring

Currently, the default way is to update the Asserted property of
the LedManager by monitoring the `/xyz/openbmc_project/logging`
object path.

The intent behind this commit is to add another way to monitor the
`xyz.openbmc_project.State.Decorator.OperationalStatus` interface
of the Inventory D-Bus object, and check whether the Inventory
D-Bus object is associated with the LED group D-Bus object, and
then update the Asserted property of the LedManager.

Since both these methods handle the faults differently,
Only ONE of these 2 methods can be enabled and NOT both.

The first way is supported by default. To turn OFF the default way
AND turn ON this second way, Enable monitor-operational-status.

Tested:
- enable `monitor-operational-status` in bbappend file, built successfully.

- Before changing the `OperationalStatus` interface:
  busctl get-property xyz.openbmc_project.Inventory.Manager
  /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
  xyz.openbmc_project.State.Decorator.OperationalStatus Functional
  b true

  busctl get-property xyz.openbmc_project.LED.GroupManager
  /xyz/openbmc_project/led/groups/powersupply1_fault
  xyz.openbmc_project.Led.Group Asserted
  b false

  busctl get-property xyz.openbmc_project.LED.Controller.front_psu
  /xyz/openbmc_project/led/physical/front_psu xyz.openbmc_project.Led.Physical State
  s "xyz.openbmc_project.Led.Physical.Action.Off"

- After changing the `OperationalStatus` interface:
  busctl set-property xyz.openbmc_project.Inventory.
  /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
  xyz.openbmc_project.State.Decorator.OperationalStatus Functional b false

  busctl get-property xyz.openbmc_project.Inventory.Manager
  /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
  xyz.openbmc_project.State.Decorator.OperationalStatus Functional
  b false

  (
	If we have more than 1 LED Group D-Bus object:
	Like: The system/chassis/motherboard/powersupply1 path contains
	      two sets of LEDGroup
	{
        "types":
        {
            "rType": "fru",
            "fType": "fault_led_group"
        },
        "paths":
        [
            "/xyz/openbmc_project/led/groups/powersupply0_fault",
            "/xyz/openbmc_project/led/groups/powersupply1_fault"
        ]
    }
  busctl get-property xyz.openbmc_project.LED.GroupManager
  /xyz/openbmc_project/led/groups/powersupply0_fault xyz.openbmc_project.Led.Group Asserted
  b true
  )

  busctl get-property xyz.openbmc_project.LED.GroupManager
  /xyz/openbmc_project/led/groups/powersupply1_fault xyz.openbmc_project.Led.Group Asserted
  b true

  busctl get-property xyz.openbmc_project.LED.Controller.front_psu
  /xyz/openbmc_project/led/physical/front_psu xyz.openbmc_project.Led.Physical State
  s "xyz.openbmc_project.Led.Physical.Action.Blink"

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I36c47198168028ea2b55804cf66d0285847afbd4
diff --git a/configure.ac b/configure.ac
index 4a50e38..f76cdb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,6 +84,14 @@
     AC_DEFINE([LED_USE_JSON],[],[Enable JSON configuration.])
 )
 
+# enable OperationalStatus monitor
+AC_ARG_ENABLE([monitor-operational-status],
+    AS_HELP_STRING([--enable-monitor-operational-status], [Enable OperationalStatus monitor.]))
+AM_CONDITIONAL([WANTS_OPERATIONAL_STATUS], [test "x$enable_monitor_operational_status" == "xyes"])
+AS_IF([test "x$enable_monitor_operational_status" == "xyes"],
+    AC_DEFINE([MONITOR_OPERATIONAL_STATUS],[],[Enable OperationalStatus monitor.])
+)
+
 # enable lamp test configuration
 AC_ARG_ENABLE([use-lamp-test],
     AS_HELP_STRING([--enable-use-lamp-test], [Enable lamp test configuration.]))