RegisterServerHealthThreshold

Is a prototype for a function that registers thresholds for a component.

Syntax

    #include <pexports.h>
    
    UINT32 RegisterServerHealthThreshold (
      UINT32   handle,
      char    *thresholdURL,
      UINT32   category,
      void   (*ReturnCurrentValues)(
              char   *suspectLimit,
              char   *criticalLimit));
    

Parameters

handle
(IN) Specifies the handle that was returned to you when you registered your health monitor and identifies which health monitor this threshold callback and URL are associated with.
thresholdURL
(IN) Points to a formatted string that will be associated with the description for the specific health item. This URL is called when the specific threshold link is selected.
category
(IN) Specifies the category into which you grouped your health monitor. For available categories, see Section 6.7, Categories.
ReturnCurrentValues
(IN) Points to a callback function pointer that returns the current yellow and red threshold values. The callback function has the following parameters.
  • suspectLimit—(OUT) Points to the current yellow threshold value.
  • criticalLimit—(OUT) Points to the current red threshold value.

Return Values

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

Remarks

The RegisterServerHealthThreshold function registers a URL to be returned when the specific health item threshold description is selected. The caller is required to supply a callback routine that allows the portal server health engine to retrieve the current values. It is not be necessary to unregister this call because the resources used to track this information are returned when the health item is unregistered.

If you receive the error code THRESHOLD_ALREADY_SET, the threshold callback has already been set for that specific health item. Check your code for a handle error and make sure you are not registering a threshold callback twice for the same health item.