How can I list the Vendor details of device in a Smarts IP domain using a Perl script?
All supported releases of Smart
To list all the Vendor details of device in a Smarts IP domain, execute the Perl script in the following section using sm_perl. The sm_perl executable is available under the <BASEDIR>/smarts/bin directory. You can run sm_perl as in the following example for a script called ash.pl:
<BASEDIR>/smarts/bin]# ./sm_perl ash.pl
Perl Script
The following script can be used to list all the Vendor details in a Smarts IP domain:
#! /usr/bin/perl
use InCharge::session
$host='localhost:426';
$uname='admin';
$server="INCHARGE-AM-PM";
$paswd="xxxxxx";
print "\nbroker=$host,server=$server";
$session = InCharge::session->new(broker => $host,server => $server,user => $uname, password => $paswd);$device = "Switch::<name>";
$obj = $session->object( $device );
$vendor = $obj->{Vendor};
print "\nVendor=$vendor. \n";
$session->detach( );