質問編集履歴
8
質問内容の更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -214,9 +214,23 @@
|
|
214
214
|
|
215
215
|
```
|
216
216
|
|
217
|
-
●実行状況
|
217
|
+
●2019/3/5の実行状況
|
218
|
-
|
218
|
+
|
219
|
-
```ここに言語を入力
|
219
|
+
```ここに言語を入力
|
220
|
+
|
221
|
+
●問題
|
222
|
+
|
223
|
+
プログラム実行時に、プロンプトがかえってこず
|
224
|
+
|
225
|
+
手動でenterキーを押下しないとプログラム実行が完了しない
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
●プログラム
|
232
|
+
|
233
|
+
|
220
234
|
|
221
235
|
srdcs04% cat log_kanshi.sh
|
222
236
|
|
@@ -224,8 +238,6 @@
|
|
224
238
|
|
225
239
|
#--- 変数初期値代入 ------------------------
|
226
240
|
|
227
|
-
echo "test_001"
|
228
|
-
|
229
241
|
export WATCH_FILE="/export/home/srdcs/embulk_test/log/bulkinsert_M_ORG.log"
|
230
242
|
|
231
243
|
export MAIL_CMD="/usr/sbin/sendmail"
|
@@ -236,16 +248,14 @@
|
|
236
248
|
|
237
249
|
export MAIL_LIST="/export/home/srdcs/embulk_test/mail/mail.list"
|
238
250
|
|
251
|
+
export ADDR="xxx@xxxx"
|
252
|
+
|
239
253
|
export ERROR_CODE_001="Error"
|
240
254
|
|
241
255
|
export TIME="`date '+%y/%m/%d %H:%M:%S'`"
|
242
256
|
|
243
257
|
|
244
258
|
|
245
|
-
echo "test_002"
|
246
|
-
|
247
|
-
|
248
|
-
|
249
259
|
#
|
250
260
|
|
251
261
|
# メールヘッダ部作成
|
@@ -266,10 +276,6 @@
|
|
266
276
|
|
267
277
|
|
268
278
|
|
269
|
-
echo "test_003"
|
270
|
-
|
271
|
-
|
272
|
-
|
273
279
|
while read line
|
274
280
|
|
275
281
|
do
|
@@ -280,47 +286,27 @@
|
|
280
286
|
|
281
287
|
echo "error occurred" >> ${MAIL_TMP_FILE}
|
282
288
|
|
283
|
-
echo "test_004"
|
284
|
-
|
285
|
-
${MAIL_CMD} -f embulk_
|
289
|
+
${MAIL_CMD} -f embulk_xxxx@jp.xxxx.com ${ADDR} < ${MAIL_TMP_FILE}
|
286
290
|
|
287
291
|
exit 1
|
288
292
|
|
293
|
+
break;
|
294
|
+
|
289
295
|
fi
|
290
296
|
|
291
297
|
done
|
292
298
|
|
293
299
|
|
294
300
|
|
295
|
-
echo "test_005"
|
296
|
-
|
297
|
-
|
301
|
+
●実行後送付されるメール
|
298
|
-
|
299
|
-
|
302
|
+
|
300
|
-
|
301
|
-
|
303
|
+
|
302
|
-
|
303
|
-
test_002
|
304
|
-
|
305
|
-
test_003
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
Error
|
310
|
-
|
311
|
-
test_004
|
312
|
-
|
313
|
-
srdcs04%
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
srdcs04% cat mail_tmp_file
|
318
304
|
|
319
305
|
=====================
|
320
306
|
|
321
307
|
DATE : 19/03/04 16:35:49
|
322
308
|
|
323
|
-
HOST :
|
309
|
+
HOST : xxxx
|
324
310
|
|
325
311
|
=====================
|
326
312
|
|
@@ -328,12 +314,8 @@
|
|
328
314
|
|
329
315
|
error occurred
|
330
316
|
|
331
|
-
srdcs04%
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
srdcs04%cat mail.list
|
336
|
-
|
337
|
-
|
317
|
+
===========
|
338
|
-
|
318
|
+
|
319
|
+
|
320
|
+
|
339
|
-
```
|
321
|
+
```
|
7
質問更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -213,3 +213,127 @@
|
|
213
213
|
|
214
214
|
|
215
215
|
```
|
216
|
+
|
217
|
+
●実行状況
|
218
|
+
|
219
|
+
```ここに言語を入力
|
220
|
+
|
221
|
+
srdcs04% cat log_kanshi.sh
|
222
|
+
|
223
|
+
#!/bin/bash
|
224
|
+
|
225
|
+
#--- 変数初期値代入 ------------------------
|
226
|
+
|
227
|
+
echo "test_001"
|
228
|
+
|
229
|
+
export WATCH_FILE="/export/home/srdcs/embulk_test/log/bulkinsert_M_ORG.log"
|
230
|
+
|
231
|
+
export MAIL_CMD="/usr/sbin/sendmail"
|
232
|
+
|
233
|
+
export MAIL_TMP_FILE="/export/home/srdcs/embulk_test/mail/mail_tmp_file"
|
234
|
+
|
235
|
+
export CHECK_LOG="/export/home/srdcs/embulk_test/mail/check.log"
|
236
|
+
|
237
|
+
export MAIL_LIST="/export/home/srdcs/embulk_test/mail/mail.list"
|
238
|
+
|
239
|
+
export ERROR_CODE_001="Error"
|
240
|
+
|
241
|
+
export TIME="`date '+%y/%m/%d %H:%M:%S'`"
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
echo "test_002"
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
#
|
250
|
+
|
251
|
+
# メールヘッダ部作成
|
252
|
+
|
253
|
+
#
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
echo "=====================" >> ${MAIL_TMP_FILE}
|
258
|
+
|
259
|
+
echo "DATE : ${TIME}" >> ${MAIL_TMP_FILE}
|
260
|
+
|
261
|
+
echo "HOST : `hostname`" >> ${MAIL_TMP_FILE}
|
262
|
+
|
263
|
+
echo "=====================" >> ${MAIL_TMP_FILE}
|
264
|
+
|
265
|
+
echo "Message:" >> ${MAIL_TMP_FILE}
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
echo "test_003"
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
while read line
|
274
|
+
|
275
|
+
do
|
276
|
+
|
277
|
+
cat ${WATCH_FILE} | grep "${ERROR_CODE_001}"
|
278
|
+
|
279
|
+
if [ $? = "0" ];then
|
280
|
+
|
281
|
+
echo "error occurred" >> ${MAIL_TMP_FILE}
|
282
|
+
|
283
|
+
echo "test_004"
|
284
|
+
|
285
|
+
${MAIL_CMD} -f embulk_`hostname`@jp.yazaki.com ${MAIL_LIST} < ${MAIL_TMP_FILE}
|
286
|
+
|
287
|
+
exit 1
|
288
|
+
|
289
|
+
fi
|
290
|
+
|
291
|
+
done
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
echo "test_005"
|
296
|
+
|
297
|
+
srdcs04%
|
298
|
+
|
299
|
+
srdcs04% /bin/bash log_kanshi.sh
|
300
|
+
|
301
|
+
test_001
|
302
|
+
|
303
|
+
test_002
|
304
|
+
|
305
|
+
test_003
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
Error
|
310
|
+
|
311
|
+
test_004
|
312
|
+
|
313
|
+
srdcs04%
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
srdcs04% cat mail_tmp_file
|
318
|
+
|
319
|
+
=====================
|
320
|
+
|
321
|
+
DATE : 19/03/04 16:35:49
|
322
|
+
|
323
|
+
HOST : srdcs04
|
324
|
+
|
325
|
+
=====================
|
326
|
+
|
327
|
+
Message:
|
328
|
+
|
329
|
+
error occurred
|
330
|
+
|
331
|
+
srdcs04%
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
srdcs04%cat mail.list
|
336
|
+
|
337
|
+
xxx.xxx@xxx.com
|
338
|
+
|
339
|
+
```
|
6
質問内容更新
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
solaris 11 bashで監視スクリプト
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
solaris 11のcronを使って、コマンドを実行しています。
|
1
|
+
solaris 11のcronを使って、コマンドを実行しています。
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
シェルスクリプトAを改修して、コマンド実行判定をして(echo $
|
9
|
+
シェルスクリプトAを改修して、コマンド実行判定をして(echo $!)
|
10
10
|
|
11
11
|
➀正常な場合には、次のステップでログ監視
|
12
12
|
|
@@ -148,82 +148,68 @@
|
|
148
148
|
|
149
149
|
```
|
150
150
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
Message-ID: <201903010149.x211nGnv022558@xxx.xx.xx.co.jp>
|
218
|
-
|
219
|
-
MIME-Version: 1.0
|
220
|
-
|
221
|
-
Content-Type: text/plain; charset="utf-8"
|
222
|
-
|
223
|
-
To: Undisclosed recipients:;
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
```
|
151
|
+
ログ監視シェルスクリプト
|
152
|
+
|
153
|
+
```ここに言語を入力
|
154
|
+
|
155
|
+
log_kanshi.sh
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
#--- 変数初期値代入 ------------------------
|
162
|
+
|
163
|
+
export WATCH_FILE="/export/home/srdcs/embulk_test/log/bulkinsert_M_ORG.log"
|
164
|
+
|
165
|
+
export MAIL_CMD="/usr/sbin/sendmail"
|
166
|
+
|
167
|
+
export MAIL_TMP_FILE="/export/home/srdcs/embulk_test/mail/mail_tmp_file"
|
168
|
+
|
169
|
+
export CHECK_LOG="/export/home/srdcs/embulk_test/mail/check.log"
|
170
|
+
|
171
|
+
export MAIL_LIST="/export/home/srdcs/embulk_test/mail/mail.list"
|
172
|
+
|
173
|
+
export ERROR_CODE_001="Error"
|
174
|
+
|
175
|
+
export TIME="`date '+%y/%m/%d %H:%M:%S'`"
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
hit_action() {
|
180
|
+
|
181
|
+
while read line
|
182
|
+
|
183
|
+
do
|
184
|
+
|
185
|
+
echo ${WATCH_FILE} | grep -q "${ERROR_CODE_001}"
|
186
|
+
|
187
|
+
if [ $? = "0" ];then
|
188
|
+
|
189
|
+
echo "error occurred" >> ${MAIL_TMP_FILE}
|
190
|
+
|
191
|
+
${MAIL_CMD} -f embulk_`hostname`@jp.yazaki.com ${ADDR} < ${MAIL_TMP_FILE}
|
192
|
+
|
193
|
+
fi
|
194
|
+
|
195
|
+
done
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
if [ ! -f ${WATCH_FILE} ]; then
|
202
|
+
|
203
|
+
touch ${WATCH_FILE}
|
204
|
+
|
205
|
+
fi
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
tail -n 0 --follow=name --retry $TARGET_LOG | hit_action~
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
```
|
5
質問更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,47 +98,19 @@
|
|
98
98
|
|
99
99
|
```ここに言語を入力
|
100
100
|
|
101
|
-
➀ログファイル監視のロジック部分(コーディング方法)が無限ループする記述しかわからず、ある特定の処理(コマンド実行)が終わったら、コマンド実行後に出力されるログファイルを監視するだけにしたいです。(1つのシェルスクリプトで完結させたい。)
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
setenv TARGET_LOG "/log/test.log"
|
106
|
-
|
107
|
-
setenv _error_conditions "Error"
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
101
|
+
➀ログファイル監視について
|
112
|
-
|
113
|
-
|
102
|
+
|
114
|
-
|
115
|
-
|
103
|
+
|
116
|
-
|
117
|
-
|
104
|
+
|
118
|
-
|
119
|
-
|
105
|
+
test.cmd >> test.log
|
120
|
-
|
121
|
-
|
106
|
+
|
122
|
-
|
123
|
-
|
107
|
+
|
124
|
-
|
125
|
-
|
108
|
+
|
126
|
-
|
127
|
-
done
|
128
|
-
|
129
|
-
}
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
if [ ! -f ${TARGET_LOG} ]; then
|
134
|
-
|
135
|
-
touch ${TARGET_LOG}
|
136
|
-
|
137
|
-
fi
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
t
|
109
|
+
test.logファイルを特定の文字列(Error)で検索し、エラーがあった場合にエラー内容をメール送信させたい
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
※前回検索した行以降としたいです。
|
142
114
|
|
143
115
|
|
144
116
|
|
4
質問更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -210,29 +210,29 @@
|
|
210
210
|
|
211
211
|
for <xxx.xxx@xxx.com>; Fri, 1 Mar 2019 10:49:19 +0900 (JST)
|
212
212
|
|
213
|
-
Received: from unknown (HELO
|
213
|
+
Received: from unknown (HELO xxxxxx.jp.xxxxx.com) ([106.186.192.36])
|
214
214
|
|
215
215
|
by esa9.hc3012-19.iphmx.com with ESMTP; 01 Mar 2019 10:49:19 +0900
|
216
216
|
|
217
|
-
Received: from ykhdc21ws024015.jp.
|
217
|
+
Received: from ykhdc21ws024015.jp.xxxxx.local ([10.194.24.15])
|
218
|
-
|
218
|
+
|
219
|
-
by
|
219
|
+
by xxxxxx.jp.xxxxx.com (sendmail) with ESMTP id x211nH9M024973
|
220
220
|
|
221
221
|
for <xxx.xxx@xxx.com>; Fri, 1 Mar 2019 10:49:17 +0900
|
222
222
|
|
223
|
-
Received: from
|
223
|
+
Received: from xxx.xx.xx.co.jp (10.1.31.75) by exchange.jp.xxxxx.com
|
224
224
|
|
225
225
|
(10.194.24.15) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 1 Mar
|
226
226
|
|
227
227
|
2019 10:49:17 +0900
|
228
228
|
|
229
|
-
Received: from
|
229
|
+
Received: from xxx.xx.xx.co.jp (localhost [127.0.0.1]) by
|
230
|
-
|
230
|
+
|
231
|
-
|
231
|
+
xxx.xx.xx.co.jp (8.14.5+Sun/8.14.5) with ESMTP id x211nG1M022559 for
|
232
232
|
|
233
233
|
<xxx.xxx@xxx.com>; Fri, 1 Mar 2019 10:49:16 +0900 (JST)
|
234
234
|
|
235
|
-
Received: (from
|
235
|
+
Received: (from xxxx@localhost) by xxx.xx.xx.co.jp
|
236
236
|
|
237
237
|
(8.14.5+Sun/8.14.5/Submit) id x211nGnv022558 for xxx.xxx@xxx.com
|
238
238
|
|
@@ -242,7 +242,7 @@
|
|
242
242
|
|
243
243
|
From: <xxx@xxx.xx.xxx.co.jp>
|
244
244
|
|
245
|
-
Message-ID: <201903010149.x211nGnv022558@
|
245
|
+
Message-ID: <201903010149.x211nGnv022558@xxx.xx.xx.co.jp>
|
246
246
|
|
247
247
|
MIME-Version: 1.0
|
248
248
|
|
@@ -250,4 +250,8 @@
|
|
250
250
|
|
251
251
|
To: Undisclosed recipients:;
|
252
252
|
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
253
|
-
```
|
257
|
+
```
|
3
質問内容の更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -176,4 +176,78 @@
|
|
176
176
|
|
177
177
|
```
|
178
178
|
|
179
|
+
|
180
|
+
|
181
|
+
➁についてメールヘッダー
|
182
|
+
|
183
|
+
```ここに言語を入力
|
184
|
+
|
185
|
+
Return-Path: <xxx@xxx.xx.xxx.co.jp>
|
186
|
+
|
187
|
+
Delivered-To: xxx@xxx.net
|
188
|
+
|
189
|
+
Received: from mas16.kagoya.net
|
190
|
+
|
191
|
+
by mas16.kagoya.net with LMTP id eNNjMqKPeFxTGAAAA3Lt0w
|
192
|
+
|
193
|
+
for <xxx@xxx.net>; Fri, 01 Mar 2019 10:49:22 +0900
|
194
|
+
|
195
|
+
Received: from fmail02.kagoya.net (fmail02.kagoya.net [203.142.195.186])
|
196
|
+
|
197
|
+
by mas16.kagoya.net (Postfix) with ESMTP id 65FC640762DF
|
198
|
+
|
199
|
+
for <xxx@xxx.net>; Fri, 1 Mar 2019 10:49:20 +0900 (JST)
|
200
|
+
|
201
|
+
Received: from dmail03.kagoya.net (dmail03.kagoya.net [210.134.58.253])
|
202
|
+
|
203
|
+
by fmail02.kagoya.net with ESMTP id x211nKsV019758-x211nKsW019758
|
204
|
+
|
205
|
+
for <xxx@xxx.net>; Fri, 1 Mar 2019 10:49:20 +0900
|
206
|
+
|
207
|
+
Received: from esa9.hc3012-19.iphmx.com (esa9.hc3012-19.iphmx.com [139.138.32.61])
|
208
|
+
|
209
|
+
by dmail03.kagoya.net (Postfix) with ESMTP id D7B224242862
|
210
|
+
|
211
|
+
for <xxx.xxx@xxx.com>; Fri, 1 Mar 2019 10:49:19 +0900 (JST)
|
212
|
+
|
213
|
+
Received: from unknown (HELO ykhdc21ws012016.jp.yazaki.com) ([106.186.192.36])
|
214
|
+
|
215
|
+
by esa9.hc3012-19.iphmx.com with ESMTP; 01 Mar 2019 10:49:19 +0900
|
216
|
+
|
217
|
+
Received: from ykhdc21ws024015.jp.yazaki.local ([10.194.24.15])
|
218
|
+
|
219
|
+
by ykhdc21ws012016.jp.yazaki.com (sendmail) with ESMTP id x211nH9M024973
|
220
|
+
|
221
|
+
for <xxx.xxx@xxx.com>; Fri, 1 Mar 2019 10:49:17 +0900
|
222
|
+
|
223
|
+
Received: from srdcs04.sys.yzk.co.jp (10.1.31.75) by exchange.jp.yazaki.com
|
224
|
+
|
225
|
+
(10.194.24.15) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 1 Mar
|
226
|
+
|
227
|
+
2019 10:49:17 +0900
|
228
|
+
|
229
|
+
Received: from srdcs04.sys.yzk.co.jp (localhost [127.0.0.1]) by
|
230
|
+
|
231
|
+
srdcs04.sys.yzk.co.jp (8.14.5+Sun/8.14.5) with ESMTP id x211nG1M022559 for
|
232
|
+
|
233
|
+
<xxx.xxx@xxx.com>; Fri, 1 Mar 2019 10:49:16 +0900 (JST)
|
234
|
+
|
235
|
+
Received: (from srdcs@localhost) by srdcs04.sys.yzk.co.jp
|
236
|
+
|
237
|
+
(8.14.5+Sun/8.14.5/Submit) id x211nGnv022558 for xxx.xxx@xxx.com
|
238
|
+
|
239
|
+
Fri, 1 Mar 2019 10:49:16 +0900 (JST)
|
240
|
+
|
241
|
+
Date: Fri, 1 Mar 2019 10:49:16 +0900
|
242
|
+
|
179
|
-
c
|
243
|
+
From: <xxx@xxx.xx.xxx.co.jp>
|
244
|
+
|
245
|
+
Message-ID: <201903010149.x211nGnv022558@srdcs04.sys.yzk.co.jp>
|
246
|
+
|
247
|
+
MIME-Version: 1.0
|
248
|
+
|
249
|
+
Content-Type: text/plain; charset="utf-8"
|
250
|
+
|
251
|
+
To: Undisclosed recipients:;
|
252
|
+
|
253
|
+
```
|
2
質問内容更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,7 +98,47 @@
|
|
98
98
|
|
99
99
|
```ここに言語を入力
|
100
100
|
|
101
|
+
➀ログファイル監視のロジック部分(コーディング方法)が無限ループする記述しかわからず、ある特定の処理(コマンド実行)が終わったら、コマンド実行後に出力されるログファイルを監視するだけにしたいです。(1つのシェルスクリプトで完結させたい。)
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
setenv TARGET_LOG "/log/test.log"
|
106
|
+
|
107
|
+
setenv _error_conditions "Error"
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
hit_action() {
|
112
|
+
|
113
|
+
while read i
|
114
|
+
|
115
|
+
do
|
116
|
+
|
117
|
+
echo $i | grep -q "${_error_conditions}"
|
118
|
+
|
119
|
+
if [ $? = "0" ];then
|
120
|
+
|
121
|
+
echo "エラー検知" >> ${MAIL_TMP_FILE}
|
122
|
+
|
123
|
+
${MAIL_CMD} -f `hostname`@xxx.com ${ADDR} < ${MAIL_TMP_FILE}
|
124
|
+
|
125
|
+
fi
|
126
|
+
|
127
|
+
done
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
|
101
|
-
|
133
|
+
if [ ! -f ${TARGET_LOG} ]; then
|
134
|
+
|
135
|
+
touch ${TARGET_LOG}
|
136
|
+
|
137
|
+
fi
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
tail -n 0 --follow=name --retry $TARGET_LOG | hit_action
|
102
142
|
|
103
143
|
|
104
144
|
|
1
質問内容の更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -94,4 +94,46 @@
|
|
94
94
|
|
95
95
|
```
|
96
96
|
|
97
|
+
※質問内容追記
|
98
|
+
|
99
|
+
```ここに言語を入力
|
100
|
+
|
101
|
+
➀ログファイル監視のロジック部分(コーディング方法)がわからないです。
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
➁日付のセットについて
|
106
|
+
|
107
|
+
setenv TIME 'date "+%y/%m/%d %H:%M:%S"`
|
108
|
+
|
109
|
+
指定があいまいです。
|
110
|
+
|
111
|
+
と言われます。
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
➂sendmailコマンドのメール本文送付設定について
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
setenv MAIL_CMD "/usr/sbin/sendmail"
|
120
|
+
|
121
|
+
setenv MAIL_TMP_FILE "/mail_tmp_file"
|
122
|
+
|
123
|
+
setenv CHECK_LOG "/check.log"
|
124
|
+
|
125
|
+
setenv ADDR "xxx@xxx.com"
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
echo "メール送信テスト" >> ${MAIL_TMP_FILE}
|
130
|
+
|
131
|
+
${MAIL_CMD} -f `hostname`@xxx.com ${ADDR} < ${MAIL_TMP_FILE}
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
⇒メール本文内容が文字化けします。。。
|
136
|
+
|
137
|
+
```
|
138
|
+
|
97
139
|
cshでの監視スクリプトについて、ご教示の程宜しくお願い致します。
|