Homebrew NMS: Send Out Nedi, Get Back Useful Data - Page 2

 By Charlie Schluting | Posted Sep 26, 2007
Page 2 of 2   |  Back to Page 1
Print Article


EUC with HCI: Why It Matters

Using Perl, again, and DBD::Pg, we'll begin by defining our DB connection information:

Next, we need to open the file and begin reading it. The final block of code is quite large, because it is necessary to execute all processing steps on every line of the file. The steps are: check for data sanity, assign variables names to each attribute of the line, and then perform one of two actions. If the MAC is already known, and its location has not changed, simply update the "lastseen" field in the database. Otherwise, this is a new host entry.

Checking data sanity is quite important, since pieces of information can often be missing. The example skips over unknown data, but it would be just as easy to flag it for human perusal if that is required.

Hopefully this has been a good example of how easy it is to manipulate discovery data. Next time we'll begin talking about how all this can be used, and what other pieces of data should be involved.

Comment and Contribute
(Maximum characters: 1200). You have
characters left.
Get the Latest Scoop with Enterprise Networking Planet Newsletter

By submitting your information, you agree that enterprisenetworkingplanet.com may send you ENTERPRISENetworkingPLANET offers via email, phone and text message, as well as email offers about other products and services that ENTERPRISENetworkingPLANET believes may be of interest to you. ENTERPRISENetworkingPLANET will process your information in accordance with the Quinstreet Privacy Policy.