Since I reformatted my fog server and did a complete new install from Fog 0.32 --> 0.33 --> 1.0.0 --> 1.0.1â>1.1.0, I have lost my client list. đ I originally hoped the client would re-register themselves but that function was lost in 0.29 and it makes sense why. The HOST has no idea what image to point to. Considering there may be 2 possible images for the same Make\Model of machine.
So I wanted to make this easier on myself.
Here is what I came up with⊠I have a shortcut to a network shared batch file so I can make some changes on the fly with our users that canât do things for themselves. This batch file is in windows All Users\Startup folder. (Dirty I know but works). SO if I want my staff to look at a webpage as soon as they log in I can force that. đ
[B]Windows Batch file:[/B]
[CODE]start <fogserverip>/fog/management/index.php?node=host&sub=add[/CODE]
[B]Install arpscan to fog server[/B]
[CODE]sudo apt-get install arp
[/CODE]
[B]Edit /var/www/fog/lib/pages/[/B][B]HostManagementPage.class.php[/B] to include just below print â\n\t\t\t<h2>â._(âAdd new host definitionâ).â</h2>â;
[CODE] //----------------------------------------------------------------------------------------
//Register this host Button (wolfbane8653)
//Must install arp first (sudo apt-get install arp) before enabling this button
?>
<script>
function fillinfo()
{
//get this hosts info
<?php
$ipaddr = $_SERVER[âREMOTE_ADDRâ];
$chk = exec('/usr/sbin/arp -a '.$ipaddr,$output);
$data = explode(" â,$output[0]);
$name = explode(â.",$data[0]);
$hostname = $name[0];
$macaddr = $data[3];
?>
//export php info into javascript
var hostname = â<?php echo $hostname ?>â;
var macaddr = â<?php echo $macaddr ?>â;
//output to textboxes
document.getElementsByName(âhostâ)[0].value=hostname;
document.getElementsByName(âmacâ)[0].value=macaddr;
}
</script>
<button onclick=âfillinfo()â>Register THIS HOST</button>
<?php
//end button
//----------------------------------------------------------------------------------------[/CODE]
With this edit I now can click on this new button and it inputs my current computer name and mac address in the correct fields. Is there anyway this can be incorporated as a hook/plugin/option?
[COLOR=#ff0000]Warning this only works on LAN.[/COLOR]