ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Andrey Liakhovets" <liakh@dol.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] NUT и Ippon
Date: Wed, 01 Feb 2012 21:01:55 +0400
Message-ID: <web-1014282008@cgp.dol.ru> (raw)
In-Reply-To: <4F293BA1.3000101@mail.ru>

On Wed, 01 Feb 2012 17:18:25 +0400 Vladimir Karpinsky wrote:
 ...
>Остался один вопрос --- второстепенные компьютеры засыпают раньше,
>могут дать электроэнергию раньше, чем уснёт Мастер.
>Будить собираюсь через etherwake по сигналу ONBATT.
>Как я понимаю, это можно сделать через скрипт, обозначенный в upsmon.conf
>переменной NOTIFYCMD.
>Но, вот, примеров такого скрипта я что-то пока не нашёл.
>Вопрос следующий: что передаётся при вызове этому скрипту?
>Там вероятно надо какой-то case делать, в зависимости от того, по какому
>поводу вызван. Если у кого есть такой пример, покажите, пожалуйста.

Насчёт кастомного NOTIFYCMD не знаю.
Но если вы на slave'ах использовали upssched, то и здесь можно так же.
Что-то вроде:

/etc/nut/upsmon.conf:
...
NOTIFYCMD /usr/sbin/upssched
...
NOTIFYFLAG ONLINE   SYSLOG+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
...

/etc/nut/upssched.conf:
...
CMDSCRIPT /usr/local/sbin/upssched-cmd
...
#AT ONBATT * START-TIMER onbatt 300
#AT ONLINE * CANCEL-TIMER onbatt
AT ONLINE * EXECUTE online

/usr/local/sbin/upssched-cmd:
#!/bin/sh

case "$1" in
  onbatt)
    upsmon -c fsd
    ;;
  online)
    sudo etherwake ...
    sudo etherwake ...
    ;;
  *)
    logger -t upssched-cmd "Unrecognized command: $1"
    ;;
esac

Или сделать в /etc/nut/upssched.conf задержку старта slave'ов:
AT ONLINE * START-TIMER online 30
AT ONBATT * CANCEL-TIMER online

Или даже разные задержки для разных slave'ов (несколько TIMER'ов, и
поправить CMDSCRIPT /usr/local/sbin/upssched-cmd).

Андрей Ляховец


  parent reply	other threads:[~2012-02-01 17:01 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 14:00 Vladimir Karpinsky
2012-01-20 14:07 ` Vladimir Karpinsky
2012-01-21 12:35   ` Sergey Vlasov
2012-01-21 13:05     ` Vladimir Karpinsky
2012-01-21 16:07       ` Sergey Vlasov
2012-01-21 18:29         ` Dubrovskiy Viacheslav
2012-01-21 18:47           ` Vladimir Karpinsky
2012-01-21 18:38         ` Vladimir Karpinsky
2012-01-22 17:18           ` Michael Shigorin
2012-01-22 17:28             ` Vladimir Karpinsky
2012-01-22 17:51               ` Michael Shigorin
2012-01-22 17:59                 ` Vladimir Karpinsky
2012-01-22 21:04                 ` Yura Kalinichenko
2012-01-22 16:12         ` Vladimir Karpinsky
2012-01-22 17:12           ` Yura Kalinichenko
2012-01-22 17:23             ` Vladimir Karpinsky
2012-01-24 14:19             ` Vladimir Karpinsky
2012-01-24 14:37               ` Шенцев Алексей Владимирович
2012-01-24 14:51                 ` Vladimir Karpinsky
2012-01-24 15:00                   ` Шенцев Алексей Владимирович
2012-01-24 15:21                     ` Vladimir Karpinsky
2012-01-24 15:31                       ` Шенцев Алексей Владимирович
2012-01-24 15:39                         ` Vladimir Karpinsky
2012-01-24 15:51                           ` Шенцев Алексей Владимирович
2012-01-24 16:01                             ` Vladimir Karpinsky
2012-01-24 19:48                           ` Sergey Vlasov
2012-01-25 15:50                             ` Vladimir Karpinsky
2012-01-25 20:50                               ` Alexey Borisenkov
2012-01-26  5:27                                 ` Vladimir Karpinsky
2012-01-24 19:04                       ` Andrey Liakhovets
2012-01-24 19:13                         ` Vladimir Karpinsky
2012-02-01 13:18                           ` Vladimir Karpinsky
2012-02-01 16:17                             ` Vladimir Karpinsky
2012-02-02 15:24                               ` Vladimir Karpinsky
2012-02-01 17:01                             ` Andrey Liakhovets [this message]
2012-02-01 17:32                               ` Vladimir Karpinsky
2012-02-01 18:06                                 ` Andrey Liakhovets
2012-02-01 18:11                                   ` Vladimir Karpinsky
2012-01-22 17:37           ` Dubrovskiy Viacheslav
2012-01-21 12:23 ` Sergey Vlasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=web-1014282008@cgp.dol.ru \
    --to=liakh@dol.ru \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git