require_once 'require/function_snmp.php'; $form_name = 'SNMP_DETAILS'; //recherche des infos de la machine $item = info_snmp($protectedGet['id']); if (!is_array($item['data'])) { msg_error($item); require_once FOOTER_HTML; die; } $systemid = $item['data']['snmp']->ID; // SNMP SUMMARY $lbl_affich = array('NAME' => $l->g(49), 'UPTIME' => $l->g(352), 'MACADDR' => $l->g(95), 'IPADDR' => $l->g(34), 'CONTACT' => $l->g(1227), 'LOCATION' => $l->g(295), 'DOMAIN' => $l->g(33), 'TYPE' => $l->g(66), 'SNMPDEVICEID' => $l->g(1297), 'SERIALNUMBER' => $l->g(36), 'COUNTER' => $l->g(55), 'DESCRIPTION' => $l->g(53), 'LASTDATE' => $l->g(46)); $info['snmp'] = $item['data']['snmp']; $first_tab = bandeau($info, $lbl_affich); unset($item['data']['snmp']); $second_tab = bandeau($item['data'], $lbl_affich, $item['lbl'], 'mvt_bordure'); if ($first_tab) { echo $first_tab; } if ($second_tab) { echo $second_tab; } //get plugins when exist $Directory = PLUGINS_DIR . "snmp_detail/"; $ms_cfg_file = $Directory . "snmp_config.txt"; if (!isset($_SESSION['OCS']['DETAIL_SNMP'])) { if (file_exists($ms_cfg_file)) { $search = array('ORDER' => 'MULTI2', 'LBL' => 'MULTI', 'ISAVAIL' => 'MULTI'); $plugins_data = read_configuration($ms_cfg_file, $search); $_SESSION['OCS']['DETAIL_SNMP']['LIST_PLUGINS'] = $plugins_data['ORDER']; $_SESSION['OCS']['DETAIL_SNMP']['LIST_LBL'] = $plugins_data['LBL'];
require_once 'require/function_wol.php'; $wol = new Wol(); $sql = "select MACADDR,IPADDRESS from networks WHERE (hardware_id=%s) and status='Up'"; $arg = array($systemid); $resultDetails = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg); $msg = ""; while ($item = mysql_fetch_object($resultDetails)) { $wol->wake($item->MACADDR, $item->IPADDRESS); if ($wol->wol_send == $l->g(1282)) { msg_info($wol->wol_send . "=>" . $item->MACADDR . "/" . $item->IPADDRESS); } else { msg_error($wol->wol_send . "=>" . $item->MACADDR . "/" . $item->IPADDRESS); } } } $bandeau = bandeau($data, $lbl_affich, $link); echo "<input type='hidden' id='WOL' name='WOL' value=''>"; echo close_form(); $Directory = PLUGINS_DIR . "computer_detail/"; $ms_cfg_file = $Directory . "cd_config.txt"; if (!isset($_SESSION['OCS']['DETAIL_COMPUTER'])) { //get plugins when exist if (file_exists($ms_cfg_file)) { $search = array('ORDER' => 'MULTI2', 'LBL' => 'MULTI', 'ISAVAIL' => 'MULTI'); $plugins_data = read_configuration($ms_cfg_file, $search); $_SESSION['OCS']['DETAIL_COMPUTER']['LIST_PLUGINS'] = $plugins_data['ORDER']; $_SESSION['OCS']['DETAIL_COMPUTER']['LIST_LBL'] = $plugins_data['LBL']; $_SESSION['OCS']['DETAIL_COMPUTER']['LIST_AVAIL'] = $plugins_data['ISAVAIL']; } } $list_plugins = $_SESSION['OCS']['DETAIL_COMPUTER']['LIST_PLUGINS'];