monitor windows remote desktop from linux

Paul Weaver paul.weaver at bbc.co.uk
Wed Jul 8 11:15:30 CEST 2009


> Yeah, I understand what you mean. The problem is that before 
> you can monitor, you have to identify what exactly needs to 
> be monitored. And that's where the troubleshooting comes in. 

I disagree. The OP would like to monitor remote desktop logins. As an
admin, I care that RDP is broken, not (neccersarilly) that the clock is
out of sync.

> From then on, it could be anything from an authentication 
> issue to a protocol issue to an encryption issue, clock skew 
> (I'm not sure if the encryption in RDP is time-sensitive. I 
> don't think it is, but wanted to mention it), and the 
> monitoring needs to reflect the specific problem you are 
> monitoring for. 
> If you don't know what exactly is going wrong, there is a 
> high likelihood that you are monitoring the wrong thing and 
> don't actually detect when the users are experiencing a 
> problem - just as you saw with the sockets.

An ideal check would be for some meatware to sit infront of a computer,
log in with a few user names, check that the login is succesful, and
push a button which sets the nagios state to "green". If they have a
problem, push a different button to set the light to "red".

You may be able to get a perl module that can control remote desktop,
have a system log in, run a command, and log out. A quick google doesn't
show anything up, and experimentation with "rdesktop -u USER -d DOMAIN
-p PASS -s SOMETHING.EXE $HOSTADDRESS$" seems to leave the session
logged in. You could create SOMETHING.EXE which made a call back to
nagios to say "I'm working", but you'd need to get windows to log out
afterwards. A bit of windows scripting would probably do that for you,
so you would have something like

<nagiosside>
$ok = 0;
$port = 2345;
while ($ok == 0) {
	$port++;
	$ok = listenOnPort($port)
}
run_in_foreground("rdesktop -u USER -d DOMAIN -p PASS -s
"remote_check.wsh $nagiosaddress $port" $HOSTADDRESS$");
my ($status, $info) = receivedMsg();
print $info;
exit $status;

<windowsside>
my ($nagiosaddress, $port) = shift;
open_socket("$nagiosaddress:$port");
print_socket("OK,Remote Desktop OK for user $USER");
close_socket();
logout();

For already-written plugins, check_x224 will give a better check than
check_tcp. 
--
Paul Weaver	
Systems Development Engineer
News Production Facilities, BBC News

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list