Discussion:
How via Perl2UCS separate Authenticated and Normal connections
(too old to reply)
p***@aval.ua
2006-06-07 14:33:38 UTC
Permalink
Hi, All.
Via that script I can view (and in future disconnect ) all connections,
except some specific users. (see later)
But how I can separate "Authentificated" connections ?
I don't have any ideas.

use Perl2UCS;
open(OUT,">./test.txt");
my $server = Perl2UCS->new("UCX:Server") or die "Failed to get Server";
my $connections = $server->{'Clients'} or print OUT "Failed to get entries\n";
$connections->Reset();
while($connections->HasMoreElements()) {
my $conn = $connections->Next();
# NOT-LOGGED-Connections
if ($conn->{'Name'} =~ /[^\-]+\-[^\-]+\-[^\-]+/) {
}
#Workstation (ZENWorks) connections
elsif ($conn->{'Name'} =~ /[^\_]+\_\d+\_[^\_]+/) {
}
else
{
print OUT $conn->{'Name'}," , ", $conn->{'Id'}," ,
",$conn->{'Address'}->{'Net'}," , ",$conn->{'Address'}->{'Node'}," ,
",$conn->{'Address'}->{'Socket'}," , ",$conn->{'ConsoleRight'},"\n";
}
}
close(OUT);

Best regards,
Peter Voronov
Jim Lawson
2006-06-13 17:57:33 UTC
Permalink
I don't believe UCS provides information about the connection license
states.
You might try using SNMP. With it you should be able to enumerate the
connections and their states.

- Jim
Post by p***@aval.ua
Hi, All.
Via that script I can view (and in future disconnect ) all connections,
except some specific users. (see later)
But how I can separate "Authentificated" connections ?
I don't have any ideas.
use Perl2UCS;
open(OUT,">./test.txt");
my $server = Perl2UCS->new("UCX:Server") or die "Failed to get Server";
my $connections = $server->{'Clients'} or print OUT "Failed to get entries\n";
$connections->Reset();
while($connections->HasMoreElements()) {
my $conn = $connections->Next();
# NOT-LOGGED-Connections
if ($conn->{'Name'} =~ /[^\-]+\-[^\-]+\-[^\-]+/) {
}
#Workstation (ZENWorks) connections
elsif ($conn->{'Name'} =~ /[^\_]+\_\d+\_[^\_]+/) {
}
else
{
print OUT $conn->{'Name'}," , ", $conn->{'Id'}," ,
",$conn->{'Address'}->{'Net'}," , ",$conn->{'Address'}->{'Node'}," ,
",$conn->{'Address'}->{'Socket'}," , ",$conn->{'ConsoleRight'},"\n";
}
}
close(OUT);
Best regards,
Peter Voronov
Guenter
2006-06-13 22:05:20 UTC
Permalink
Hi Jim,
Post by Jim Lawson
I don't believe UCS provides information about the connection license
states.
You might try using SNMP. With it you should be able to enumerate the
connections and their states.
unfortunately you cant use the UCS SNMP component in protected space since
the snmp functions are not mashalled yet;
and normal SNMP access via Perl sockets isnt reliable - we run it with cron
every 2 mins and it fails after max. 48 hours....; mostly that happens when
one of the remote SNMP targets doesnt reply in time, or is down.

Guenter.

Loading...