Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 198 Rev 203
Line 1... Line 1...
1
#!/usr/bin/env perl
1
#!/usr/bin/env perl
2
use warnings;
2
use warnings;
3
use strict;  
3
use strict;  
4
 
4
 
5
# Description: Power Sensors for ipmi enabled servers
5
# Description: Power Sensors for ipmi enabled servers
6
 
-
 
7
our $VERSION = '1.0';
-
 
8
 
-
 
9
# IPMI power module for sysinfo client
6
# IPMI power module for sysinfo client
10
# Author: R. W. Rodolico
7
# Author: R. W. Rodolico
11
# Date:   2020-01-27
8
# Date:   2020-01-27
-
 
9
#
-
 
10
# v1.1 RWR 20230205
-
 
11
# cleaned up the detection for if we do not have driver installed on this system
-
 
12
# ie, binary only, probably to connect to other machines
12
 
13
 
13
 
14
 
-
 
15
our $VERSION = '1.1';
-
 
16
 
14
BEGIN {
17
BEGIN {
15
   push @INC, shift;
18
   push @INC, shift;
16
}
19
}
17
 
20
 
18
use library;
21
use library;
Line 50... Line 53...
50
}
53
}
51
 
54
 
52
# bail if we don't have the commands we need
55
# bail if we don't have the commands we need
53
exit 1 unless $commands{'ipmitool'};
56
exit 1 unless $commands{'ipmitool'};
54
 
57
 
-
 
58
# some systems have ipmitool installed simply for managing other machines
-
 
59
# but do not have ipmi themselves
-
 
60
exit 2 unless -e '/dev/ipmi0' || -e '/dev/ipmi/0' || -e '/dev/ipmidev/0';
-
 
61
 
55
my @temp = qx( $commands{'ipmitool'} sensor 2>/dev/null );
62
my @temp = qx( $commands{'ipmitool'} sensor 2>/dev/null );
56
exit 2 unless @temp; # ipmitool installed, but driver not. Probably using to connect someplace else.
63
exit 2 unless @temp; # ipmitool installed, but driver not. Probably using to connect someplace else.
57
chomp @temp;
64
chomp @temp;
58
 
65
 
59
my @current;
66
my @current;