root / tools / perl / lib / FusionInventory / Agent / Task / Inventory / OS / HPUX / MP.pm @ fa47cac2
History | View | Annotate | Download (1.5 kB)
| 1 |
package FusionInventory::Agent::Task::Inventory::OS::HPUX::MP; |
|---|---|
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
|
| 6 |
#TODO driver pcislot virtualdev |
| 7 |
|
| 8 |
sub isInventoryEnabled {
|
| 9 |
can_run("/opt/hpsmh/data/htdocs/comppage/getMPInfo.cgi")
|
| 10 |
or can_run("/opt/sfm/bin/CIMUtil")
|
| 11 |
} |
| 12 |
|
| 13 |
sub doInventory {
|
| 14 |
my $params = shift; |
| 15 |
my $inventory = $params->{inventory};
|
| 16 |
|
| 17 |
# my $name; |
| 18 |
my $ipaddress; |
| 19 |
# my $ipmask; |
| 20 |
# my $ipgateway; |
| 21 |
# my $speed; |
| 22 |
# my $ipsubnet; |
| 23 |
# my $status; |
| 24 |
# my $macaddr; |
| 25 |
|
| 26 |
if ( can_run("/opt/hpsmh/data/htdocs/comppage/getMPInfo.cgi") ) {
|
| 27 |
foreach (`/opt/hpsmh/data/htdocs/comppage/getMPInfo.cgi`) {
|
| 28 |
if ( /parent.frames.CHPAppletFrame.chpMiscData.RIBLink = "http.*\/([0-9.]+)";/ ) {
|
| 29 |
$ipaddress = $1; |
| 30 |
} |
| 31 |
} |
| 32 |
} else { #it off course can run /opt/sfm/bin/CIMUtil
|
| 33 |
foreach (`/opt/sfm/bin/CIMUtil -e root/cimv2 HP_ManagementProcessor`) {
|
| 34 |
if ( /IPAddress\s+:\s+([0-9.]+)/ ) {
|
| 35 |
$ipaddress = $1; |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
$inventory->addNetwork({
|
| 41 |
DESCRIPTION => 'Management Interface - HP MP', |
| 42 |
TYPE => 'Ethernet', |
| 43 |
MANAGEMENT => 'MP', |
| 44 |
IPADDRESS => $ipaddress, |
| 45 |
# IPMASK => $ipmask, |
| 46 |
# IPSUBNET => $ipsubnet, |
| 47 |
# STATUS => $status, |
| 48 |
# SPEED => $speed, |
| 49 |
# IPGATEWAY => $ipgateway, |
| 50 |
# MACADDR => $macaddr, |
| 51 |
# PCISLOT => $pcislot, |
| 52 |
# DRIVER => $driver, |
| 53 |
# VIRTUALDEV => $virtualdev, |
| 54 |
}); |
| 55 |
|
| 56 |
} |
| 57 |
|
| 58 |
1; |