1753451 Members
5924 Online
108794 Solutions
New Discussion юеВ

Re: script

 
ivy1234
Frequent Advisor

script

we have a server that always have problem ( we still can't find the reason ) and hang , we want to have a script ( run on another server ) to test the server is running or not , we want to run telnet to access this server , if the login prompt retun ( that mean the server is still active ) , then do nothing , if no login prompt return , do send mail to alert me , can advise how to write this script ?

Thanks.
6 REPLIES 6
Torsten.
Acclaimed Contributor

Re: script

If you have a proliant with windows running, then install "UDN", this is probably exactly what you want (based on "ping").

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Dennis Handly
Acclaimed Contributor

Re: script

>Torsten: this is probably exactly what you want (based on ping).

This may not be that useful. I've had plenty of cases where ping worked but the system was hung.
Torsten.
Acclaimed Contributor

Re: script

So a TOC and dump analyze would be the better way, maybe ...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
ivy1234
Frequent Advisor

Re: script

Thanks ,

I perfer to use script to check it as , I may be use it in various unix-like server .

can advise what can i do ? thx
Doug O'Leary
Honored Contributor

Re: script

Hey;

You can write up a script in perl/expect that'll do exactly what you're looking for; however, that'll be a one-off script. It does that and only that.

It sounds like your best bet would be to get and install nagios (http://www.nagios.org/ ). It's a free monitoring tool with web based reporting and customizable alerting (pages, text messages, emails, etc). Over and above telnet, it does monitoring on filesystem usage, cpu usage, memory usage, ssh, web, mail, database, etc, etc.

You can also write your own plugins and pretty much have it monitor anything you want. While a one-off script will do what you're asking for right here, you'll quickly find you want to monitor other things as well.

Don't reinvent the wheel if you don't have to.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Steven Schweda
Honored Contributor

Re: script

> script

Is that the most descriptive subject which
you could devise?

> [...] various unix-like server .

Not a very detailed description of anything.

Did you try searching before asking? A Forum
search for keywords like, say,
telnet script
should have found some potentially useful old
threads, like, for example:

http://h30499.www3.hp.com/t5/System-Administration/telnet-xx-xx-xx-port-how-break-the-connection-in-script/m-p/5202982#M463743


However, a Telnet test might not be the
easiest or the most useful, depending on
exactly what "server is running" means to
you. For example, if the system under test
runs a Web server, then a program like wget
could be used to test its ability to serve a
Web page. Testing the actual function(s) of
interest may provide more useful information
than testing Telnet response can.