Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Can I check http and smtp remotely?

  • Can I check http and smtp remotely?

    Posted by x_vag on January 26, 2007 at 17:21

    Hello,

    I’m trying to find a way to check http and smtp status remotely.
    I prefer not to install agent on this machines and I would like to use a linux agent that already exists on other machine.
    Have you any idea how that can be done?

    Regards,
    Vagelis.

    x_vag replied 17 years, 8 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dassing

    Member
    January 31, 2007 at 13:21
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello Vagelis,

    each of these servers can be addressed manually by
    telnet server.net 80 for http requests
    resp.
    telnet server.net 25 for sendmail

    You can write a script sending a valid request,
    like HELO in respect to http or smtp and analyzing the echo
    from the server.
    You can check if there is an answer and if the answer is as expected.

    The RFCs of http and sendmail explain what to send and what to expect.

    Regards,
    Reiner

  • Sancho

    Administrator
    January 31, 2007 at 16:03
    2214 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello,

    I’m trying to find a way to check http and smtp status remotely.
    I prefer not to install agent on this machines and I would like to use a linux agent that already exists on other machine.
    Have you any idea how that can be done?

    Regards,
    Vagelis.

    You can use remote_tcp module, using only a “port” open check or using the challenge / response to check protocol.

    ^M is a macro used in challenge/response to send a carriage return (this is documented in Pandora docs).

    For example, to check http

    port 80
    send GET / HTTP/1.0^M^M
    expect OK

    to check SMTP, first make a telnet to server on port 25, and check string returned, for example in my server it says:

    220 endor ESMTP Postfix (GNU/Linux)

    So configure a tcp check in Pandora console similar to

    port 25
    send ^M
    receive 220 endor ESMTP Postfix

    Making this you dont need to use agents, only remote monitoring.

    Wish this helps 🙂

  • x_vag

    Member
    January 31, 2007 at 18:36
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thanks nil…

    Your advice is very usefull!
    I’m working on this now…

  • x_vag

    Member
    February 7, 2007 at 18:18
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    ok… I found a way to check smtp and http status…

    I wrote one script for each status…

    For smtp status is the following:

    #!/usr/bin/expect -f
    spawn telnet yourdomain.com 25
    send “quitr”
    expect eof

    and with the next module I can get a number (220) needed in order to use it in alert (min/max values)…

    module_begin
    module_name testmail
    module_type generic_data
    module_exec testmail | head -6 | tail -1 | cut -b -3
    module_description mail_status
    module_end

    With http status things are similar, but instead of port 25 you must telnet port 80, and also find the correct “combination” with head, tail and cut commands to get a number…

    I hope this help somebody…
    Vagelis.