Image Added
Install HTTPD
코드 블럭 |
---|
language | bash |
---|
theme | Emacs |
---|
linenumbers | true |
---|
|
sudo yum -y install httpd |
Create index.html
코드 블럭 |
---|
language | bash |
---|
theme | Emacs |
---|
linenumbers | true |
---|
|
sudo touch |
TBD
코드 블럭 |
---|
# cat /var/libwww/dnsmasqhtml/bmcindex.leaseshtml
1604474459sudo chown ac:1f:6b:f9:2f:97 172.19.0.29 2020000567-bmc 01:ac:1f:6b:f9:2f:97
1604474451 ac:1f:6b:f9:25:cd 172.19.0.15 2019001231-bmc 01:ac:1f:6b:f9:25:cd
...kreonet:kreonet /var/www/html/index.html |
Upload Script
Upload list_dhcp_clients.py on /home/kreonet/list_dhcp_clients.py
Change permission
코드 블럭 |
---|
|
chmod 755 /home/kreonet/list_dhcp_clients.py |
Modify Script (if needed)
Check that /bin/python3 and other files are exists
코드 블럭 |
---|
language | py |
---|
theme | Emacs |
---|
title | list_dhcp_clients.py |
---|
linenumbers | true |
---|
|
#!/bin/python3
...
HOSTS='/etc/dnsmasq.d/bmc-hosts.conf'
LEASES='/var/lib/dnsmasq/bmc.leases'
ISO_DIR='/ISOs'
OUT='/var/www/html/index.html'
... |
Register script via crontab
코드 블럭 |
---|
|
crontab -e
# add the following
*/5 * * * * /home/kreonet/list_dhcp_clients.py |
Access to webpage
Image Added