Pages: [1]   Go Down
Author Topic: Can I check http and smtp remotely?  (Read 363 times)
0 Members and 2 Guests are viewing this topic.
x_vag
Full Member
***

Karma: 0
Offline Offline

Posts: 25


View Profile
« on: January 26, 2007, 02:21:01 PM »

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.
« Last Edit: January 01, 1970, 01:00:00 AM by x_vag » Logged

Dassing
Newbie
*

Karma: 0
Offline Offline

Posts: 9


View Profile
« Reply #1 on: January 31, 2007, 10:21:48 AM »

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
« Last Edit: January 01, 1970, 01:00:00 AM by Dassing » Logged

Sancho Lerena
Administrator
Expert member
*****

Karma: 24
Offline Offline

Posts: 1151


I can see everything... with my glasses :-)


View Profile WWW
« Reply #2 on: January 31, 2007, 01:03:28 PM »

Quote from: "x_vag"
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 :-)
« Last Edit: January 01, 1970, 01:00:00 AM by nil » Logged

-- See you in the other screen.

x_vag
Full Member
***

Karma: 0
Offline Offline

Posts: 25


View Profile
« Reply #3 on: January 31, 2007, 03:36:43 PM »

Thanks nil...

Your advice is very usefull!
I'm working on this now...
« Last Edit: January 01, 1970, 01:00:00 AM by x_vag » Logged

x_vag
Full Member
***

Karma: 0
Offline Offline

Posts: 25


View Profile
« Reply #4 on: February 07, 2007, 03:18:38 PM »

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 "quit\r"
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.
« Last Edit: January 01, 1970, 01:00:00 AM by x_vag » Logged

Pages: [1]   Go Up
Print
 
Jump to:  


SourceForge.net Logo  This site is monitored by Pandora FMS   ArticaST