#!/bin/env perl

use strict;
use warnings;
use RPC::XML;
use RPC::XML::Client;
use Getopt::Long;

GetOptions(
        's=s' => \my $server,
) or die "Wrong options";


my $xmlcli = RPC::XML::Client->new($server || 'http://localhost.localdomain/rpc');

my $tasks = $xmlcli->send_request('admin.maintenance.tasks');
if (ref $tasks && !$tasks->is_fault) {
    foreach (@{ $tasks->value || []}) {
        $xmlcli->send_request($_);
    }
}
