public function parse($text) { $text_arr = split_for_arrays($this->pattern, $text); return get_interfaces($text_arr, $this->patterns); }
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; }