setThreshold

Name

setThreshold -- Indicate a threshold has been crossed.

Synopsis

$err = $mod->setThreshold($thresholdToSet, $forceAlert);

Description

This function is used to tell the RSPD that your module has found a given threshold has been crossed. The $thresholdToSet string should contain the data returned by getThreshold(). The $forceAlert argument can be 0 or 1. If set to 1, this tells the RSPD that it should act as if the threshold has just crossed, even if it has in fact been crossed for some time. This may be necessary in cases where the threshold refers to multiple pieces of data. For example, imagine a general threshold which is crossed any time a site goes down. As multiple sites go down, the threshold stays crossed, but it may be necessary for more than one alert to be sent.

Returns

This function returns -1 if an error occurred, and 0 otherwise. In case of error, the program will croak() with an appriopriate message.