Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hai, I have server like DNS (main) and many real server such as mail, ftp, telnet and so on. How to write the program at main server to know either real server fail or not thank you

Replies are listed 'Best First'.
Re: To know the server life or not
by Aristotle (Chancellor) on Oct 20, 2002 at 02:00 UTC
    For simple "server up/down" checks use fping. If you want to check the services themselves, you might want to check the various Net::* modules on CPAN. But actually, you probably want to use one of mon (written in Perl I think), Big Brother or NetSaint - no need to reinvent a well working wheel.

    Makeshifts last the longest.

      Since you've mentioned NetSaint. This is a quote from its website:
      For those who have not heard, NetSaint is being renamed to Nagios. You can find the Nagios homepage at http://www.nagios.org. NetSaint is no longer actively being developed - all development is now being put into Nagios.

      --
      Ilya Martynov, ilya@iponweb.net
      CTO IPonWEB (UK) Ltd
      Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
      Personal website - http://martynov.org

Re: To know the server life or not
by tadman (Prior) on Oct 20, 2002 at 02:02 UTC
    You could use something like Netsaint or NMAP before trying to write one of your own. After all, a monitoring system is no good if it has more bugs than the software it's monitoring.

    Both of these programs can be extended with scripting, so if you need something specific done, you can usually make them do what you want with a bit of work.
Re: To know the server life or not
by DigitalKitty (Parson) on Oct 20, 2002 at 02:02 UTC
    Hi Anonymous Monk,

    By 'fail' do you mean is off-line? If so, you could use the Net::Ping module. If not, could you post again? I might not fully understand what you meant by 'fail'.

    Thanks,

    -Katie.