fix hp p2000
This commit is contained in:
parent
4363ad1b4c
commit
f925259487
|
@ -190,15 +190,20 @@ sub get_infos {
|
||||||
$self->login();
|
$self->login();
|
||||||
my $cmd = $options{cmd};
|
my $cmd = $options{cmd};
|
||||||
$cmd =~ s/ /\//g;
|
$cmd =~ s/ /\//g;
|
||||||
|
|
||||||
|
my ($unknown_status, $warning_status, $critical_status) = ($self->{unknown_http_status}, $self->{warning_http_status}, $self->{critical_http_status});
|
||||||
|
if (defined($options{no_quit}) && $options{no_quit} == 1) {
|
||||||
|
($unknown_status, $warning_status, $critical_status) = ('', '', '');
|
||||||
|
}
|
||||||
my $response = $self->{http}->request(
|
my $response = $self->{http}->request(
|
||||||
url_path => $self->{url_path} . $cmd,
|
url_path => $self->{url_path} . $cmd,
|
||||||
header => [
|
header => [
|
||||||
'Cookie: wbisessionkey=' . $self->{session_id} . '; wbiusername=' . $self->{username},
|
'Cookie: wbisessionkey=' . $self->{session_id} . '; wbiusername=' . $self->{username},
|
||||||
'dataType: api', 'sessionKey: '. $self->{session_id}
|
'dataType: api', 'sessionKey: '. $self->{session_id}
|
||||||
],
|
],
|
||||||
unknown_status => $self->{unknown_http_status},
|
unknown_status => $unknown_status,
|
||||||
warning_status => $self->{warning_http_status},
|
warning_status => $warning_status,
|
||||||
critical_status => $self->{critical_http_status},
|
critical_status => $critical_status,
|
||||||
);
|
);
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
|
@ -206,6 +211,7 @@ sub get_infos {
|
||||||
$nodeset = $xpath->find("//OBJECT[\@basetype='" . $options{base_type} . "']");
|
$nodeset = $xpath->find("//OBJECT[\@basetype='" . $options{base_type} . "']");
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
|
return ({}, 0) if (defined($options{no_quit}) && $options{no_quit} == 1);
|
||||||
$self->{output}->add_option_msg(short_msg => "Cannot parse 'cmd' response: $@");
|
$self->{output}->add_option_msg(short_msg => "Cannot parse 'cmd' response: $@");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue