.. _enable_health_monitoring:

Enable Health Monitoring
------------------------


.. index:: notify;notify emailrelay
.. index:: notify;notify emailfrom
.. index:: schedule; schedule add
.. index:: schedule; schedule time


.. _12.5(1)|DOC-155:
.. _19.1|DOC-155:
.. _21.3-PB3|EKB-11716:
.. _21.4-PB2|EKB-14391:


.. note::
  
     If this configuration is carried out, it should be set on each node.
  
     Typically, each node will be configured with its own sender email address
     to identify the source node (for example ``unified_node_1@customer.domain``).
                                                                                                                                                                 
     Additionally, 
     
     * nodes can be configured with different emailrelay servers, for example,
       according to data center
     * nodes can be configured with different SNMP servers and error levels  
  

The steps below are to enable health monitoring
if the system status displays ``HEALTH: NOT MONITORED`` upon login or when typing **help**.

1. Add an email relay address for outgoing email: add the SMTP IP address and optionally
   an allowed port (default port is 25):

   **notify emailrelay <smtp ip address>[:port]**

   For example:

   ::

      platform@host:~$ notify emailrelay 192.29.42.30
      emailrelay: 192.29.42.30


   The email relay can be verified with:

   **notify emailrelay**

   To disable or remove an external email relay or set the email relay back to default,
   use the following command:

   **notify emailrelay 127.0.0.1**


   The default ``from`` address is ``platform@<hostname>``. 
   
   A ``from`` outgoing address for the email relay can also be configured:
   
   **notify emailfrom <from: email address>**
   
   For example:
   
   ::
     
      notify emailfrom person@valid.domain

   Use the command **notify emailfrom** to list the currently configured ``from`` outgoing address.



2. Add a schedule instance for health reporting, for example with a schedule name ``reports``:

   **schedule add reports log send output mailto:user@server.com diag health**


   For example:

   ::

      $ schedule add reports log send output mailto:user@server.com diag health

        Automatically setting time to midnight and enabling

        reports: 
        active: true
        command: log send output mailto:user@server.com diag health --force
        hour: 0
        min: 0

   Typing **help** at the command line will now *not* show the ``HEALTH: NOT MONITORED`` message.
   
   The schedule instance can be modified, for example weekly on Sunday:

   **schedule time reports weekly 0**
