18
18
19
19
# These may need changing depending on the configuration of your system
20
20
my $hpacucli = ' /usr/sbin/hpssacli' ;
21
- my $sudo = ' /usr/bin/sudo' ;
22
- my $hpacucli_cmd = " $hpacucli " ;
23
21
24
22
my ( $slot , $fh , $fh2 );
25
23
@@ -50,8 +48,8 @@ sub add_metric {
50
48
}
51
49
52
50
# Get controller status
53
- open ( $fh , " $hpacucli_cmd controller all show status|" )
54
- or exp_exit( " Failed to run $hpacucli_cmd " );
51
+ open ( $fh , " $hpacucli controller all show status|" )
52
+ or exp_exit( " Failed to run $hpacucli " );
55
53
56
54
57
55
# Spin through output
@@ -69,7 +67,7 @@ sub add_metric {
69
67
foreach my $PARAM (qw( array physicaldrive logicaldrive) ) {
70
68
71
69
open ( $fh2 ,
72
- " $hpacucli_cmd controller slot=$slot $PARAM all show status|"
70
+ " $hpacucli controller slot=$slot $PARAM all show status|"
73
71
)
74
72
or exp_exit( " Failed to get info for $PARAM slot $slot " );
75
73
@@ -89,7 +87,7 @@ sub add_metric {
89
87
90
88
# Now get further details on each physicaldrive
91
89
open ( $fh2 ,
92
- " $hpacucli_cmd controller slot=$slot physicaldrive all show detail|"
90
+ " $hpacucli controller slot=$slot physicaldrive all show detail|"
93
91
)
94
92
or exp_exit( " Failed to get info for physicaldrive slot $slot " );
95
93
@@ -142,6 +140,4 @@ sub add_metric {
142
140
}
143
141
}
144
142
close ($fh )
145
- or exp_exist(" Failed to run $hpacucli_cmd controller all show status" );
146
-
147
-
143
+ or exp_exist(" Failed to run $hpacucli controller all show status" );
0 commit comments