in reply to Re: Error handling
in thread Error handling
my $omi_url="https://omi.test.com/opt-web/rest/9.10/event_list/?qu +ery=title%20LIKE%20%22logtec(100)%25%22&watermark=$twoWeeksAgo%2B02:0 +0"; my $user="username"; my $password="*******";
Below i have the timeout exception pls check if its correct or any other way around
## Get events from OMi ## my $omi_url="https://omi.test.com/opt-web/rest/9.10/event_list/?qu +ery=title%20LIKE%20%22logtec(100)%25%22&watermark=$twoWeeksAgo%2B02:0 +0"; my $user="username"; my $password="*******"; #print "$omi_url\n"; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 } +, );; $ua->credentials('omi.test.com:544','HP Operations Manager i',$use +r,$password); $request = HTTP::Request->new(GET => $omi_url); $ua->timeout(300); $resp = $ua->request($request); if ($resp->is_success) { # print $resp->as_string; open(my $fh, '>', 'events.xml'); # print $fh $resp->content; close $fh; } else { print "Error: " . $resp->status . "\n"; } ## End ###
Please check .Thank you
|
|---|