VMware {code} Community
Texiwill
Leadership
Leadership
Jump to solution

VI Perl Toolkit Times out... How to recover?

Hello,

I have a long running VI Perl Toolkit program and would like to detect the timeout and respond to it by perhaps using Vim::load_session or Vim::logout/Vim::login.... How can I detect this time out of the session? Or does anyone have the length of time for which the session is good. I could not find it in the documentation.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

The timeout is configurable in VC, and defaults to 30 minutes I believe.

To test your connection (or to keep it alive) you could retrieve the root folder, for example.

View solution in original post

0 Kudos
2 Replies
admin
Immortal
Immortal
Jump to solution

The timeout is configurable in VC, and defaults to 30 minutes I believe.

To test your connection (or to keep it alive) you could retrieve the root folder, for example.

0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

I usually test against the currentSession property to see if my session is still active and valid.

my $sc = Vim::get_service_content();

my $session_manager = $sc->sessionManager;

my $sm = Vim::get_view(mo_ref => $session_manager);

if ($sm->currentSession)

{

print "Valid Session: " . $sm->currentSession->key . "\n";

}

else

{

die "Invalid Session\n";

}

Reuben Stump | http://www.virtuin.com | @ReubenStump