running afacli in a cron job

Hubbard, David dhubbard at
Thu Nov 28 13:17:00 CST 2002

Put all of your afacli commands into a text file and feed
it in using afacli's support for the @<file> argument.
I have a cron that runs this command:

afacli @disk-check.txt

And in the file disk-check.txt it just has this:
open afa0
disk list
container list
enclosure show status

So then my cron makes sure no disks are dead and the
temperatures aren't too high.


> -----Original Message-----
> From: Pierre Wendling [mailto:pwendling at] 
> Sent: Thursday, November 28, 2002 2:02 PM
> To: linux-poweredge at
> Subject: running afacli in a cron job
> Hi,
> Test config is a PE2500, PERC 3/Di, running RedHat 7.3 with 
> afaapps-2.6-1 installed
> I have a perl script that calls afacli, send commands on it's 
> stdin and 
> parse the output. Everything works fine when called from a 
> shell script 
> launched from an interactive shell (i.e. with a tty), but as 
> soon as I 
> try to call it from the same shell script submitted as a 
> cron/at job, it 
> fails with the following message in the log:
> Error opening terminal: unknown
> I guess that's because afacli tries to use fancy tty features 
> for it's CLI.
> However, I need to monitor the status of the RAID volumes and 
> individual 
> disks for multiple remote systems, and feed that into our monitoring 
> framework. So I tried every possible way of calling afacli I 
> could think 
> of (shell script, perl, pipes, redirections, etc.) and 
> couldn't find a 
> way to run my script from cron.
> I tried to do something as close as I could to the example on Matt 
> Domsch page, and I can not see how it could possibly work !
> Has anybody tried to do that ?
> Would it be possible to get something more in the Unix spirit than 
> afacli ? Like something that doesnt do stupid things with the tty but 
> just reads and executes commands so that you can use it in scripts ???
> Pierre Wendling
> Sopra Group, Annecy, France
> _______________________________________________
> Linux-PowerEdge mailing list
> Linux-PowerEdge at
> Please read the FAQ at or search 
> the list archives at

More information about the Linux-PowerEdge mailing list