Subversion Repositories camp_sysinfo_client_3

Rev

Rev 197 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 197 Rev 203
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.1';
7
our $VERSION = '1.3.0';
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
 
Line 15... Line 15...
15
#
15
#
16
# 20191118 RWR v1.2.1
16
# 20191118 RWR v1.2.1
17
# in some cases, ipmitool is used only to access other devices over the network
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
18
# so it will not have information. Fixed so that if @temp is empty, will just exit
19
#
19
#
-
 
20
# 20230204 RWR v1.3.0
-
 
21
# look for specific IPMI files to determine if the driver is installed
-
 
22
# better than just checking @temp afterwards
-
 
23
#
20
# module to get network interface information for ipmi
24
# module to get network interface information for ipmi
21
# requires ipmitool (runs ipmitool lan print)
25
# requires ipmitool (runs ipmitool lan print)
22
# NOTE: this takes the ipmitool output and parses it, so changes to 
26
# NOTE: this takes the ipmitool output and parses it, so changes to 
23
#       this output invalidates this module
27
#       this output invalidates this module
24
 
28
 
Line 30... Line 34...
30
 
34
 
31
my $command = &validCommandOnSystem('ipmitool');
35
my $command = &validCommandOnSystem('ipmitool');
32
 
36
 
33
exit 1 unless $command;
37
exit 1 unless $command;
34
 
38
 
-
 
39
# some systems have ipmitool installed simply for managing other machines
-
 
40
# but do not have ipmi themselves
-
 
41
exit 1 unless -e '/dev/ipmi0' || -e '/dev/ipmi/0' || -e '/dev/ipmidev/0';
-
 
42
 
35
my %storage = ( 
43
my %storage = ( 
36
                'address' => { 'key' => 'IP Address' }, 
44
                'address' => { 'key' => 'IP Address' }, 
37
                'netmask' => { 'key' => 'Subnet Mask' },
45
                'netmask' => { 'key' => 'Subnet Mask' },
38
                'mac' => { 'key' => 'MAC Address' }
46
                'mac' => { 'key' => 'MAC Address' }
39
              );
47
              );