Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to create an intranet IP list database obtained from linux terminal (nbtscan or another command)
    primarykey
    data
    text
    <p>How should I structure a database where I need to store the IP(as INT unsigned) address, sectors where they are being used and the name of the machine. It will be used to quick search the available IP. As is known that the addresses won't be more than 254 per network should I create a separated table with the list?</p> <p>[Edit]</p> <p>Another thing came to mind. If I already now that the networks will go from 192.168.x.1 to 192.168.x.254 and sometimes I would like to see which IP is free or which IP is set to a specific machine, should I fill the table with the addresses and later associate them creating a list with the used and the free ones?</p> <p>[Edit]</p> <p>After using nbtscan I think I can get the data I want. The command</p> <pre><code>nbtscan 192.168.0.1-254 -t 20000 </code></pre> <p>Gives me:</p> <pre><code>Doing NBT name scan for addresses from 192.168.0.1-254 IP address NetBIOS Name Server User MAC address ------------------------------------------------------------------------------ 192.168.0.135 EREBOS &lt;server&gt; EREBOS 00-00-00-00-00-00 192.168.0.130 CHAOS &lt;unknown&gt; 00-00-00-00-00-00 </code></pre> <p>A good result, but:</p> <pre><code>nbtscan -s , 192.168.0.1-254 -t 20000 </code></pre> <p>Gives me:</p> <pre><code>192.168.0.130,CHAOS ,,&lt;unknown&gt;,00-00-00-00-00-00 192.168.0.135,EREBOS ,&lt;server&gt;,EREBOS ,00-00-00-00-00-00 </code></pre> <p>And now I am using:</p> <pre><code>&lt;?php header('Content-type: text/csv'); header('Content-disposition: attachment;filename=ips.csv'); include_once "conn.php"; $iprange = "192.168.0.1-254"; $timeout = 20000; $separator = ","; $strre = shell_exec("nbtscan -s $separator $iprange -t $timeout"); echo preg_replace('/ +/',',', $strre); </code></pre> <p>To generate a .csv file that I can import to MySQL. Is that a good sollution?</p> <p>I don't know why but nbtscan is giving different number of columns. The first line has 6 and the second 7. That is anoying! Does anyone know how to solve it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload