diff -ur zabbix-1.8.3.old/frontends/php/api/classes/class.chost.php zabbix-1.8.3/frontends/php/api/classes/class.chost.php --- zabbix-1.8.3.old/frontends/php/api/classes/class.chost.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/api/classes/class.chost.php 2010-11-04 14:28:49.000000000 +0100 @@ -699,7 +699,7 @@ $result[$host['hostid']]['maintenances'][] = array('maintenanceid' => $host['maintenanceid']); // unset($host['maintenanceid']); - } + } //--- $result[$host['hostid']] += $host; @@ -1101,6 +1101,7 @@ * @param int $hosts['ipmi_privilege'] IPMI privilege. OPTIONAL * @param string $hosts['ipmi_username'] IPMI username. OPTIONAL * @param string $hosts['ipmi_password'] IPMI password. OPTIONAL + * @param int $hosts['ipmi_hacks'] IPMI hacks for broken platforms. OPTIONAL * @return boolean */ public static function create($hosts){ @@ -1153,6 +1154,7 @@ 'ipmi_privilege' => 0, 'ipmi_username' => '', 'ipmi_password' => '', + 'ipmi_hacks' => 0, ); if(!check_db_fields($host_db_fields, $host)){ @@ -1177,7 +1179,7 @@ $hostid = get_dbid('hosts', 'hostid'); $hostids[] = $hostid; $result = DBexecute('INSERT INTO hosts (hostid, proxy_hostid, host, port, status, useip, dns, ip, disable_until, available,'. - 'useipmi,ipmi_port,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,ipmi_ip) VALUES ('. + 'useipmi,ipmi_port,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,ipmi_ip,ipmi_hacks) VALUES ('. $hostid.','. $host['proxy_hostid'].','. zbx_dbstr($host['host']).','. @@ -1194,7 +1196,8 @@ $host['ipmi_privilege'].','. zbx_dbstr($host['ipmi_username']).','. zbx_dbstr($host['ipmi_password']).','. - zbx_dbstr($host['ipmi_ip']).')' + zbx_dbstr($host['ipmi_ip']).','. + $host['ipmi_hacks'].')' ); if(!$result){ self::exception(ZBX_API_ERROR_PARAMETERS, 'DBerror'); @@ -1266,6 +1269,7 @@ * @param int $hosts['ipmi_privilege'] IPMI privilege. OPTIONAL * @param string $hosts['ipmi_username'] IPMI username. OPTIONAL * @param string $hosts['ipmi_password'] IPMI password. OPTIONAL + * @param int $hosts['ipmi_hacks'] IPMI hacks for broken platforms. OPTIONAL * @param string $hosts['groups'] groups * @return boolean */ @@ -1381,6 +1385,7 @@ * @param int $hosts['fields']['ipmi_privilege'] IPMI privilege. OPTIONAL * @param string $hosts['fields']['ipmi_username'] IPMI username. OPTIONAL * @param string $hosts['fields']['ipmi_password'] IPMI password. OPTIONAL + * @param int $hosts['fields]['ipmi_hacks'] IPMI hacks for broken platforms. OPTIONAL * @return boolean */ public static function massUpdate($data){ @@ -1454,6 +1459,7 @@ if(isset($data['ipmi_username'])) $sql_set[] = 'ipmi_username='.zbx_dbstr($data['ipmi_username']); if(isset($data['ipmi_password'])) $sql_set[] = 'ipmi_password='.zbx_dbstr($data['ipmi_password']); if(isset($data['ipmi_ip'])) $sql_set[] = 'ipmi_ip='.zbx_dbstr($data['ipmi_ip']); + if(isset($data['ipmi_hacks'])) $sql_set[] = 'ipmi_hacks='.$data['ipmi_hacks']; if(!empty($sql_set)){ $sql = 'UPDATE hosts SET ' . implode(', ', $sql_set) . ' WHERE '.DBcondition('hostid', $hostids); diff -ur zabbix-1.8.3.old/frontends/php/api/classes/class.ctemplate.php zabbix-1.8.3/frontends/php/api/classes/class.ctemplate.php --- zabbix-1.8.3.old/frontends/php/api/classes/class.ctemplate.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/api/classes/class.ctemplate.php 2010-11-04 13:51:35.000000000 +0100 @@ -934,6 +934,7 @@ * @param string $templates['ipmi_privilege'] * @param string $templates['ipmi_username'] * @param string $templates['ipmi_password'] + * @param string $templates['ipmi_hacks'] * @return boolean */ public static function create($templates){ @@ -1184,6 +1185,7 @@ * @param int $hosts['fields']['ipmi_privilege'] IPMI privilege. OPTIONAL * @param string $hosts['fields']['ipmi_username'] IPMI username. OPTIONAL * @param string $hosts['fields']['ipmi_password'] IPMI password. OPTIONAL + * @param int $hosts['ipmi_hacks'] IPMI hacks for broken platforms. OPTIONAL * @return boolean */ public static function massUpdate($data){ diff -ur zabbix-1.8.3.old/frontends/php/hosts.php zabbix-1.8.3/frontends/php/hosts.php --- zabbix-1.8.3.old/frontends/php/hosts.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/hosts.php 2010-11-04 16:14:20.000000000 +0100 @@ -75,6 +75,9 @@ 'ipmi_privilege'=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(1,5), NULL), 'ipmi_username'=> array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'ipmi_password'=> array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), + 'ipmi_hack_rakp3_wrong_rolem'=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL), + 'ipmi_hack_20_as_main_addr'=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL), + 'ipmi_hack_rmcpp_integ_sik'=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL), 'mass_clear_tpls'=> array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), @@ -327,7 +330,7 @@ $hosts = array('hosts' => zbx_toObject($hostids, 'hostid')); $properties = array('port', 'useip', 'dns', 'ip', 'proxy_hostid', 'useipmi', 'ipmi_ip', 'ipmi_port', 'ipmi_authtype', - 'ipmi_privilege', 'ipmi_username', 'ipmi_password', 'status'); + 'ipmi_privilege', 'ipmi_username', 'ipmi_password', 'ipmi_hacks', 'status'); $new_values = array(); foreach($properties as $property){ if(isset($visible[$property])){ @@ -476,6 +479,7 @@ 'ipmi_privilege' => $_REQUEST['ipmi_privilege'], 'ipmi_username' => $_REQUEST['ipmi_username'], 'ipmi_password' => $_REQUEST['ipmi_password'], + 'ipmi_hacks' => get_request('ipmi_hack_20_as_main_addr', 0) + get_request('ipmi_hack_rakp3_wrong_rolem', 0) + get_request('ipmi_hack_rmcpp_integ_sik', 0), 'groups' => $groups, 'templates' => $templates, 'macros' => get_request('macros', array()), diff -ur zabbix-1.8.3.old/frontends/php/include/defines.inc.php zabbix-1.8.3/frontends/php/include/defines.inc.php --- zabbix-1.8.3.old/frontends/php/include/defines.inc.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/include/defines.inc.php 2010-11-04 14:41:53.000000000 +0100 @@ -701,6 +701,10 @@ define('IPMI_PRIVILEGE_ADMIN', 4); define('IPMI_PRIVILEGE_OEM', 5); + define('IPMI_CONN_HACK_20_AS_MAIN_ADDR', 1); + define('IPMI_CONN_HACK_RAKP3_WRONG_ROLEM', 2); + define('IPMI_CONN_HACK_RMCPP_INTEG_SIK', 4); + /* Define if your logs are in non-standard format */ /* define('ZBX_LOG_ENCODING_DEFAULT', 'Shift_JIS');*/ diff -ur zabbix-1.8.3.old/frontends/php/include/export.inc.php zabbix-1.8.3/frontends/php/include/export.inc.php --- zabbix-1.8.3.old/frontends/php/include/export.inc.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/include/export.inc.php 2010-11-04 13:52:15.000000000 +0100 @@ -41,6 +41,7 @@ 'ipmi_privilege' => '', 'ipmi_username' => '', 'ipmi_password' => '', + 'ipmi_hacks' => '', ) ), XML_TAG_MACRO => array( diff -ur zabbix-1.8.3.old/frontends/php/include/forms.inc.php zabbix-1.8.3/frontends/php/include/forms.inc.php --- zabbix-1.8.3.old/frontends/php/include/forms.inc.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/include/forms.inc.php 2010-11-05 10:27:54.000000000 +0100 @@ -4149,6 +4149,9 @@ $ipmi_privilege = get_request('ipmi_privilege', 2); $ipmi_username = get_request('ipmi_username', ''); $ipmi_password = get_request('ipmi_password', ''); + $ipmi_hack_20_as_main_addr = get_request('ipmi_hack_20_as_main_addr', 0); + $ipmi_hack_rakp3_wrong_rolem = get_request('ipmi_hack_rakp3_wrong_rolem', 0); + $ipmi_hack_rmcpp_integ_sik = get_request('ipmi_hack_rmcpp_integ_sik', 0); $useprofile = get_request('useprofile', 'no'); @@ -4437,6 +4440,25 @@ $cmbIPMIAuthtype ); + $hacksCol = new CCol(); + $chkIPMIHack0x20A = new CCheckBox('ipmi_hack_20_as_main_addr', $ipmi_hack_20_as_main_addr, '', IPMI_CONN_HACK_20_AS_MAIN_ADDR); + $chkIPMIHack0x20A->setHint(S_IPMI_CONN_HACK_20_AS_MAIN_ADDR_HINT, '', '', false); + $chkIPMIHackRAKP3 = new CCheckBox('ipmi_hack_rakp3_wrong_rolem', $ipmi_hack_rakp3_wrong_rolem, '', IPMI_CONN_HACK_RAKP3_WRONG_ROLEM); + $chkIPMIHackRAKP3->setHint(S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM_HINT, '', '', false); + $chkIPMIHackRMCPP = new CCheckBox('ipmi_hack_rmcpp_integ_sik', $ipmi_hack_rmcpp_integ_sik, '', IPMI_CONN_HACK_RMCPP_INTEG_SIK); + $chkIPMIHackRMCPP->setHint(S_IPMI_CONN_HACK_RMCPP_INTEG_SIK_HINT, '', '', false); + + $hacksCol->addItem(array( + $chkIPMIHack0x20A, S_IPMI_CONN_HACK_20_AS_MAIN_ADDR, new CTag('br'), + $chkIPMIHackRAKP3, S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM, new CTag('br'), + $chkIPMIHackRMCPP, S_IPMI_CONN_HACK_RMCPP_INTEG_SIK, + )); + + $frmHost->addRow(array( + new CVisibilityBox('visible[ipmi_hacks]', isset($visible['ipmi_hacks']), 'ipmi_hacks', S_ORIGINAL), S_IPMI_HACKS), + $hacksCol + ); + $cmbIPMIPrivilege = new CComboBox('ipmi_privilege', $ipmi_privilege); $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_CALLBACK, S_PRIVILEGE_CALLBACK); $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_USER, S_PRIVILEGE_USER); @@ -4563,6 +4585,9 @@ $ipmi_privilege = get_request('ipmi_privilege',2); $ipmi_username = get_request('ipmi_username',''); $ipmi_password = get_request('ipmi_password',''); + $ipmi_hack_20_as_main_addr = get_request('ipmi_hack_20_as_main_addr', 0); + $ipmi_hack_rakp3_wrong_rolem = get_request('ipmi_hack_rakp3_wrong_rolem', 0); + $ipmi_hack_rmcpp_integ_sik = get_request('ipmi_hack_rmcpp_integ_sik', 0); $useprofile = get_request('useprofile','no'); @@ -4614,6 +4639,9 @@ $ipmi_privilege = $db_host['ipmi_privilege']; $ipmi_username = $db_host['ipmi_username']; $ipmi_password = $db_host['ipmi_password']; + $ipmi_hack_20_as_main_addr = $db_host['ipmi_hacks'] & IPMI_CONN_HACK_20_AS_MAIN_ADDR; + $ipmi_hack_rakp3_wrong_rolem = $db_host['ipmi_hacks'] & IPMI_CONN_HACK_RAKP3_WRONG_ROLEM; + $ipmi_hack_rmcpp_integ_sik = $db_host['ipmi_hacks'] & IPMI_CONN_HACK_RMCPP_INTEG_SIK; // add groups $options = array('hostids' => $_REQUEST['hostid']); @@ -4809,6 +4837,22 @@ $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_RMCP_PLUS, S_AUTHTYPE_RMCP_PLUS); $host_tbl->addRow(array(S_IPMI_AUTHTYPE, $cmbIPMIAuthtype)); + $hacksCol = new CCol(); + $chkIPMIHack0x20A = new CCheckBox('ipmi_hack_20_as_main_addr', $ipmi_hack_20_as_main_addr, '', IPMI_CONN_HACK_20_AS_MAIN_ADDR); + $chkIPMIHack0x20A->setHint(S_IPMI_CONN_HACK_20_AS_MAIN_ADDR_HINT, '', '', false); + $chkIPMIHackRAKP3 = new CCheckBox('ipmi_hack_rakp3_wrong_rolem', $ipmi_hack_rakp3_wrong_rolem, '', IPMI_CONN_HACK_RAKP3_WRONG_ROLEM); + $chkIPMIHackRAKP3->setHint(S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM_HINT, '', '', false); + $chkIPMIHackRMCPP = new CCheckBox('ipmi_hack_rmcpp_integ_sik', $ipmi_hack_rmcpp_integ_sik, '', IPMI_CONN_HACK_RMCPP_INTEG_SIK); + $chkIPMIHackRMCPP->setHint(S_IPMI_CONN_HACK_RMCPP_INTEG_SIK_HINT, '', '', false); + + $hacksCol->addItem(array( + $chkIPMIHack0x20A, S_IPMI_CONN_HACK_20_AS_MAIN_ADDR, new CTag('br'), + $chkIPMIHackRAKP3, S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM, new CTag('br'), + $chkIPMIHackRMCPP, S_IPMI_CONN_HACK_RMCPP_INTEG_SIK + )); + + $host_tbl->addRow(array(S_IPMI_HACKS, $hacksCol)); + $cmbIPMIPrivilege = new CComboBox('ipmi_privilege', $ipmi_privilege); $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_CALLBACK, S_PRIVILEGE_CALLBACK); $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_USER, S_PRIVILEGE_USER); @@ -4824,6 +4868,9 @@ $frmHost->addVar('ipmi_ip', $ipmi_ip); $frmHost->addVar('ipmi_port', $ipmi_port); $frmHost->addVar('ipmi_authtype', $ipmi_authtype); + $frmHost->addVar('ipmi_hack_20_as_main_addr', $ipmi_hack_20_as_main_addr); + $frmHost->addVar('ipmi_hack_rakp3_wrong_rolem', $ipmi_hack_rakp3_wrong_rolem); + $frmHost->addVar('ipmi_hack_rmcpp_integ_sik', $ipmi_hack_rmcpp_integ_sik); $frmHost->addVar('ipmi_privilege', $ipmi_privilege); $frmHost->addVar('ipmi_username', $ipmi_username); $frmHost->addVar('ipmi_password', $ipmi_password); diff -ur zabbix-1.8.3.old/frontends/php/include/locales/de_de.inc.php zabbix-1.8.3/frontends/php/include/locales/de_de.inc.php --- zabbix-1.8.3.old/frontends/php/include/locales/de_de.inc.php 2010-08-16 10:19:32.000000000 +0200 +++ zabbix-1.8.3/frontends/php/include/locales/de_de.inc.php 2010-11-05 09:44:18.000000000 +0100 @@ -775,6 +775,13 @@ 'S_IPMI_IP_ADDRESS'=> 'IPMI IP Adresse', 'S_IPMI_PORT'=> 'IPMI-Port', 'S_IPMI_AUTHTYPE'=> 'IPMI Authentifizierungsart', + 'S_IPMI_HACKS'=> 'IPMI Verbinungshacks', + 'S_IPMI_CONN_HACK_20_AS_MAIN_ADDR'=> 'Verwende Adresse 0x20 als ersten Teil des LAN Kommandos', + 'S_IPMI_CONN_HACK_20_AS_MAIN_ADDR_HINT'=> 'Set this bit in the hacks if, even though the connection is to a device not at 0x20, the first part of a LAN command should always use 0x20.', + 'S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM'=> 'Verwende untere 4 Bit der RAKP3 Nachricht', + 'S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM_HINT'=> 'Some systems (incorrectly, according to the spec) use only the bottom 4 bits or ROLE(m) for authentication in the RAKP3 message. The spec says to use all 8 bits, but enabling this hack makes OpenIPMI only use the bottom 4 bits.', + 'S_IPMI_CONN_HACK_RMCPP_INTEG_SIK'=> 'Verwende SIK nach Spezifikation', + 'S_IPMI_CONN_HACK_RMCPP_INTEG_SIK_HINT' => 'The spec is vague (perhaps wrong), but the default for RMCP+ seems to be to use K(1) as the integrity key. That is thus the default of OpenIPMI, but this hack lets you use SIK as it says in one part of the spec.', 'S_AUTHTYPE_DEFAULT'=> 'Standard', 'S_AUTHTYPE_NONE'=> 'Kein', 'S_IPMI_PRIVILEGE'=> 'IPMI Privilege level', diff -ur zabbix-1.8.3.old/frontends/php/include/locales/en_gb.inc.php zabbix-1.8.3/frontends/php/include/locales/en_gb.inc.php --- zabbix-1.8.3.old/frontends/php/include/locales/en_gb.inc.php 2010-08-16 10:19:32.000000000 +0200 +++ zabbix-1.8.3/frontends/php/include/locales/en_gb.inc.php 2010-11-05 09:40:15.000000000 +0100 @@ -924,6 +924,13 @@ 'S_AUTHTYPE_STRAIGHT'=> 'Straight', 'S_AUTHTYPE_OEM'=> 'OEM', 'S_AUTHTYPE_RMCP_PLUS'=> 'RMCP+', + 'S_IPMI_HACKS'=> 'IPMI connection hacks', + 'S_IPMI_CONN_HACK_20_AS_MAIN_ADDR'=> 'Use address 0x20 as first part of LAN command', + 'S_IPMI_CONN_HACK_20_AS_MAIN_ADDR_HINT'=> 'Set this bit in the hacks if, even though the connection is to a device not at 0x20, the first part of a LAN command should always use 0x20.', + 'S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM'=> 'Use only bottom 4bits in RAKP3 message', + 'S_IPMI_CONN_HACK_RAKP3_WRONG_ROLEM_HINT'=> 'Some systems (incorrectly, according to the spec) use only the bottom 4 bits or ROLE(m) for authentication in the RAKP3 message. The spec says to use all 8 bits, but enabling this hack makes OpenIPMI only use the bottom 4 bits.', + 'S_IPMI_CONN_HACK_RMCPP_INTEG_SIK'=> 'Use SIK according to part of spec', + 'S_IPMI_CONN_HACK_RMCPP_INTEG_SIK_HINT' => 'The spec is vague (perhaps wrong), but the default for RMCP+ seems to be to use K(1) as the integrity key. That is thus the default of OpenIPMI, but this hack lets you use SIK as it says in one part of the spec.', 'S_IPMI_PRIVILEGE'=> 'IPMI privilege level', 'S_PRIVILEGE_CALLBACK'=> 'Callback', 'S_PRIVILEGE_USER'=> 'User', diff -ur zabbix-1.8.3.old/frontends/php/include/schema.inc.php zabbix-1.8.3/frontends/php/include/schema.inc.php --- zabbix-1.8.3.old/frontends/php/include/schema.inc.php 2010-08-16 10:19:33.000000000 +0200 +++ zabbix-1.8.3/frontends/php/include/schema.inc.php 2010-11-04 13:54:03.000000000 +0100 @@ -535,6 +535,7 @@ 'ipmi_password' => DB::FIELD_TYPE_STR, 'ipmi_disable_until' => DB::FIELD_TYPE_INT, 'ipmi_available' => DB::FIELD_TYPE_INT, + 'ipmi_hacks' => DB::FIELD_TYPE_INT, 'snmp_disable_until' => DB::FIELD_TYPE_INT, 'snmp_available' => DB::FIELD_TYPE_INT, 'maintenanceid' => DB::FIELD_TYPE_INT,