Number of RDP session script not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Number of RDP session script not working

Post by bosecorp »

Hi

I am trying to use this script, but dopesn't seem to work

https://exchange.nagios.org/directory/P ... fo/details


the script works in Windows 2008, WIndows 8, but it doesn't work in Windows 2012

and also the script doesn't give us the number of sessions for windows 2012.


Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

Z:\>c:

C:\>cd "Program Files"

C:\Program Files>cd "NSClient++"

C:\Program Files\NSClient++>cd scripts

C:\Program Files\NSClient++\scripts>cscript get_rdp_infovbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Input Error: There is no file extension in "C:\Program Files\NSClient++\scripts\
get_rdp_infovbs".

C:\Program Files\NSClient++\scripts>cscript get_rdp_info.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\NSClient++\scripts\get_rdp_info.vbs(370, 5) Microsoft VBScript
runtime error: Object doesn't support this property or method: 'InputBytes'


C:\Program Files\NSClient++\scripts>
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Number of RDP session script not working

Post by rkennedy »

As this isn't a plugin we wrote, it's a bit difficult to troubleshoot.

Have you taken a look to see if any other plugins will work for you? I was able to find this one -
https://exchange.nagios.org/directory/P ... ns/details

Another option, could you look at your performance counters and see if you can monitor Terminal Services -> Active Sessions? You may be able to pull the active connections from there as well.
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Number of RDP session script not working

Post by Box293 »

I wrote this script a few years ago.
bosecorp wrote:the script works in Windows 2008, WIndows 8, but it doesn't work in Windows 2012
I had another user report this issue some time ago and they also had Windows 2012. I tried to help them however it seems as though the object the script is referencing no longer exists in the WMI class. I no longer work with Remote Desktop Servers so I have no interest in updating it.

If you weren't interested in the bytes information, you can comment out lines 398 - 430.

And replace line 494 with:

Code: Select all

FinalOutput = "Sessions {Active=" & TotalActive & " Idle=" & TotalIdle & " Disconnected=" & TotalDisconnected & "} |'Active Sessions'=" & TotalActive & " 'Idle Sessions'=" & TotalIdle & " 'Disconnected Sessions'=" & TotalDisconnected & " [get_rdp_info]"
I think that'll work.

Also, if your operating system is something other than english ... then I would give up as the sessions stuff isn't going to work either.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Number of RDP session script not working

Post by bosecorp »

that eliminated the errors,


but still doesn't give me the session count which is what I really want
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Number of RDP session script not working

Post by rkennedy »

rkennedy wrote: Another option, could you look at your performance counters and see if you can monitor Terminal Services -> Active Sessions? You may be able to pull the active connections from there as well.
Are you able to see the active # of connections through the performance counters?
Former Nagios Employee
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Number of RDP session script not working

Post by bosecorp »

Yes, I can.

what changes would need to be made to the script
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Number of RDP session script not working

Post by Box293 »

The script uses this command to get the connection details:

Code: Select all

qwinsta
What is the output of that command in a dos window?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Number of RDP session script not working

Post by bosecorp »

The commands shows the active sessions
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Number of RDP session script not working

Post by rkennedy »

We didn't write the plugin for the Windows RDP sessions, so it's hard to say why it's not working.

If you can pull the information from performance counters as you mentioned, it may be easier to go that route.
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Number of RDP session script not working

Post by Box293 »

Performance counter is probably going to be easier.

These guides should help:

https://support.nagios.com/kb/category.php?id=19
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked