LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   telnet alternative (https://www.linuxquestions.org/questions/linux-server-73/telnet-alternative-907253/)

graziano1968 10-09-2011 09:48 AM

telnet alternative
 
Hello

I was using

telnet mydomain.com 25
and
telnet mydomain.com 80

to check every some minute the status of port 25 and 80 for my domain .

Now my datacenter uninstalled "telnet" , have I some alternative
to telnet linux command please ?

Thank you!

joemon83 10-09-2011 10:36 AM

try this: nc mydomain.com 80

graziano1968 10-09-2011 10:51 AM

Quote:

Originally Posted by joemon83 (Post 4493872)
try this: nc mydomain.com 80

not available too ; something else more common ?

joemon83 10-09-2011 11:07 AM

just check if you have the nmap command in your machine.....

graziano1968 10-09-2011 11:14 AM

Quote:

Originally Posted by joemon83 (Post 4493890)
just check if you have the nmap command in your machine.....

no :( , I Centos 5 and I can't find an alternative to telnet .

TB0ne 10-09-2011 11:19 AM

Quote:

Originally Posted by graziano1968 (Post 4493843)
Hello
I was using

telnet mydomain.com 25 and telnet mydomain.com 80

to check every some minute the status of port 25 and 80 for my domain. Now my datacenter uninstalled "telnet" , have I some alternative to telnet linux command please ?

How about using wget? Something like:
Code:

wget <hostname or IP>:<port> | grep "connected"
If you find "connected", the service is running.

graziano1968 10-09-2011 12:33 PM

Quote:

Originally Posted by TB0ne (Post 4493897)
How about using wget? Something like:
Code:

wget <hostname or IP>:<port> | grep "connected"
If you find "connected", the service is running.

it seems good, THANK you

joemon83 10-09-2011 11:15 PM

yea..that was gud...but wget can't be used for the smtp port, 25

graziano1968 10-10-2011 12:40 AM

Quote:

Originally Posted by joemon83 (Post 4494251)
yea..that was gud...but wget can't be used for the smtp port, 25

in fact wget looks always at port 80 I think . Still in troubles

graziano1968 10-10-2011 11:05 AM

no alternative ?

unSpawn 10-10-2011 11:32 AM

Quote:

Originally Posted by graziano1968 (Post 4493843)
I was using telnet mydomain.com 25 and telnet mydomain.com 80 to check every some minute the status of port 25 and 80 for my domain. Now my datacenter uninstalled "telnet" , have I some alternative to telnet linux command please ?

If I read this correctly your goal is not to use telnet but to be able to monitor services. If you monitor services then you will probably also restart them automagically on and be notified of certain conditions. While homebrewn kludges are nice they're usually not that configurable (say switching to HTTPS) or extensible (add NTP, a specific web-based application path, etc, etc) and that's why people before you already invented the wheel. So unless you want to re-invent the wheel, why not use something like Monit, Hobbit or even Nagios?..

TB0ne 10-10-2011 07:47 PM

Quote:

Originally Posted by joemon83 (Post 4494251)
yea..that was gud...but wget can't be used for the smtp port, 25

Wrong...please re-read my post. You have to SPECIFY the port, like "wget localhost:443", or "wget 10.11.12.13:25"

rameshshihora 10-10-2011 08:22 PM

Hey,

If you are just only concern to check the port avaibility then why dont you use the "nmap <IP address> -sT -p <port>". This will simply gives you the status of open ports on the respective remote servers.

Thanks & Regards,
Ramesh Shihora

joemon83 10-10-2011 11:27 PM

Quote:

Originally Posted by TB0ne (Post 4495076)
Wrong...please re-read my post. You have to SPECIFY the port, like "wget localhost:443", or "wget 10.11.12.13:25"

Yea....may be u r rite.....if the requirement is just to check if a port is open, you can use the port no. along with the domain name or IP. But it will try to send http request to that port, even if wget is made to connect to a non-http port.
Anyway I think graziano1968, can use this to check the availability of a remote port.

[root@localhost ~]# wget linux-web.com:25
--2011-08-21 19:48:14-- http://linux-web.com:25/
Resolving linux-web.com... 202.65.135.196
Connecting to linux-web.com|202.65.135.196|:25... connected.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: `index.html'

[ <=> ] 294 --.-K/s in 0s

2011-08-21 19:48:16 (13.4 MB/s) - `index.html' saved [294]

[root@localhost ~]# vi index.html
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cat index.html
220-server102.hostcats.com ESMTP Exim 4.69 #1 Tue, 11 Oct 2011 09:49:31 +0530
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
500 unrecognized command
500 unrecognized command
500 unrecognized command
500 Too many unrecognized commands

graziano1968 10-11-2011 12:44 AM

Quote:

Originally Posted by rameshshihora (Post 4495098)
Hey,

If you are just only concern to check the port avaibility then why dont you use the "nmap <IP address> -sT -p <port>". This will simply gives you the status of open ports on the respective remote servers.

Thanks & Regards,
Ramesh Shihora


The problem is that nmap does not come preinstalled in all OS (such as red hat , centos) . I am searching an alternative to telnet
which is available in almost all major linux distro such as Red Hat/Centos.

---------- Post added 10-11-11 at 05:44 AM ----------

Quote:

Originally Posted by rameshshihora (Post 4495098)
Hey,

If you are just only concern to check the port avaibility then why dont you use the "nmap <IP address> -sT -p <port>". This will simply gives you the status of open ports on the respective remote servers.

Thanks & Regards,
Ramesh Shihora

Ok thank you, I will test again this way .


All times are GMT -5. The time now is 11:43 AM.