PostHealthState

Is a prototype for a function that updates the health of a component.

Syntax

    #include <pexports.h>
    
    UINT32 PostHealthState (
      UINT32   moduleHandle,
      UINT32   handle,
      char    *maxValueString,
      char    *peakValueString,
      char    *currentValueString,
      UINT8    currentState,
      UINT8   *resUINT8,
      UINT32   resUINT32);
    

Parameters

moduleHandle
(IN) Specifies the NLM handle that is passed to you at startup. This parameter ensures that only the module which registered this health monitor is posting data for it.
handle
(IN) Specifies the handle that was returned to you when you registered your health monitor
maxValueString
(IN) Points to a formatted string that describes your maximum value. This string is limited to 48 characters. If you want to leave a value the same, pass in a NULL pointer.
peakValueString
(IN) Points to a formatted string that describes your peak value. This string is limited to 48 characters. If you want to leave a value the same, pass in a NULL pointer.
currentValueString
(IN) Points to a formatted string that describes your current value. This string is limited to 48 characters. If you want to leave a value the same, pass in a NULL pointer.
currentState
(IN) Specifies the current health state with one of the following values:

Value

Name

0

GREENSTATUS

1

YELLOWSTATUS

2

REDSTATUS

10

INACTIVESTATUS

20

OFFLINE

resUINT8
(IN) Available for future expansion.
resUINT32
(IN) Available for future expansion.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code. See Section 6.6, Health Monitor Error Codes.

Remarks

The PostHealthState function reports the health of your system. You can only call this function after you have registered as a health monitor.

If you receive the error code HEALTH_MONITOR_REPLACED, stop sending your health state because another NLM has replaced your health monitor. This usually happens only with health monitors that are registered by the Portal NLM. They are replaced by NLMs that are better able to determine a component's health.