enhance proxmox error
This commit is contained in:
parent
fdd151f885
commit
6fa8cff206
|
@ -45,15 +45,14 @@ sub new {
|
||||||
|
|
||||||
if (!defined($options{noptions})) {
|
if (!defined($options{noptions})) {
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
"hostname:s" => { name => 'hostname' },
|
'hostname:s' => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port'},
|
'port:s' => { name => 'port'},
|
||||||
"proto:s" => { name => 'proto' },
|
'proto:s' => { name => 'proto' },
|
||||||
"api-username:s" => { name => 'api_username' },
|
'api-username:s' => { name => 'api_username' },
|
||||||
"api-password:s" => { name => 'api_password' },
|
'api-password:s' => { name => 'api_password' },
|
||||||
"realm:s" => { name => 'realm' },
|
'realm:s' => { name => 'realm' },
|
||||||
"timeout:s" => { name => 'timeout' },
|
'timeout:s' => { name => 'timeout' },
|
||||||
"timeout:s" => { name => 'timeout', default => 30 },
|
'reload-cache-time:s' => { name => 'reload_cache_time', default => 7200 },
|
||||||
"reload-cache-time:s" => { name => 'reload_cache_time', default => 7200 },
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +95,6 @@ sub check_options {
|
||||||
$self->{port} = (defined($self->{option_results}->{port})) ? $self->{option_results}->{port} : 8006;
|
$self->{port} = (defined($self->{option_results}->{port})) ? $self->{option_results}->{port} : 8006;
|
||||||
$self->{proto} = (defined($self->{option_results}->{proto})) ? $self->{option_results}->{proto} : 'https';
|
$self->{proto} = (defined($self->{option_results}->{proto})) ? $self->{option_results}->{proto} : 'https';
|
||||||
$self->{timeout} = (defined($self->{option_results}->{timeout})) ? $self->{option_results}->{timeout} : 10;
|
$self->{timeout} = (defined($self->{option_results}->{timeout})) ? $self->{option_results}->{timeout} : 10;
|
||||||
$self->{ssl_opt} = (defined($self->{option_results}->{ssl_opt})) ? $self->{option_results}->{ssl_opt} : undef;
|
|
||||||
$self->{api_username} = (defined($self->{option_results}->{api_username})) ? $self->{option_results}->{api_username} : undef;
|
$self->{api_username} = (defined($self->{option_results}->{api_username})) ? $self->{option_results}->{api_username} : undef;
|
||||||
$self->{api_password} = (defined($self->{option_results}->{api_password})) ? $self->{option_results}->{api_password} : undef;
|
$self->{api_password} = (defined($self->{option_results}->{api_password})) ? $self->{option_results}->{api_password} : undef;
|
||||||
$self->{realm} = (defined($self->{option_results}->{realm})) ? $self->{option_results}->{realm} : 'pam';
|
$self->{realm} = (defined($self->{option_results}->{realm})) ? $self->{option_results}->{realm} : 'pam';
|
||||||
|
@ -137,11 +135,10 @@ sub build_options_for_httplib {
|
||||||
$self->{option_results}->{hostname} = $self->{hostname};
|
$self->{option_results}->{hostname} = $self->{hostname};
|
||||||
$self->{option_results}->{port} = $self->{port};
|
$self->{option_results}->{port} = $self->{port};
|
||||||
$self->{option_results}->{proto} = $self->{proto};
|
$self->{option_results}->{proto} = $self->{proto};
|
||||||
$self->{option_results}->{ssl_opt} = $self->{ssl_opt};
|
|
||||||
$self->{option_results}->{timeout} = $self->{timeout};
|
$self->{option_results}->{timeout} = $self->{timeout};
|
||||||
$self->{option_results}->{warning_status} = '';
|
$self->{option_results}->{warning_status} = '';
|
||||||
$self->{option_results}->{critical_status} = '';
|
$self->{option_results}->{critical_status} = '';
|
||||||
$self->{option_results}->{unknown_status} = '';
|
$self->{option_results}->{unknown_status} = '%{http_code} < 200 or %{http_code} >= 300';
|
||||||
}
|
}
|
||||||
|
|
||||||
sub settings {
|
sub settings {
|
||||||
|
|
|
@ -31,9 +31,9 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
});
|
||||||
});
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,15 +255,14 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'node-id:s' => { name => 'node_id' },
|
||||||
"node-id:s" => { name => 'node_id' },
|
'node-name:s' => { name => 'node_name' },
|
||||||
"node-name:s" => { name => 'node_name' },
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
'use-name' => { name => 'use_name' },
|
||||||
"use-name" => { name => 'use_name' },
|
'warning-node-status:s' => { name => 'warning_node_status', default => '' },
|
||||||
"warning-node-status:s" => { name => 'warning_node_status', default => '' },
|
'critical-node-status:s' => { name => 'critical_node_status', default => '' },
|
||||||
"critical-node-status:s" => { name => 'critical_node_status', default => '' },
|
});
|
||||||
});
|
|
||||||
|
|
||||||
$self->{statefile_cache_nodes} = centreon::plugins::statefile->new(%options);
|
$self->{statefile_cache_nodes} = centreon::plugins::statefile->new(%options);
|
||||||
return $self;
|
return $self;
|
||||||
|
|
|
@ -31,9 +31,9 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
});
|
||||||
});
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,17 +243,16 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'vm-id:s' => { name => 'vm_id' },
|
||||||
"vm-id:s" => { name => 'vm_id' },
|
'vm-name:s' => { name => 'vm_name' },
|
||||||
"vm-name:s" => { name => 'vm_name' },
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
'use-name' => { name => 'use_name' },
|
||||||
"use-name" => { name => 'use_name' },
|
'warning-vm-status:s' => { name => 'warning_vm_status', default => '' },
|
||||||
"warning-vm-status:s" => { name => 'warning_vm_status', default => '' },
|
'critical-vm-status:s' => { name => 'critical_vm_status', default => '' },
|
||||||
"critical-vm-status:s" => { name => 'critical_vm_status', default => '' },
|
});
|
||||||
});
|
$self->{statefile_cache_vms} = centreon::plugins::statefile->new(%options);
|
||||||
$self->{statefile_cache_vms} = centreon::plugins::statefile->new(%options);
|
return $self;
|
||||||
return $self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
|
|
Loading…
Reference in New Issue