Пример #1
0
/**
 * Returns array of all available snmp model templates
 * 
 * @return array
 */
function zb_SwitchModelsSnmpTemplatesGetAll()
{
    $allSnmpTemplates_raw = sp_SnmpGetAllModelTemplates();
    $allSnmpTemplates = array('' => __('No'));
    if (!empty($allSnmpTemplates_raw)) {
        foreach ($allSnmpTemplates_raw as $io => $each) {
            $allSnmpTemplates[$io] = $each['define']['DEVICE'];
        }
    }
    return $allSnmpTemplates;
}
Пример #2
0
  * @param string $fdbSwitchFilter
  */
 function web_FDBTableShowDataTable($fdbSwitchFilter = '', $fdbMacFilter = '')
 {
     $filter = '';
     $macfilter = '';
     $filter = !empty($fdbSwitchFilter) ? '&swfilter=' . $fdbSwitchFilter : '';
     $macfilter = !empty($fdbMacFilter) ? '&macfilter=' . $fdbMacFilter : '';
     $filtersForm = wf_modalAuto(web_icon_search('MAC filters setup'), __('MAC filters setup'), web_FDBTableFiltersForm(), '');
     $logControls = web_FDBTableLogControl();
     $columns = array('Switch IP', 'Port', 'Location', 'MAC', 'User');
     $result = wf_JqDtLoader($columns, '?module=switchpoller&ajax=true' . $filter . $macfilter, true, 'Objects', 100);
     show_window(__('Current FDB cache') . ' ' . $filtersForm . ' ' . $logControls, $result);
 }
 $allDevices = sp_SnmpGetAllDevices();
 $allTemplates = sp_SnmpGetAllModelTemplates();
 $allTemplatesAssoc = sp_SnmpGetModelTemplatesAssoc();
 $allusermacs = zb_UserGetAllMACs();
 $alladdress = zb_AddressGetFullCityaddresslist();
 $alldeadswitches = zb_SwitchesGetAllDead();
 $deathTime = zb_SwitchesGetAllDeathTime();
 //poll single device
 if (wf_CheckGet(array('switchid'))) {
     $switchId = vf($_GET['switchid'], 3);
     if (!empty($allDevices)) {
         foreach ($allDevices as $ia => $eachDevice) {
             if ($eachDevice['id'] == $switchId) {
                 //detecting device template
                 if (!empty($allTemplatesAssoc)) {
                     if (isset($allTemplatesAssoc[$eachDevice['modelid']])) {
                         if (!isset($alldeadswitches[$eachDevice['ip']])) {