Skip to content
Snippets Groups Projects
Commit f024accb authored by Sergey Joseph Ivanov's avatar Sergey Joseph Ivanov
Browse files

work for ovirt

parent 8719d7a3
No related branches found
No related tags found
No related merge requests found
......@@ -55,13 +55,20 @@ sub handler {
my $self = shift;
my $config = $self->{'config'};
my $virsh_path = $config->{'virsh_path'} || 'virsh';
my $output_active = run_command("$virsh_path list --name");
my $output_autostart = run_command("$virsh_path list --autostart --name");
my $output_inactive = run_command("$virsh_path list --name --inactive");
my ($output_active,$output_autostart,$output_inactive)=('','','');
$output_active = run_command("$virsh_path list --name");
if ($output_active =~ m/please enter your authentication name/i){
$output_active = run_command("ps --no-headers -C qemu-kvm -o args");
$output_active =~ s|^/usr/libexec/qemu-kvm -name guest=([^,]*),debug-threads=on.*$|$1|gm;
}
else {
$output_autostart = run_command("$virsh_path list --autostart --name");
$output_inactive = run_command("$virsh_path list --name --inactive");
}
my %metrics = (
"active" => $output_active,
"inactive" => $output_inactive,
"autostart" => $output_autostart,
"active" => $output_active,
"inactive" => $output_inactive,
"autostart" => $output_autostart,
);
return \%metrics;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment