Example #1
0
 public function parse($text)
 {
     $text_arr = split_for_arrays($this->pattern, $text);
     return get_interfaces($text_arr, $this->patterns);
 }
Example #2
0
function check_ipmi_settings($hostid)
{
    if (!check_template($hostid, "IPMI")) {
        return false;
    }
    $interfaces = get_interfaces($hostid, INTERFACE_TYPE_IPMI);
    $hosts = API::Host()->get(array("hostids" => $hostid, "output" => API_OUTPUT_EXTEND));
    if (!empty($interfaces) && !empty($hosts) && !empty($hosts[0]['ipmi_username']) && !empty($hosts[0]['ipmi_password'])) {
        return true;
    }
    return false;
}