VMware Cloud Community
sac1472
Contributor
Contributor

vCenter Session getting ended unexpectedly

I've configured ESXi monitoring in nagios. i'm using vCenter read-only user session to monitor all esxi. there are around 200 esxi & in total nagios has 850 checks for all esxi. vCenter user session file is used for authentication of each nagios check. Now, the issue is that session file getting ended unexpectedly not sure why this is happening.

I've observed that session file remains active if i use that only for few ESXi  And only gets ended if there are lots of esxi checks are using same session file.

how to overcome from this issue ?

is there any configuration changes needed in vCenter server ?

do i need provide any extra parameters while creating session file ?

i'm using below script for creating session file----

#!/usr/bin/perl -w

#

# Copyright 2007 VMware, Inc.  All rights reserved.

#

# This script demonstrates how to save session state to a file after login

use strict;

use warnings;

use FindBin;

use lib "$FindBin::Bin/../";

use VMware::VIRuntime;

$Util::script_version = "1.0";

# read/validate options

Opts::parse();

Opts::validate();

if (!Opts::option_is_set('savesessionfile')) {

   print STDERR "Error: Must specify --savesessionfile option for this utility.\n";

   exit 1;

}

# connect to the server

my $url = Opts::get_option('url');

my $username = Opts::get_option('username');

my $password = Opts::get_option('password');

Vim::login(service_url => $url, user_name => $username, password => $password);

# save the session to a file

my $file = Opts::get_option('savesessionfile');

if (defined($file)) {

   Vim::save_session(session_file => $file);

   print "Session information saved.\n";

} else {

   print STDERR "Error: Must specify --savesessionfile option for this utility.\n";

   exit 1;

}

__END__

## bug 217605

=head1 NAME

save_session.pl - Connects to a host and saves session state to a file.

=head1 SYNOPSIS

save_session.pl [options]

=head1 DESCRIPTION

This VI Perl command-line utility connects to a host and saves session state to a file.

=head1 OPTIONS

=over

=item B<savesessionfile>

Required. Name of the file to save the session state.

=back

=head1 EXAMPLES

save_session.pl --url https://<host>:<port>/sdk/vimService

          --username myuser --password mypassword --savesessionfile mysavedsessionfile

=head1 SUPPORTED PLATFORMS

All operations work with VMware VirtualCenter 2.0.1 or later.

All operations work with VMware ESX 3.0.1 or later.

Tags (1)
0 Kudos
1 Reply
sac1472
Contributor
Contributor

when session gets ended, nagios shows error like below for all checks which are using that session file -----

CHECK_ESX3.PL CRITICAL - Session file ended unexpectedly at /usr/share/perl5/VMware/VICommon.pm line 85.

0 Kudos