From owner-freebsd-questions@FreeBSD.ORG Wed Aug 10 19:23:35 2005 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 38CB016A41F for ; Wed, 10 Aug 2005 19:23:35 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D445643D46 for ; Wed, 10 Aug 2005 19:23:34 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j7AJNWnH075020; Wed, 10 Aug 2005 14:23:32 -0500 (CDT) (envelope-from dan) Date: Wed, 10 Aug 2005 14:23:32 -0500 From: Dan Nelson To: "Chad Leigh -- Shire.Net LLC" Message-ID: <20050810192331.GI48947@dan.emsphone.com> References: <1E4F1132-964D-4829-BF81-1017750F362B@shire.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1E4F1132-964D-4829-BF81-1017750F362B@shire.net> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: FreeBSD - Questions Subject: Re: using Linux aaccli in a cron job 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: Wed, 10 Aug 2005 19:23:35 -0000 In the last episode (Aug 10), Chad Leigh -- Shire.Net LLC said: > I have a 5.4-R system with an Adaptec 2200S. I also have Linux > emulation running and the aac_linux kernel module installed and I can > run the aaccli program successfully in a terminal window and use it > to check status of the RAID controller. However, if I do it from a > cron job (same script as I run in a terminal) I get no output. > aaccli uses terminal control commands and I suspect it is detecting > that it is not connected to a terminal and hence not running. > However, I so-far have not been able to get the Cron output to check > for errors due to the fact that the mail server rejects it for not > having a valid From/Sender and cron does not seem to set a From on > its mail or something. Cron should always set From, To, and Subject: fprintf(mail, "From: %s (Cron Daemon)\n", usernm); fprintf(mail, "To: %s\n", mailto); fprintf(mail, "Subject: Cron <%s@%s> %s\n", usernm, first_word(hostname, "."), e->cmd); > Any ideas on how to get this aaccli program to run in a cron job? > > Adaptec really took a step backwards when they went to this aaccli > from the earlier raidutils used with asr devices. The output is > cryptic and a pita to work with. It seems to work for me on a PowerEdge 2550 and a PERC 3/Di card. Putting something like this in cron: /usr/local/bin/aaccli open /readonly aac0 : enclosure show status : disk show smart : container list /full : diagnostic show text gives me a whole lot of info back in the email. -- Dan Nelson dnelson@allantgroup.com