Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006

    Question Script for MAIL + FTP + MYSQL monitoring


    I'm writing a bash script to monitor MAIL + FTP + MYSQL from an "X" website

    MySQL monitor is already done.. now I have problems trying to figure out how to monitor MAIL and FTP for a "X" website.

    I tried the following to know if the server was alive or not, but this command is not a static command, it keeps alive and have no end until I press CTRL + C , same happens if I use telnet .. here you have some examples for FTP and Mail...

    netcat WEBSITE.COM 21
    netcat WEBSITE.COM 25
    Can anyone guide me on this.. I must write this script in bash, no other language.

    Does anyone knows how to avoid the CTRL + C and stop the netcat until it says remote server is alive ?

    Last edited by sh4ka; 01-09-2007 at 04:40 PM.

  2. #2
    Join Date
    May 2006
    Teh Interweb
    Look for a command named tcping. You can then ping the port to see if it is alive.

    [[email protected]] ~ $ cat .signature
    cat: .signature: No such file or directory

  3. #3
    Join Date
    Apr 2006
    Thank you!! Very useful!

  4. #4
    Join Date
    Sep 2006
    By no means an out-of-the-box solution but I used a script called hostchecker, modified it for my needs and made a version available for download... I've since made a LOT more changes for my own use, but the basic framework is still available for download - it might give you an idea

    I needed a way to monitor more than just whether something responded or not, I needed to know if it was responding correctly (i.e. a webserver responding 200 or 500, an email server with 200 OK, or some other error indicating file system full, high load, too many connections, etc.)

    You can download it from:
    Kristopher E.J.
    Stable, Supported, Affordable.

  5. #5
    Join Date
    Sep 2002
    Top Secret
    I must write this script in bash, no other language.
    Then you're going to have very limited options
    You will want to investigate other languages, especially php, which can compare responses from the ports and then respond accordingly.
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Linux Problems? WHMCS Issues? +1-866-546-8914 (linux-14) or @whmcsguru on twitter!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts