w32 Windows2000 TerminalService Sessions counter

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
ioiioi
Cacti User
Posts: 52
Joined: Mon Mar 28, 2005 8:57 am

w32 Windows2000 TerminalService Sessions counter

Post by ioiioi »

Since the cacti builtin snmp LogonUser template is not accurate, so I modified the devilsun's wmi perl script to get the TerminalService info from this class:Win32_PerfRawData_TermService_TerminalServices
there are two items
1. TotalSessions
this is the number of all users who have been logon the windows TerminalService server
2. ActiveSessions
this is the active users on the TerminalService server.
the template is simple but useful.
run on:
win2k
cacti0.8.6.f
mysql 4.0.24
php 4.3.10
have a fun. :P
Attachments
w32_TerminalService_Sessions.zip
(5.18 KiB) Downloaded 3502 times
tman
Cacti User
Posts: 97
Joined: Thu Oct 14, 2004 4:14 pm

Post by tman »

Thanks ioiioi, this give the accurate indication of logged in users that I've been looking for.
yariv_l
Posts: 22
Joined: Thu Oct 27, 2005 7:11 pm

not working

Post by yariv_l »

hey
i imported the graph and loded the script , the graph is created and no data is in the graph . have anyone any ide ?

php 4.40
bsd
apachi 2.0.55
cacti 8.6g
yariv
ioiioi
Cacti User
Posts: 52
Joined: Mon Mar 28, 2005 8:57 am

Post by ioiioi »

I have noticed this problem last week, The perl script work just fine when triggering manually, Maybe the problem is the data template, haven't got an idea yet, I hope somebody could help me out.

Code: Select all

11/06/2005 09:07:06 PM - CMDPHP: Poller[0] Host[7] DS[68] CMD: perl C:/Apache2/htdocs/cacti/scripts/w32_query_TerminalService.pl 192.168.100.64 get ActiveSessions,TotalSessions, output: U  
11/06/2005 09:07:06 PM - CMDPHP: Poller[0] Host[7] DS[68] WARNING: Result from CMD not valid. Partial Result: Unable to talk to WM  
acturally, I could connect to the remote host's WMI.
yariv_l
Posts: 22
Joined: Thu Oct 27, 2005 7:11 pm

Post by yariv_l »

try this one i still didnt have the time to do .
http://forums.cacti.net/about5842.html&highlight=wmi
yariv
ioiioi
Cacti User
Posts: 52
Joined: Mon Mar 28, 2005 8:57 am

Post by ioiioi »

:) If you run cacti on linux/unix, you should need it.
User avatar
joed
Posts: 29
Joined: Mon Sep 19, 2005 6:27 am
Location: Germany/Palatinate

Post by joed »

I can't find the class:Win32_PerfRawData_TermService_TerminalServices in my wmi.

Do I have to activate something first?

joed
nils
Posts: 3
Joined: Tue Nov 20, 2007 8:52 pm

Post by nils »

Does this template work for windows 2003 teminal server?

C:\WINDOWS\system32>perl C:/Inetpub/wwwroot/cacti\scripts\w32_query_TerminalServ
ice.pl 192.168.124.21 get ActiveSessions,TotalSessions
ActiveSessions:0 TotalSessions:2

What is "totalsessions" mean?
Is this means the account all logged on users?
But there are not any user log on that server.
Mika2008
Posts: 26
Joined: Tue Dec 01, 2009 4:24 pm

Post by Mika2008 »

hello i have tried to lunch it on linux (Ubuntu 9.10 server) and i have this error :
what do u think please :

Code: Select all

./test.pl
Can't locate Win32/OLE.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./test.pl line 4.
BEGIN failed--compilation aborted at ./test.pl line 4.
jafflen
Posts: 4
Joined: Wed Nov 02, 2011 4:19 am

Re: w32 Windows2000 TerminalService Sessions counter

Post by jafflen »

Hello,
i've a script that uses WIN32::OLE which i downloaded from CPAN and installed it by unzipping... i've also added to the script the inclusion lines to @INC in BEGIN phase.

BEGIN{
push @INC, "/work/perl/libwin32-0.28/OLE/lib/";
}

however, it cannot find the .pm even though this file actually exists in this folder ...

"
Can't locate loadable object for module Win32::OLE in @INC (@INC contains: /mswg/opt/lib/perl5/5.6.0/i686-linux /mswg/opt/lib/perl5/5.6.0 /mswg/opt/lib/perl5/site_perl/5.6.0/i686-linux /mswg/opt/lib/perl5/site_perl/5.6.0 /mswg/opt/lib/perl5/site_perl . /work/perl/libwin32-0.28/OLE/lib/ /work/perl/XML-Parser-2.36) at excel.pl line 9
"
do you have any guesses why it fails to do so?
thanks
User avatar
msaum
Posts: 5
Joined: Tue Dec 22, 2009 8:43 am

Re: w32 Windows2000 TerminalService Sessions counter

Post by msaum »

Mika2008, I am at the same spot as you. When I run the script manually from my ubuntu/unix server i get the following:

Can't locate Win32/OLE.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./test.pl line 4.
BEGIN failed--compilation aborted at ./test.pl line 4.


Jafflen or Anybody, any update on this?

Date Fri, 13 Apr 2012 15:39:45 -0400
Cacti Version 0.8.7e
Cacti OS unix
SNMP Version NET-SNMP version: 5.4.1
RRDTool Version RRDTool 1.3.x
PHP Version 5.2.10-2ubuntu6.4
PHP OS Linux
PHP uname Linux cacti-ubuntu910 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686
PHP SNMP Installed
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests