snmp_set_port.php
As of FreeNAC 3.0 we introduced the snmp_set_port.php script. This script programs a switch port either as static of dynamic. Its usage is as follows:
snmp_set_port.php switch port [OPTIONS]
Where switch is the switch's ip and port is the port name. This script supports the following options.
OPTIONS:
-d Set port to dynamic
-s vlan_name Set port to static and program vlan_name on that port
-h Display this help screen
If no option is provided, it programs the port as dynamic. To program a port as static, you need to provide the vlan_name you want to program on the switch port. Such vlan_name must exist on the switch in order to be successfully programmed. Once the port has been programmed, it gets restarted.
Since this script makes extensive use of SNMP, make sure you adjust your SNMP communities in the etc/config.inc file.
This script is designed to be run from the command line. So, in order to interact with the Windows GUI, we have provided a companion script called cron_program_port.php
cron_program_port.php gets the list of ports whose set_authprofile field equals 1, and then issues an snmp_set_port command for every port that matched the criterion. Since this latter script is designed to be run from crontab, you should adjust the running frequency according to your needs.
Bugs and comments, please discuss them in the forums .
- Printer-friendly version
- Login to post comments