CGI script: Porovnání verzí
Z Freenetis Wiki
(Založena nová stránka: cs: CGI ru: CGI скрипт Support for CGI scripts can be enabled in the Settings section. = Getting MAC address = FreenetIS currently allows to obtain MAC ad...) |
|||
Řádek 1: | Řádek 1: | ||
− | [[cs: CGI ]] | + | [[cs: CGI skripty]] |
[[ru: CGI скрипт]] | [[ru: CGI скрипт]] | ||
Aktuální verze z 10. 12. 2013, 10:21
Support for CGI scripts can be enabled in the Settings section.
Getting MAC address
FreenetIS currently allows to obtain MAC address in addition to SNMP and using custom CGI scripts that you put directly on the router in question. The script should only return MAC address.
The path to the script is defined by permit CGI scripts settings, specifically in the Network tab item URL for the ARP table. The default is http://{GATEWAY_IP_ADDRESS}/cgi-bin/arp.cgi?ip_address={IP_ADDRESS}, where parameters {GATEWAY_IP_ADDRESS} and {IP_ADDRESS} will be replaced by IP address and gateway IP address, in which are searched for MAC address.
Getting the MAC address fromf the ISC DHCP server
- !/bin/bash
. /usr/local/lib/bashlib echo "Content-type: text/plain" echo "" ip_address=`param ip_address` cat /var/lib/dhcp/dhcpd.leases | grep -A6 $ip_address | grep "hardware ethernet" | cut -d " " -f 5 | sed 's/;//'