'; if ($_SESSION['userlevel'] > '5') { // Settings common to SNMPv2 & v3 $hostname = mres($_POST['hostname']); if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = $config['snmp']['port']; } if ($_POST['transport']) { $transport = mres($_POST['transport']); } else { $transport = 'udp'; } if ($_POST['snmpver'] === 'v2c' or $_POST['snmpver'] === 'v1') { if ($_POST['community']) { $config['snmp']['community'] = array($_POST['community']); } $snmpver = mres($_POST['snmpver']); print_message("Adding host $hostname communit".(count($config['snmp']['community']) == 1 ? 'y' : 'ies').' '.implode(', ', $config['snmp']['community'])." port $port using $transport"); } else if ($_POST['snmpver'] === 'v3') { $v3 = array( 'authlevel' => mres($_POST['authlevel']), 'authname' => mres($_POST['authname']), 'authpass' => mres($_POST['authpass']), 'authalgo' => mres($_POST['authalgo']), 'cryptopass' => mres($_POST['cryptopass']), 'cryptoalgo' => mres($_POST['cryptoalgo']), ); array_push($config['snmp']['v3'], $v3); $snmpver = 'v3'; print_message("Adding SNMPv3 host $hostname port $port"); } else { print_error('Unsupported SNMP Version. There was a dropdown menu, how did you reach this error ?'); }//end if $poller_group = $_POST['poller_group']; $force_add = $_POST['force_add']; if ($force_add == 'on') { $force_add = 1; } else { $force_add = 0; } $port_assoc_mode = $_POST['port_assoc_mode']; $result = addHost($hostname, $snmpver, $port, $transport, 0, $poller_group, $force_add, $port_assoc_mode); if ($result) { print_message("Device added ($result)"); } } else { print_error("You don't have the necessary privileges to add hosts."); }//end if echo '
'; }//end if $pagetitle[] = 'Add host'; ?>

Add Device

Devices will be checked for Ping and SNMP reachability before being probed. Only devices with recognised OSes will be added.
'; }//end if ?>