Subversion Repositories camp_sysinfo_client_3

Rev

Rev 87 | Rev 197 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87 Rev 149
Line 2... Line 2...
2
use warnings;
2
use warnings;
3
use strict;
3
use strict;
4
 
4
 
5
# Description: Get IPMI network information
5
# Description: Get IPMI network information
6
 
6
 
7
our $VERSION = '1.2';
7
our $VERSION = '1.2.1';
8
 
8
 
9
# IPMI network module for sysinfo client
9
# IPMI network module for sysinfo client
10
# Author: R. W. Rodolico
10
# Author: R. W. Rodolico
11
# Date:   2016-09-17 
11
# Date:   2016-09-17 
12
 
12
 
13
# 20171124 RWR
13
# 20171124 RWR
14
# Fixed where STDERR now goes to /dev/null
14
# Fixed where STDERR now goes to /dev/null
15
#
15
#
-
 
16
# 20191118 RWR v1.2.1
-
 
17
# in some cases, ipmitool is used only to access other devices over the network
-
 
18
# so it will not have information. Fixed so that if @temp is empty, will just exit
-
 
19
#
16
# module to get network interface information for ipmi
20
# module to get network interface information for ipmi
17
# requires ipmitool (runs ipmitool lan print)
21
# requires ipmitool (runs ipmitool lan print)
18
# NOTE: this takes the ipmitool output and parses it, so changes to 
22
# NOTE: this takes the ipmitool output and parses it, so changes to 
19
#       this output invalidates this module
23
#       this output invalidates this module
20
 
24
 
Line 34... Line 38...
34
                'mac' => { 'key' => 'MAC Address' }
38
                'mac' => { 'key' => 'MAC Address' }
35
              );
39
              );
36
 
40
 
37
my $CATEGORY = 'network';
41
my $CATEGORY = 'network';
38
my @temp = qx( $command lan print 2>/dev/null );
42
my @temp = qx( $command lan print 2>/dev/null );
-
 
43
exit 2 unless @temp; # ipmitool installed, but driver not. Probably using to connect someplace else.
39
chomp @temp;
44
chomp @temp;
40
 
45
 
41
foreach my $line ( @temp ) {
46
foreach my $line ( @temp ) {
42
   my ( $key, $value ) = split( /\s+:\s+/, $line );
47
   my ( $key, $value ) = split( /\s+:\s+/, $line );
43
   foreach my $test ( keys %storage ) {
48
   foreach my $test ( keys %storage ) {