IP Reg is a IPAM tool to keep track of assets, nodes (IP addresses, MAC addresses, DNS aliases) within different subnets, over different locations or even VLAN's. Written in PHP, used with a MySQL-database to have a unique insight in your local network.
You can not select more than 25 topicsTopics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
// get nodes for this subnet and implement the values into the array
$result = mysql_query("SELECT a.asset_name, acg.color, n.node_id, n.ip FROM asset a, assetclass ac, assetclassgroup acg, node n WHERE n.ip IN ('".implode("','",array_keys($subnet))."') AND n.subnet_id='$subnet_id' AND a.asset_id=n.asset_id AND ac.assetclass_id=a.assetclass_id AND acg.assetclassgroup_id=ac.assetclassgroup_id") or die(mysql_error());
$result = mysql_query("SELECT vlan_id, vlan_number, vlan_name FROM vlan WHERE vlan_id='$vlan_id'") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("vlan_id", $row->vlan_id);
$tp->set("vlan_name", $row->vlan_name);
$tp->parse("vlanrow");
}
if (($i>0) ? $tp->parse("vlan") : $tp->hide("vlan"));
// get location info
$result = mysql_query("SELECT l.location_id, l.location_name FROM location l INNER JOIN subnetlocation sl ON l.location_id=sl.location_id WHERE sl.subnet_id='$subnet_id'") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("location_id", $row->location_id);
$tp->set("location_name", $row->location_name);
$tp->parse("locationrow");
}
if (($i>0) ? $tp->parse("location") : $tp->hide("location"));
// get assetclass info
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name, color FROM assetclassgroup ORDER BY assetclassgroup_id") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {