LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-25-2015, 11:29 PM   #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, 08:20 AM   #2
sudowtf
Member
 
Registered: Nov 2013
Posts: 206

Rep: Reputation: 46
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, 01: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, 07:44 AM   #4
sudowtf
Member
 
Registered: Nov 2013
Posts: 206

Rep: Reputation: 46
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, 08:32 AM   #5
sudowtf
Member
 
Registered: Nov 2013
Posts: 206

Rep: Reputation: 46
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, 08:49 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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-02-2015, 11:35 PM   #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, 10:08 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
You are very welcome.
 
Old 03-04-2015, 12: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, 12: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, 01: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



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 07:40 AM
Perl email::send.. how to send the email? hawk__0 Programming 6 12-24-2009 01:53 PM
SASL authentication failure when trying to send email from remote j0nr Linux - Server 5 09-20-2009 01:07 PM
Apache virtual host send email without email server SibLiant Linux - Software 6 06-03-2009 09:46 PM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:20 AM.

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
Open Source Consulting | Domain Registration