From owner-freebsd-questions@FreeBSD.ORG Tue Jan 3 10:36:42 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9B0516A41F for ; Tue, 3 Jan 2006 10:36:42 +0000 (GMT) (envelope-from kamara@trueafrican.com) Received: from mail.trueafrican.com (mail.trueafrican.com [212.88.98.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B47E43D55 for ; Tue, 3 Jan 2006 10:36:40 +0000 (GMT) (envelope-from kamara@trueafrican.com) Received: from mail.trueafrican.com ([127.0.0.1]) by localhost (mail.trueafrican.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04540-05; Tue, 3 Jan 2006 13:37:02 +0300 (EAT) Received: from atlas (atlas.trueafrican.com [169.254.0.5]) by mail.trueafrican.com (Postfix) with ESMTP id 5639C25F125; Tue, 3 Jan 2006 13:36:59 +0300 (EAT) From: "Eric Kamara" To: "'Halid Faith'" Date: Tue, 3 Jan 2006 13:31:21 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: <019a01c6104a$ec9c7a20$dc96eed5@ihlasnetym> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Thread-Index: AcYQSzvjKxfFG2aOTVSU474smTDATAABUF4g Message-Id: <20060103103659.5639C25F125@mail.trueafrican.com> X-Virus-Scanned: by amavisd-new at trueafrican.com Cc: freebsd-questions@freebsd.org Subject: RE: check script for tcp connection X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2006 10:36:43 -0000 > -----Original Message----- > From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd- > questions@freebsd.org] On Behalf Of Halid Faith > Sent: Tuesday, January 03, 2006 12:49 PM > To: freebsd-questions@freebsd.org > Subject: check script for tcp connection > > Hello > > I use FreeBSD6.0. I want to use a script to check two or more case. > My first cases are as below; > First case My Server will check the remote ip address alive or not as icmp > Second case My server will connect to other remote ip address as tcp > protocol like connected or not. > > if my server could not see the remote ip address AND not connect tcp > connection, My server will send an email me. > > How can I write a simple script about that ? Why don't you try out monit(/usr/ports/sysutils/monit) in the ports? It can do that and much more and yet is very easy to configure. Regards, Eric