= Actionについて =
== forward アクション ==
別のサーバーで稼働している EWatch サービスにイベントを転送します。
転送先の EWatch サービスは Server 設定でポート番号が指定されている必要があります。
転送元でポート番号を省略した場合は 31301 ポートに送信されます。
||Destination||転送先のホスト名(またはIPアドレス)とポート番号||
{{{ code javascript
{
name: "forwardTest",
type: "forward",
Destination: "192.168.1.2:31301"
}
}}}
== execute アクション ==
!CommandLine で指定したコマンドを実行します。
コマンドラインの解析は cmd.exe に任せています。つまり、cmd.exe /c "'''''!CommandLine'''''" の形式で実行されます。
実行ユーザーを指定する事はできません。サービス起動ユーザーで実行されます。
||!CommandLine||実行するコマンドを指定する。||
!CommandLine にはログを参照する変数のようなものを記述することができます。
||$timestamp||タイムスタンプ。書式は yyyy-MM-dd HH:mm:ss.fff。||
||$hostname||ログが発生したホスト名。||
||$source||ログの発生元。イベントログのソースに該当する。||
||$level||エラー(E)、警告(W)、情報(I) の何れかの文字。||
||$code||メッセージコード。イベントログのイベントIDに該当する。||
||$message||メッセージ文。||
{{{ code javascript
{
name: "growlTest",
type: "execute",
CommandLine: ""C:\\Program Files (x86)\\Growl for Windows\\growlnotify.exe" /t:EWatch "$message""
}
}}}
== smtp アクション ==
!ServerHost で指定したSMTPサーバーを使用してメールを送信します。
||!ServerHost||SMTPサーバーとポート番号を指定する。ポート番号は省略可能で、省略時は25となる。||
||!FromAddress||送信者Eメールアドレスを指定する。宛先を間違った場合等のリターンメールが届く場合がある。||
||!ToAddress||宛先Eメールアドレスを指定する。複数指定する場合はカンマ(,)で区切る。||
||Protection||接続保護モードを指定する。None、!StartTls、!SslTls のいずれか。||
||!AuthMethod||認証方式を指定する。None、Plain、Loginのいずれか。||
||UserID||認証方式がNone以外の場合の接続ユーザーIDを指定する。||
||Password||認証方式がNone以外の場合の接続パスワードを指定する。||
{{{ code javascript
{
name: "smtpTest",
type:"smtp",
FromAddress:"user@example.com",
ToAddress:"user2@example.com,user@example.com",
ServerHost:"192.168.1.2:25"
}
}}}
== syslog アクション ==
!RemoteHost で指定したsyslogサーバーにログを送信します。
||!RemoteHost||syslogサーバーを指定する。ポート番号は514固定。||
{{{ code javascript
{
name: "syslogTest",
type: "syslog",
RemoteHost: "syslog01"
}
}}}
== mantis アクション ==
!BaseUrl で指定したMantisBTに障害を登録します。
||!BaseUrl||MantisBTのURLを指定する。例えば !http://192.168.1.2/mantis/ のように最後にスラッシュを付ける。||
||Project||MantisBT上のプロジェクト名を指定する。||
||UserID||投稿する為にログインするユーザーIDを指定する。||
||Password||投稿する為にログインする時のパスワードを指定する。||
{{{ code javascript
{
name: "mantisTest",
type: "mantis",
BaseUrl: "http://192.168.1.2/mantis/",
UserID: "ewatch",
Password: "ewatch",
Project: "プロジェクトA"
}
}}}
== redmine アクション ==
!BaseUrl で指定した Redmine にチケットを登録します。
APIキーを使用するため、Redmineの個人設定ページ(.../my/account)でAPIキーを確認する必要があります。
||!BaseUrl||RedmineのURLを指定する。最後にスラッシュを付ける。||
||APIKey||APIキー||
||ProjectID||プロジェクトID||
||TrackerID||トラッカーID||
{{{ code javascript
{
name: "redmineTest",
type: "redmine",
BaseUrl": "https://192.168.1.2/redmine/",
APIKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ProjectID": "project_a",
TrackerID": "1"
}
}}}
== slack アクション ==
URL で指定した Slack の webhook で通知をします。
||URL||Slack の webhook url を指定する。||
||Attachments||通知メッセージの Attachments をJSON形式で指定する。||
||!IconEmoji||通知メッセージのアイコンを指定する。コロン(:)で囲んだものを指定する。||
||!UserName||通知メッセージの表示ユーザー名を指定する。||
||Channel||通知先チャンネルを指定する。(省略時はWebhookで指定したチャネルに通知)||
{{{ code javascript
{
name: "slackTest",
type: "slack",
URL: "https://hooks.slack.com/services/xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
Attachments: "{ color:\"#c86b09\", pretext:\"エラーまたは警告が発生しました。\" }",
IconEmoji: ":notificator:",
UserName: "ErrorNotificator",
Channel: "#channelA"
}
}}}
== teams アクション ==
URL で指定した MS Teams の webhook で通知をします。
||URL||Teams の webhook url を指定する。||
||!ThemeColor||テーマカラーを RRGGBB 形式で指定する。||
{{{ code javascript
{
name: "teamsTest",
type: "teams",
URL: "https://outlook.office.com/webhook/xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ThemeColor: "FF9178"
}
}}}