[ale] Network Vendor String
Christopher Fowler
cfowler at outpostsentinel.com
Tue Oct 10 12:03:56 EDT 2006
Pass #2
--- [ Cut Here ] --------------------------------
#!/usr/bin/perl
use LWP::UserAgent;
die "$0 <interface>\n" unless $ARGV[0];
my $ifconfig = `/sbin/ifconfig $ARGV[0] | head -n1`;
$ifconfig =~ m/HWaddr\s(.+?)$/;
my $mac = $1;
$mac =~ m/^(..):(..):(..)/;
my $vendor = "$1$2$3";
my $ua = LWP::UserAgent->new();
my $response = $ua->post("http://www.coffer.com/mac_find/",
{ 'string' => $vendor });
$response->content() =~ m/$vendor\s+(.+?)\n/;
my $manuf = $1;
print "Vendor String: $vendor, Manufacturer: $manuf\n";
-------------------------------------------------------
On Tue, 2006-10-10 at 11:53 -0400, Christopher Fowler wrote:
> Pass #1:
>
> --- [ Cut Here ] -------------------
> #!/usr/bin/perl
> die "$0 <interface>\n" unless $ARGV[0];
> my $ifconfig = `/sbin/ifconfig $ARGV[0] | head -n1`;
> $ifconfig =~ m/HWaddr\s(.+?)$/;
> my $mac = $1;
> $mac =~ m/^(..):(..):(..)/;
> my $vendor = "$1:$2:$3";
> print "Vendor: $vendor\n";
> --- [ Cut Here ] -------------------
>
> On Tue, 2006-10-10 at 08:46 -0700, ale at jeffx.com wrote:
> > Say I am writing a little script to obtain hardware inventory on my linux
> > system. I want the vendor string of the network card(s). I know there
> > has to be a way to get it because the installer reads the information as
> > does network-configuration tools.
> >
> > I have looked around in /proc with no success. Is there a way to get that
> > information?
> >
> > Regards,
> > Jeff
> >
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > http://www.ale.org/mailman/listinfo/ale
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list