Re: Log repair from a script

From: ljm (me_at_here.there)
Date: 12/14/04


Date: Tue, 14 Dec 2004 18:40:35 +0100

Andreas Schulze wrote:

> "ljm" <me@here.there> schrieb im Newsbeitrag
> news:3ljcpc.olj.ln@cercamon.home...
>> Hi,
>>
>> We have several older dual power-supply systems running. Usually, when
> power
>> on one of the two fails, we need to do a "log repair" when power comes
> back
>> on. When a single system fails, it's easy to do this via diag.
>>
>> Next weekend, there are some power tests. This means, that a log repair
> must
>> be done twice on +/- 50 systems. Doing this interactively via diag will
>> take a lot of time. However, I could not find a way to do this from the
>> comandline (or via a script). Anybody know how to do this?
>>
>> Also, it would be nice to know the status of the power supply. Once
>> again,
> I
>> could not find a way to get this from the commandline or script. Any
> hints?
>>
>> Thanks in advance,
>>
>> ljm
>>
>
> Hallo ljm,
>
> For running diag by script you could use expect and autoexpect. E.g. I
> usually create the script with autoexpect, work it over by hand if
> necessary and run it with expect. Expect rpm is available from the IBM
> Linux Toolbox site. Works for me like a charm. Be aware that you may need
> to adapt the expect script to different servers / oslevels.
> To check the status of the power supply have a look into /etc/rc.powerfail
> and read the manpage of /usr/sbin/machstat.
>
> HTH,
> Andreas

We tried machstat, but that does not always work. The exitcode should
reflect the state of the powersupply. However, some machines continue to
produce exitcode 0 when one of the powercords is pulled.

I'm currently investigating expect.

Lucky for me, tests are postponed. Thanks for the reaction.

ljm

-- 
(c) ljm ( xs4all)    No part of this copyright message may be 
reproduced, read or seen, dead or alive or by any means, including
but not limited to telepathy  without the benevolence of the author.


Relevant Pages

  • Re: Log repair from a script
    ... "ljm" schrieb im Newsbeitrag ... > We have several older dual power-supply systems running. ... there are some power tests. ... > could not find a way to get this from the commandline or script. ...
    (comp.unix.aix)
  • Re: Nut and RAID on FreeBSD 7.0
    ... >> single user mode and run a script that delayed for some time longer ... Plus a similar message for going to battery power. ... Executing upssched from the command line it tells me ... I set my NOTIFYCMD in upsmon.conf to a simple shell script I created to ...
    (freebsd-questions)
  • Re: Power Management GPO?
    ... I suspect that the power management subsystem might not be started when the startup scripts runs or the SYSTEM context can't modify it, but I have some ideas about this and will do some testing later on today to work it out. ... I created a GPO and put the batch file in first as a startup script and when that didn't work I tried it as a logon script. ... A normal user can't change the power settings so a logon script like this won't work either. ... I can't remember if all power setting are per machine, but if some are per machine and some are per user then you could split it up into 2 scripts, one startup script and one logon script. ...
    (microsoft.public.windows.group_policy)
  • Re: RFC: powerd Patch & proposed future changes
    ... script on ac state change? ... battery falls below a configured threshold. ... A notebook ought to generate a battery event when capacity hits its factory set "warning" and "low" marks. ... As I've experienced with power saving, the moment you start doing more and more work to save power, you also end up consuming more power. ...
    (freebsd-current)
  • Re: EvfMgr C: -commit followed by Power Down gives lost changes
    ... > a little utility on this PC is started from a remote computer. ... > a script and connects to an external WebServer to fetch the new software. ... > This might include running a script that modifies Registry, deletes files, ... ... They turn off the power. ...
    (microsoft.public.windowsxp.embedded)