LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2015, 12:29 AM   #1
aavika
Member
 
Registered: Dec 2014
Posts: 82

Rep: Reputation: Disabled
Send email when Remote Desktop is not available


hii..
I would like my computer to send me an email every time a remote desktop connection is not available.
Thanks in advance..
 
Old 02-26-2015, 09:20 AM   #2
sudowtf
Member
 
Registered: Nov 2013
Posts: 187

Rep: Reputation: 45
that's so vague.

what's the remote desktop server software? what port is it on? if you lose remote desktop, do you lose ping? can a solution be to test ping instead of remote?

what email service? do you have a sendmail server or will you use google or other?

you will not get a solution with such a vague question.
 
Old 02-27-2015, 02:38 AM   #3
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
Sorry sorry for inconvenience...

Remote Desktop Connection is a technology that allows you to sit at a computer (sometimes called the client computer) and connect to a remote computer (sometimes called the host computer) in a different location.
For example, you can connect to your work computer from your home computer and have access to all of your programs, files, and network resources as though you were in front of your computer at work. You can leave programs running at work and then, when you get home, you can see your work computer's desktop displayed on your home computer, with the same programs running.

yeah if i lose ping then i lose remote desktop. i want when remote desktop is not working or not available, it should send an email. i dont have any sendmail server. what to do??
thnk u for d reply..
 
Old 02-27-2015, 08:44 AM   #4
sudowtf
Member
 
Registered: Nov 2013
Posts: 187

Rep: Reputation: 45
oh goodness, i know what remote desktop is; what software (name and version) are you using on the host?
 
1 members found this post helpful.
Old 02-27-2015, 09:32 AM   #5
sudowtf
Member
 
Registered: Nov 2013
Posts: 187

Rep: Reputation: 45
You can go about this in several ways. you can ping the host and perform a function based on the result.
Let's assume your host is 192.168.1.100
Code:
if ! ping -c 1 -W 1 192.168.1.100 2>&1>/dev/null ; then echo "offline" ; else echo "online" ; fi
Another way is to test if a remote port accepts connections.
Let's assume your host is running RDP on port 3389.
Let's assume you have netcat installed on your linux client.

Code:
if ! nc -vz -w 2 192.168.1.100 3389  ; then echo "offline" ; else echo "online" ; fi
you could easily expand this to do some sendmail -- i will not go into that.
here is a link concerning sending gmail from commandline: http://tuxtweaks.com/2012/10/send-gm...-command-line/
 
1 members found this post helpful.
Old 02-27-2015, 09:49 AM   #6
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,186
Blog Entries: 10

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Quote:
Originally Posted by aavika View Post
...if i lose ping then i lose remote desktop.
ping is not reliable as a test as some hosts can be set to drop ICMP packets.
Quote:
Originally Posted by sudowtf View Post
Code:
if ! nc -vz -w 2 192.168.1.100 3389  ; then echo "offline" ; else echo "online" ; fi
Good one.
 
Old 03-03-2015, 12:35 AM   #7
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
hey, it works, i got the solution..
thank u so much Sudowtf Habitual....
 
Old 03-03-2015, 11:08 AM   #8
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,186
Blog Entries: 10

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
You are very welcome.
 
Old 03-04-2015, 01:45 AM   #9
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
i have a question:
how does swap partition size affect the performance of large files transfer??
 
Old 03-04-2015, 01:45 AM   #10
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
i have a question:
how does swap partition size affect the performance of large files transfer??
 
Old 03-04-2015, 02:06 AM   #11
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
i have a question:
how does swap partition size affect the performance of large files transfer??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command based email client to send email through secure smtp havolinec Linux - Newbie 2 07-27-2010 08:40 AM
Perl email::send.. how to send the email? hawk__0 Programming 6 12-24-2009 02:53 PM
SASL authentication failure when trying to send email from remote j0nr Linux - Server 5 09-20-2009 02:07 PM
Apache virtual host send email without email server SibLiant Linux - Software 6 06-03-2009 10:46 PM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 07:37 AM


All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration