OSDN Git Service

Some translation.
[karesansui/karesansui.git] / karesansui / templates / default / hostby1watch / hostby1watch.input
1 <%doc>Copyright (C) 2010 HDE, Inc.</%doc>
2 <%inherit file="../include/common.part" />
3
4 <script type="text/javascript">
5 <!--
6 function validates_watch(){
7     var check = true;
8     ERROR_MSG = "";
9
10     check = check_string(
11                     $("#watch_name"),
12                     CHECK_EMPTY | CHECK_ONLYSPACE,
13                     "${_('Name')}",
14                     null,
15                     null,
16                     null
17                 ) && check;
18
19     check = check_number(
20                     $("#continuation_count"),
21                     CHECK_EMPTY | CHECK_VALID | CHECK_MIN | CHECK_MAX,
22                     "${_('continuation_count')}",
23                     CONTINUATION_COUNT_MIN,
24                     CONTINUATION_COUNT_MAX
25                 ) && check;
26
27     check = check_number(
28                     $("#prohibition_period"),
29                     CHECK_EMPTY | CHECK_VALID | CHECK_MIN | CHECK_MAX,
30                     "${_('prohibition_period')}",
31                     PROHIBITION_PERIOD_MIN,
32                     PROHIBITION_PERIOD_MAX
33                 ) && check;
34
35     if ($("#threshold_fraction").val() == "0"){
36         check = check_number(
37                         $("#threshold_val1"),
38                         CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
39                         $("#threshold_val1_label").text(),
40                         THRESHOLD_VAL_MIN,
41                         null
42                     ) && check;
43
44         check = check_number(
45                         $("#threshold_val2"),
46                         CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
47                         $("#threshold_val2_label").text(),
48                         THRESHOLD_VAL_MIN,
49                         null
50                     ) && check;
51     } else {
52         check = check_fraction(
53                         $("#threshold_val1"),
54                         CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
55                         $("#threshold_val1_label").text(),
56                         THRESHOLD_VAL_MIN,
57                         null,
58                         parseInt($("#threshold_fraction").val())
59                     ) && check;
60
61         check = check_fraction(
62                         $("#threshold_val2"),
63                         CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
64                         $("#threshold_val2_label").text(),
65                         THRESHOLD_VAL_MIN,
66                         null,
67                         parseInt($("#threshold_fraction").val())
68                     ) && check;
69     }
70
71     if ($("#threshold_type").val() == "max"){
72         check = check_number(
73                         $("#threshold_val1"),
74                         CHECK_MAX,
75                         $("#threshold_val1_label").text(),
76                         null,
77                         $("#threshold_val2").val()
78                 ) && check;
79     } else if ($("#threshold_type").val() == "min"){
80         check = check_number(
81                         $("#threshold_val2"),
82                         CHECK_MIN,
83                         $("#threshold_val2_label").text(),
84                         $("#threshold_val1").val(),
85                         null
86                 ) && check;
87     }
88
89     if ($("#notify_mail_from").val() != ""){
90         check = check_mailaddress(
91                     $("#notify_mail_from"),
92                     CHECK_LENGTH | CHECK_VALID,
93                     "${_('Mail From')}",
94                     null,
95                     EMAIL_MIN_LENGTH,
96                     EMAIL_MAX_LENGTH
97                 ) && check;
98     }
99
100     if ($("#notify_mail_to").val() != ""){
101         check = check_mailaddress(
102                     $("#notify_mail_to"),
103                     CHECK_LENGTH | CHECK_VALID,
104                     "${_('Mail To')}",
105                     null,
106                     EMAIL_MIN_LENGTH,
107                     EMAIL_MAX_LENGTH
108                 ) && check;
109     }
110
111     if(!check){
112         show_alert_msg("${_('Please input correct value.')}\n" + ERROR_MSG);
113     }
114
115     return check;
116 };
117
118 function show_target_section(target) {
119     $("#watch_setting div[id$='section']:visible").hide();
120     $("#" + target + "-section").show();
121 }
122
123 function show_libvirt_target_section(target) {
124     var target_list = new Array();
125     target_list.push("cpu");
126     target_list.push("disk");
127     target_list.push("network");
128
129     var dom_info = new Array();
130
131 % for domname in dom_info.keys():
132         dom_info["${domname}"] = {'vcpu': ${dom_info[domname]['vcpu']},
133                                               'network': new Array(),
134                                               'disk': new Array(),
135                               };
136     % for network in dom_info[domname]["network"]:
137         dom_info["${domname}"]['network'].push("${network}");
138     % endfor 
139     % for disk in dom_info[domname]["disk"]:
140         dom_info["${domname}"]['disk'].push("${disk}");
141     % endfor
142 % endfor
143
144     $.each(target_list, function(index, value){
145         if (target == value) {
146             if (target == "cpu") {
147                 $("#libvirt_vcpu_target").after($("#libvirt_vcpu_target").clone()).remove();
148                 $("#libvirt_vcpu_target").html("");
149                 $("#libvirt_vcpu_target").append($('<option>').attr({ value: "total"}).text("${_('Total')}"));
150                 for (i = 1; i <= dom_info[$("#libvirt_target_machine").val()]['vcpu']; i = i + 1) {
151                         $("#libvirt_vcpu_target").append($('<option>').attr({ value: i}).text(i));
152                 }
153             }
154             if (target == "disk") {
155                 $("#libvirt_disk_target").after($('#libvirt_disk_target').clone()).remove();
156                 $("#libvirt_disk_target").html("");
157
158                 $.each(dom_info[$("#libvirt_target_machine").val()]["disk"], function(index, value){
159                         $("#libvirt_disk_target").append($('<option>').attr({ value: value}).text(value));
160                 });
161             }
162             if (target == "network") {
163                 $("#libvirt_target_interface").after($("#libvirt_target_interface").clone()).remove();
164                 $("#libvirt_target_interface").html("");
165                 $.each(dom_info[$("#libvirt_target_machine").val()]["network"], function(index, value){
166                         $("#libvirt_target_interface").append($('<option>').attr({ value: value}).text(value));
167                 });
168             }
169             $("#${plugins['libvirt']}-" + value + "-section").show();
170         } else {
171             $("#${plugins['libvirt']}-" + value + "-section").hide();
172         }
173     });
174 }
175
176 function set_mail_template(severity,lang) {
177     target = $("#watch_target").val();
178     uri = "${ctx.homepath}${ctx.path}".replace(".part", "");
179     ajax_json(
180         uri + "/" + target + "/" + lang + ".json",
181         target,
182         function(data, status) {
183             if(severity == "warning") {
184                 $("#warning_mail_body").val(data.mail_template_warning);
185             }
186             if(severity == "failure") {
187                 $("#failure_mail_body").val(data.mail_template_failure);
188             }
189             if(severity == "okay") {
190                 $("#okay_mail_body").val(data.mail_template_okay);
191             }
192         },
193         true
194     );
195 }
196
197 function set_threshold_slider(target) {
198     $("#threshold_percentage").hide();
199     $("#threshold_fraction").val("0");
200
201     switch (target){
202         case "${plugins['cpu']}":
203         set_slider("#threshold_setting",0, MAX_JIFFIES_PER_SEC, Math.floor(MAX_JIFFIES_PER_SEC * 0.2), Math.floor(MAX_JIFFIES_PER_SEC * 0.8), "jiffies/sec");
204             break;
205         case "${plugins['memory']}":
206             var memory_size = parseInt(${memory_size});
207             set_slider("#threshold_setting",0,memory_size, Math.floor(memory_size * 0.2), Math.floor(memory_size * 0.8), "MB");
208             break;
209         case "${plugins['df']}":
210             var target_disk = $('#df_target_fs').val();
211             var disk_size = ${disk_size_info}[target_disk]
212
213             $("#threshold_percentage").change(function() {
214                 var threshold_val1 = $("#threshold_val1").val();
215                 var threshold_val2 = $("#threshold_val2").val();
216                 var threshold_type = $("#threshold_type").val();
217
218                 if ($("#use_percentage").attr("checked") == true) {
219                     threshold_val1 = parseInt(threshold_val1 / disk_size * 100);
220                     threshold_val2 = parseInt(threshold_val2 / disk_size * 100);
221                     set_slider("#threshold_setting",0, 100, threshold_val1, threshold_val2, "%", threshold_type);
222                 }else{
223                     threshold_val1 = parseInt(threshold_val1 / 100 * disk_size);
224                     threshold_val2 = parseInt(threshold_val2 / 100 * disk_size);
225                     set_slider("#threshold_setting",0, disk_size, threshold_val1, threshold_val2, "MB", threshold_type);
226                 }
227             });
228
229             if ($("#use_percentage").attr("checked") == true) {
230                 set_slider("#threshold_setting",0, 100, 20, 80, "%");
231             }else{
232                 set_slider("#threshold_setting",0, disk_size, Math.floor(disk_size * 0.2), Math.floor(disk_size * 0.8), "MB");
233             }
234             $("#threshold_percentage").show();
235             break;
236         case "${plugins['interface']}":
237             if ($("#network_status").val() == "${interface_type['OCTETS']}") {
238                 var max_value = MAX_NETWORK_OCTETS;
239                 set_slider("#threshold_setting",0, max_value, Math.floor(max_value * 0.2), Math.floor(max_value * 0.8), "octet/sec");
240             }else{
241                 var max_value = MAX_NETWORK_PACKETS;
242                 set_slider("#threshold_setting",0, max_value, Math.floor(max_value * 0.2), Math.floor(max_value * 0.8), "packet/sec");
243             }
244             break;
245         case "${plugins['libvirt']}":
246             var max_value = 0;
247             var unit = ""
248             switch ($("#libvirt_target").val()) {
249                 case "cpu":
250                     max_value = MAX_LIBVIRT_CPU_TIME;
251                     unit = "msec";
252                     break;
253                 case "disk":
254                     var disk_size_info = new Array();
255 % for domname in dom_info.keys():
256                     disk_size_info["${domname}"] = new Array();
257     % for disk_name in dom_info[domname]["disk_size"].keys():
258                     disk_size_info["${domname}"]["${disk_name}"] = "${dom_info[domname]['disk_size'][disk_name]}";
259     % endfor
260 % endfor
261                     //max_value = disk_size_info[$("#libvirt_target_machine").val()][$("#libvirt_disk_target").val()];
262                         max_value = MAX_LIBVIRT_DISK_OCTETS;
263                     unit = "kilo octet/sec";
264                     break;
265                 case "network":
266                     if ($("#libvirt_network_status").val() == "octets") {
267                         max_value = MAX_NETWORK_OCTETS;
268                         unit = "octet/sec";
269                     }else{
270                         max_value = MAX_NETWORK_PACKETS;
271                         unit = "packet/sec";
272                     }
273                     break;
274             }
275             set_slider("#threshold_setting",0, max_value, Math.floor(max_value * 0.2), Math.floor(max_value * 0.8), unit);
276             break;
277         case "${plugins['load']}":
278             var max_value = ${processer_num} * MAX_LOADAVERAGE_TIMES_PARAM;
279             set_slider("#threshold_setting", 0, max_value, Math.floor(max_value * 0.2), Math.floor(max_value * 0.8));
280             $("#threshold_setting").slider("option", "step", 0.01);
281             $("#threshold_fraction").val("2");
282             break;
283     }
284 }
285
286 $(document).ready(function(){
287
288     ajax_post_event(
289         "#add_watch_button",
290         "${ctx.homepath}${ctx.path}",
291         "#watch_setting :input",
292         validates_watch
293     );
294
295     $("#libvirt_target_machine").change(function(){
296         show_libvirt_target_section($("#libvirt_target").val());
297         set_threshold_slider("${plugins['libvirt']}");
298     });
299     $("#libvirt_network_status").change(function(){
300         set_threshold_slider("${plugins['libvirt']}");
301     });
302
303     $("#watch_target").change(function(){
304         show_target_section($(this).val());
305
306         set_threshold_slider($(this).val());
307         if ($(this).val() == "${plugins['libvirt']}") {
308             show_libvirt_target_section($("#libvirt_target").val());
309         }
310     });
311     $("#df_target_fs").change(function(){
312         set_threshold_slider("${plugins['df']}");
313     });
314     $("#network_status").change(function(){
315         set_threshold_slider("${plugins['interface']}");
316     });
317
318     $("#libvirt_target").change(function(){
319         show_libvirt_target_section($(this).val());
320         set_threshold_slider("${plugins['libvirt']}");
321     });
322
323     $("#threshold_val1").change(function(){
324         if (parseFloat($(this).val()) > parseFloat($("#threshold_val2").val())) {
325                 var arr = new Array(2);
326                 arr[1] = $("#threshold_val1_label").text();
327                 arr[2] = $("#threshold_val2_label").text();
328             alert(minisprintf("${_('%1$s should be less than %2$s!')}",arr));
329         } else {
330             $("#threshold_setting").slider("values",0,$(this).val());
331         }
332     });
333     $("#threshold_val2").change(function(){
334         if (parseFloat($("#threshold_val1").val()) > parseFloat($(this).val())) {
335                 var arr = new Array(2);
336                 arr[1] = $("#threshold_val2_label").text();
337                 arr[2] = $("#threshold_val1_label").text();
338             alert(minisprintf("${_('%1$s should be equal or more than %2$s!')}",arr));
339         } else {
340             $("#threshold_setting").slider("values",1,$(this).val());
341         }
342     });
343
344     $("#threshold_change_button").click(function(){
345         switch ($("#threshold_type").val()) {
346         case "max":
347             change_slider_type("min");
348             break;
349         case "min":
350             change_slider_type("max");
351             break;
352         }
353     });
354
355     // help
356     helptip("#watch_name_help",
357         "${_('Name')}",
358         "${_('Name of a new watch to add.')}");
359
360     helptip("#watch_target_help",
361         "${_('Watch Target')}",
362         "${_('Watch target module.')}");
363
364     /*
365      * TRANSLATORS:
366      * CPUのコア番号です。
367      */
368     helptip("#watch_logical_cpu_number_help",
369         "${_('CPU Number')}",
370         "${_('Observed CPU number.')}");
371
372     /*
373      * TRANSLATORS:
374      * 監視するCPUの状態を指定します。
375      * Idel : CPUが空いている割合
376      * Nice : 優先度によるユーザーレベルのCPU使用率
377      * User : ユーザーモードで使われたCPU使用率
378      * Wait : I/O待ちしているCPU使用率
379      * System : システムモードで使われたCPU使用率
380      * SoftIRQ : ソフトウェア割り込みで使われたCPU使用率
381      * Steal : ハードウェア割り込みで使われたCPU使用率
382      */
383     helptip("#watch_cpu_status_help",
384         "${_('CPU Status')}",
385         "${_('State of CPU from among Idle, User, etc.')}");
386
387     /*
388      * TRANSLATORS:
389      * 監視するメモリの状態を指定します。
390      * 空きメモリ容量 : 空きメモリの容量を監視対象にします。
391      * キャッシュ容量 : キャッシュの容量を監視対象にします。
392      * バッファ容量 : バッファの容量を監視対象にします。
393      * 使用メモリ容量 : 使用メモリの容量をを監視対象にします。
394      */
395     helptip("#watch_memory_status_help",
396         "${_('Memory Status')}",
397         "${_('State of memory to be observed.')}");
398
399     /*
400      * TRANSLATORS:
401      * 現在システムがマウントしているファイルシステムを指定します。
402      */
403     helptip("#watch_target_disk_help",
404         "${_('Target Disk')}",
405         "${_('Disk of watched target.')}");
406
407     /*
408      * TRANSLATORS:
409      * 監視するディスクの状態を指定します。
410      * 空き容量 : 空き容量を監視対象にします。
411      * 使用容量 : 使用容量監視対象にします。
412      */
413     helptip("#watch_df_disk_status_help",
414         "${_('Disk Status')}",
415         "${_('Status(free space or used space) of target disk.')}");
416
417     /*
418      * TRANSLATORS:
419      * 監視するインターフェースを指定します。
420      */
421     helptip("#watch_network_target_interface_help",
422         "${_('Target Interface')}",
423         "${_('Network interface to watch.')}");
424
425     /*
426      * TRANSLATORS:
427      * 監視するネットワークの状態を指定します。
428      * トラフィック : トラフィック数を監視対象にします。
429      * パケット数 : パケット数を監視対象にします。
430      * エラーパケット数 : エラーパケットを監視対象にします。
431      */
432     helptip("#watch_network_status_help",
433         "${_('Network Status')}",
434         "${_('State of network interface to be watched.')}");
435
436     /*
437      * TRANSLATORS:
438      * 通信方向を指定します。
439      * 送信(送信 -> 受信)
440      * 受信(受信 -> 送信)
441      */
442     helptip("#watch_network_direction_help",
443         "${_('Direction')}",
444         "${_('Direction of network traffic (receive or send)')}");
445
446     helptip("#watch_libvirt_target_host_help",
447         "${_('Target Guest')}",
448         "${_('Target guest to watch.')}");
449
450     helptip("#watch_libvirt_target_help",
451         "${_('Module To Watch')}",
452         "${_('Target module of virtual machine to watch.')}");
453
454     helptip("#watch_libvirt_vcpu_target_help",
455         "${_('Target Virtual CPU')}",
456         "${_('Target virtual machine CPU to watch.')}");
457         
458     helptip("#watch_libvirt_disk_target_help",
459         "${_('Target Disk')}",
460         "${_('Target disk of virtual machine to watch.')}");
461
462     helptip("#watch_libvirt_disk_value_type_help",
463         "${_('Read/Write')}",
464         "${_('Specify which I/O of the target disk to watch (read or write).')}");
465
466     helptip("#watch_libvirt_target_interface_help",
467         "${_('Target Interface')}",
468         "${_('Network interface to watch.')}");
469
470     helptip("#watch_libvirt_network_direction_help",
471         "${_('Direction')}",
472         "${_('Direction of network traffic(reveive or send) of network interface in virtual machine.')}");
473     /*
474      * 仮想マシンここまで
475      */
476
477     /*
478      * TRANSLATORS:
479      * 監視間隔を指定します。
480      * Short Term : 1分
481      * Middle Term: 5分
482      * Long Term : 15分
483      */
484     helptip("#watch_load_term_help",
485         "${_('Term')}",
486         "${_('Load average term to watch (short: 1min, middle: 5mins, long: 15mins).')}");
487
488     helptip("#continuation_count_help",
489         "${_('Alert Trigger Count')}",
490         "${_('Alert actions will be pended until alert counts reach over this value.')}");
491
492     helptip("#prohibition_period_help",
493         "${_('Silent Period (seconds)')}",
494         "${_('Silent period after reaching alert trigger count.')}");
495
496     helptip("#threshold_value_help",
497         "${_('Threshold Settings')}",
498         "${_('Value of threshold of which it warns.')}");
499
500     /*
501      * TRANSLATORS:
502      * 警告値を超えた場合に実行されるスクリプトを指定することができます。
503      * 
504      * example)
505      * #!/bin/bash
506      * echo "Alert!!" >> /tmp/Alert
507      */
508     helptip("#warning_script_help",
509         "${_('Warning Script')}",
510         "${_('Script execute when a warning value is exceeded.')}");
511
512     /*
513      * TRANSLATORS:
514      * 警告値を超えた場合に通知メールを指定することができます。
515      * 日本語、英語のメールテンプレートを利用することができます。
516      */
517     helptip("#enable_warning_mail_help",
518         "${_('Warning Notify Mail')}",
519         "${_('Contents of the mail notified when the warning value exceeded.')}");
520
521     helptip("#failure_script_help",
522         "${_('Failure Script')}",
523         "${_('Script execute when a failure value is exceeded.')}");
524
525     helptip("#enable_failure_mail_help",
526         "${_('Failure Notify Mail')}",
527         "${_('Contents of the mail notified when the failure value exceeded.')}");
528         
529     helptip("#okay_script_help",
530         "${_('Okay Script')}",
531         "${_('Script execute when a okay value is exceeded.')}");
532
533     helptip("#enable_okay_mail_help",
534         "${_('Okay Notify Mail')}",
535         "${_('Contents of the mail notified when the okay value exceeded.')}");
536         
537     helptip("#notify_mail_from_help",
538         "${_('Notify Mail From')}",
539         /*
540         TRANSLATORS:
541         メールで通知を行う際に使用するFrom(差出人)メールアドレスを1つ指定します。
542         複数指定することはできません。
543         */
544         "${_('From address when mail is notified.')}");
545         
546     helptip("#notify_mail_to_help",
547         "${_('Notify Mail To')}",
548         /*
549         TRANSLATORS:
550         メールで通知を行う際に使用するTo(宛先)メールアドレスを1つ指定します。
551         複数指定することはできません。
552         */
553         "${_('To address when mail is notified.')}");
554
555     /*
556      * TRANSLATORS:
557      * ※※※※※少し前に消された説明を再掲。helptipの中ではHTMLタグが有効になります。※※※※※※
558      * 通知メールのメッセージをカスタマイズできます。
559      * メールヘッダと本文の間には空行を一つ以上入れてください。
560      * 設定するメッセージの中に下記の文字列を入れると、送信されるメール内で文字列の置き換えが行われます。<br/>
561      <table>
562        <tr>
563          <td> %{app_name} </td>
564          <td> アプリケーション名  </td>
565        </tr>
566        <tr>
567          <td> %{time} </td>
568          <td> 検知した時刻  </td>
569        </tr>
570        <tr>
571          <td> %{host} </td>
572          <td> 検知したホストの名前 </td>
573        </tr>
574        <tr>
575          <td> %{plugin} </td>
576          <td> 監視対象名  </td>
577        </tr>
578        <tr>
579          <td> %{plugin_instance} </td>
580          <td> 監視対象の特定 </td>
581        </tr>
582        <tr>
583          <td> %{type} </td>
584          <td> 監視対象のサブカテゴリ  </td>
585        </tr>
586        <tr>
587          <td> %{type_instance} </td>
588          <td> 監視する項目名 </td>
589        </tr>
590        <tr>
591          <td> %{ds} </td>
592          <td> データソース名  </td>
593        </tr>
594        <tr>
595          <td> %{current_value} </td>
596          <td> 検知した時点での監視対象の値 </td>
597        </tr>
598        <tr>
599          <td> %{threshold_value </td>
600          <td> 設定した閾値 </td>
601        </tr>
602        <tr>
603          <td> %{failure_max} </td>
604          <td> 危険値の閾値(上限設定)  </td>
605        </tr>
606        <tr>
607          <td> %{warning_max} </td>
608          <td> 警告値の閾値(上限設定)  </td>
609        </tr>
610        <tr>
611          <td> %{failure_min} </td>
612          <td> 危険値の閾値(下限設定) </td>
613        </tr>
614        <tr>
615          <td> %{warning_min} </td>
616          <td> 警告値の閾値(下限設定) </td>
617        </tr>
618        <tr>
619          <td> %{severity} </td>
620          <td> 警告レベル </td>
621        </tr>
622        <tr>
623          <td> %{script_result_message} </td>
624          <td> アクションスクリプト実行結果 </td>
625        </tr>
626      </table>
627      */
628     helptip("#notification_mail_body_warning_help",
629         "${_('Notification Mail Body')}",
630         "${_(r"Customize the notification mail message. Don't forget to include empty line between mail header part and body part. Available macros are: ")}");
631
632     helptip("#notification_mail_body_failure_help",
633         "${_('Notification Mail Body')}",
634         "${_(r"Customize the notification mail message. Don't forget to include empty line between mail header part and body part. Available macros are: ")}");
635
636     helptip("#notification_mail_body_okay_help",
637         "${_('Notification Mail Body')}",
638         "${_(r"Customize the notification mail message. Don't forget to include empty line between mail header part and body part. Available macros are: ")}");
639
640     helptip("#notify_mail_mta_help",
641         "${_('Mail Server')}",
642         "${_('SMTP server to send notification mail through. This can be modified in \\"Settings\\" - \\"Mail Settings\\" panel.')}");
643
644     $("#libvirt_target").change();
645     $("#watch_target").change();
646
647     $("#threshold-accordion").accordion({
648         header: ".accordion-header",
649         active: false,
650         collapsible: true,
651         icons: {
652             header: "accordion-header-icon",
653             headerSelected: "accordion-header-icon-open"
654         }
655     });
656
657 });
658 //-->
659 </script>
660 <div id="watch_setting">
661     <form method="post" action="" id="input_watch_form" name="input_watch_form">
662         <div class="grayout-head">
663             <span class="grayout-title">
664                 <a href="#" id="server" class="path-a"><img src="${ctx.homepath}/static/images/settings-title.gif" alt="">${_('Add Watch')}</a>
665             </span>
666             <br style="clear: both;"/>
667         </div>
668
669         <div class="grayout-contents">
670             <div class="grayout-param">${_('Name')}<span id="watch_name_help"></span></div>
671             <div class="grayout-value grayout-form">
672                     <input type="text" name="watch_name" id="watch_name" size="40"/><span class="require-text">${_('Require')}</span>
673             </div>
674
675             <div class="grayout-param">${_('Watch Target')}<span id="watch_target_help"></span></div>
676             <div class="grayout-value grayout-form">
677                 <select name="watch_target" id="watch_target">
678                     <option id="watch_target_cpu" value="${plugins['cpu']}">${_('CPU')}</option>
679                     <option id="watch_target_memory" value="${plugins['memory']}">${_('Memory')}</option>
680                     <option id="watch_target_df" value="${plugins['df']}">${_('Disk Space')}</option>
681                     <option id="watch_target_network" value="${plugins['interface']}">${_('Network')}</option>
682                     <option id="watch_target_libvirt" value="${plugins['libvirt']}">${_('Virtual Machine')}</option>
683                     <option id="watch_target_load" value="${plugins['load']}">${_('Load Average')}</option>
684                 </select>
685             </div>
686
687             <div id="${plugins['cpu']}-section">
688                 <div class="grayout-param">${_('CPU Number')}<span id="watch_logical_cpu_number_help"></span></div>
689                 <div class="grayout-value grayout-form">
690                     <select name="logical_cpu_number" id="logical_cpu_number">
691 % for cpu_number in cpu_logical_number:
692                         <option id="logical_cpu_number_${cpu_number}" value="${cpu_number}">${cpu_number}</option>
693 % endfor
694                     </select>
695                 </div>
696
697                 <div class="grayout-param">${_('CPU Status')}<span id="watch_cpu_status_help"></span></div>
698                 <div class="grayout-value grayout-form">
699                     <select name="cpu_status" id="cpu_status">
700                         <option id="cpu_status_idle" value="${cpu_type_instance['IDLE']}">Idle</option>
701                         <option id="cpu_status_nice" value="${cpu_type_instance['NICE']}">Nice</option>
702                         <option id="cpu_status_user" value="${cpu_type_instance['USER']}">User</option>
703                         <option id="cpu_status_wait" value="${cpu_type_instance['WAIT']}">Wait</option>
704                         <option id="cpu_status_system" value="${cpu_type_instance['SYSTEM']}">System</option>
705                         <option id="cpu_status_softirq" value="${cpu_type_instance['SOFTIRQ']}">SoftIRQ</option>
706                         <option id="cpu_status_interrupt" value="${cpu_type_instance['INTERRUPT']}">Interrupt</option>
707                         <option id="cpu_status_steal" value="${cpu_type_instance['STEAL']}">Steal</option>
708                     </select>
709                 </div>
710             </div>
711
712             <div id="${plugins['memory']}-section">
713                 <div class="grayout-param">${_('Memory Status')}<span id="watch_memory_status_help"></span></div>
714                 <div class="grayout-value grayout-form">
715                     <select name="memory_status" id="memory_status">
716                         <option id="memory_status_free" value="${memory_type_instance['FREE']}">${_('Free Memory')}</option>
717                         <option id="memory_status_cached" value="${memory_type_instance['CACHED']}">${_('Cached Memory')}</option>
718                         <option id="memory_status_buffered" value="${memory_type_instance['BUFFERED']}">${_('Buffered Memory')}</option>
719                         <option id="memory_status_used" value="${memory_type_instance['USED']}">${_('Used Memory')}</option>
720                     </select>
721                 </div>
722             </div>
723
724             <div id="${plugins['df']}-section">
725                 <div class="grayout-param">${_('Target Disk')}<span id="watch_target_disk_help"></span></div>
726                 <div class="grayout-value grayout-form">
727                     <select name="df_target_fs" id="df_target_fs">
728 % for fs in df_list:
729                         <option id="df_target_fs_${fs['Filesystem']}" value="${fs['Filesystem']}">${fs['Filesystem']}</option>
730 % endfor
731                     </select>
732                 </div>
733
734                 <div class="grayout-param">${_('Disk Status')}<span id="watch_df_disk_status_help"></span></div>
735                 <div class="grayout-value grayout-form">
736                     <select name="df_disk_status" id="df_disk_status">
737                         <option id="df_disk_status_free" value="${df_ds['FREE']}">${_('Free Space')}</option>
738                         <option id="df_disk_status_used" value="${df_ds['USED']}">${_('Used Space')}</option>
739                     </select>
740                 </div>
741             </div>
742
743             <div id="${plugins['interface']}-section">
744                 <div class="grayout-param">${_('Target Interface')}<span id="watch_network_target_interface_help"></span></div>
745                 <div class="grayout-value grayout-form">
746                     <select name="network_target_interface" id="network_target_interface">
747 % for interface in interface_list:
748                         <option id="network_target_interface_${interface}" value="${interface}">${interface}</option>
749 % endfor
750                     </select>
751                 </div>
752                 <div class="grayout-param">${_('Network Status')}<span id="watch_network_status_help"></span></div>
753                 <div class="grayout-value grayout-form">
754                     <select name="network_status" id="network_status">
755                         <option id="network_status_octets" value="${interface_type['OCTETS']}">${_('Traffic')}</option>
756                         <option id="network_status_packets" value="${interface_type['PACKETS']}">${_('Packet Count')}</option>
757                         <option id="network_status_errors" value="${interface_type['ERRORS']}">${_('Error Packet Count')}</option>
758                     </select>
759                 </div>
760
761                 <div class="grayout-param">${_('Direction')}<span id="watch_network_direction_help"></span></div>
762                 <div class="grayout-value grayout-form">
763                     <select name="network_direction" id="network_direction">
764                         <option id="network_direction_tx" value="${interface_ds['TX']}">${_('Send')}</option>
765                         <option id="network_direction_rx" value="${interface_ds['RX']}">${_('Receive')}</option>
766                     </select>
767                 </div>
768             </div>
769
770             <div id="${plugins['libvirt']}-section">
771                 <div class="grayout-param">${_('Target Guest')}<span id="watch_libvirt_target_host_help"></span></div>
772                 <div class="grayout-value grayout-form">
773                         <select name="libvirt_target_machine" id="libvirt_target_machine">
774 % for dom in dom_list:
775                         <option name="libvirt_target_machine" id="libvirt_target_machine" value="${dom}">${dom}</option>
776 % endfor
777                                 </select>
778                 </div>
779                 <div class="grayout-param">${_('Watch Target of Virtual Machine')}<span id="watch_libvirt_target_help"></span></div>
780                 <div class="grayout-value grayout-form">
781                     <select name="libvirt_target" id="libvirt_target">
782                         <option id="libvirt_target_cpu" value="cpu">${_('Virtual CPU')}</option>
783                         <option id="libvirt_target_disk" value="disk">${_('Virtual Disk')}</option>
784                         <option id="libvirt_target_network" value="network">${_('Virtual Network')}</option>
785                     </select>
786                 </div>
787
788                 <div id="${plugins['libvirt']}-cpu-section">
789                     <div class="grayout-param">${_('Target Virtual CPU')}<span id="watch_libvirt_vcpu_target_help"></span></div>
790                     <div class="grayout-value grayout-form">
791                         <select name="libvirt_vcpu_target" id="libvirt_vcpu_target">
792                             <option id="libvirt_vcpu_target_total" value="total">${_('Total')}</option>
793                         </select>
794                     </div>
795                 </div>
796                 <div id="${plugins['libvirt']}-disk-section">
797                     <div class="grayout-param">${_('Target Disk')}<span id="watch_libvirt_disk_target_help"></span></div>
798                     <div class="grayout-value grayout-form">
799                         <select name="libvirt_disk_target" id="libvirt_disk_target" onChange="set_threshold_slider('${plugins['libvirt']}');">
800                         </select>
801                     </div>
802                     <!--
803                     TRANSLATORS:
804                     読み込み/書き込み
805                     監視する入出力処理の内容(読み込みもしくは書き込み)を指定します。
806                     -->
807                     <div class="grayout-param">${_('Read/Write')}<span id="watch_libvirt_disk_value_type_help"></span></div>
808                     <div class="grayout-value grayout-form">
809                         <select name="libvirt_disk_value_type" id="libvirt_disk_value_type">
810                             <option id="libvirt_disk_value_type_read" value="read">${_('Read')}</option>
811                             <option id="libvirt_disk_value_type_write" value="write">${_('Write')}</option>
812                         </select>
813                     </div>
814                 </div>
815                 <div id="${plugins['libvirt']}-network-section">
816                     <div class="grayout-param">${_('Target Interface')}<span id="watch_libvirt_target_interface_help"></span></div>
817                     <div class="grayout-value grayout-form">
818                         <select name="libvirt_target_interface" id="libvirt_target_interface">
819                         </select>
820                     </div>
821                     <div class="grayout-param">${_('Network Status')}<span id="watch_libvirt_network_status_help"></span></div>
822                     <div class="grayout-value grayout-form">
823                         <select name="libvirt_network_status" id="libvirt_network_status">
824                             <option id="libvirt_network_status_octets" value="octets">${_('Traffic')}</option>
825                             <option id="libvirt_network_status_packets" value="packets">${_('Packet Count')}</option>
826                             <option id="libvirt_network_status_errors" value="errors">${_('Error Packet Count')}</option>
827                         </select>
828                     </div>
829
830                     <div class="grayout-param">${_('Direction')}<span id="watch_libvirt_network_direction_help"></span></div>
831                     <div class="grayout-value grayout-form">
832                         <select name="libvirt_network_direction" id="libvirt_network_direction">
833                             <option id="libvirt_network_direction_tx" value="tx">${_('Send')}</option>
834                             <option id="libvirt_network_direction_rx" value="rx">${_('Receive')}</option>
835                         </select>
836                     </div>
837                 </div>
838             </div>
839
840             <div id="${plugins['load']}-section">
841                 <div class="grayout-param">${_('Term')}<span id="watch_load_term_help"></span></div>
842                 <div class="grayout-value grayout-form">
843                     <select name="load_term" id="load_term">
844                         <option id="load_term_shortterm" value="${load_ds['SHORTTERM']}">${_('Short Term')}</option>
845                         <option id="load_term_midterm" value="${load_ds['MIDTERM']}">${_('Middle Term')}</option>
846                         <option id="load_term_longterm" value="${load_ds['LONGTERM']}">${_('Long Term')}</option>
847                     </select>
848                 </div>
849             </div>
850
851             <div class="grayout-param">${_('Alert Trigger Count')}<span id="continuation_count_help"></span></div>
852             <div class="grayout-value grayout-form">
853                     <input type="text" name="continuation_count" id="continuation_count" size="10" maxlength="4" /><span class="require-text">${_('Require')}</span>
854             </div>
855
856             <div class="grayout-param">${_('Silent Period (seconds)')}<span id="prohibition_period_help"></span></div>
857             <div class="grayout-value grayout-form">
858                     <input type="text" name="prohibition_period" id="prohibition_period" size="10" maxlength="4" /><span class="require-text">${_('Require')}</span>
859             </div>
860
861             <div class="grayout-param">${_('Threshold Settings')}<span id="threshold_value_help"></span></div>
862             <div class="grayout-value grayout-form">
863                 <div><input type="button" name="threshold_change_button" id="threshold_change_button" value="${_('Reverses Threshold')}" /></div>
864
865                 <div style="width: 450px;">
866                     <div id="threshold_min" style="width: 225px; float:left;"></div>
867                     <div id="threshold_max" style="float: none; text-align: right;"></div>
868                 </div>
869                 <div id="threshold_setting">
870                     <div id="value-slider-left" class="slider-left"></div>
871                 </div>
872                 <div style="width: 450px">
873                     <div style="width: 225px; float:left;">
874                         <span id="threshold_val1_label">${_('Warning Value')} </span><input type="text" name="threshold_val1" id="threshold_val1" size="10" />
875                         <span id="threshold_max_unit"></span>
876                     </div>
877                     <div style="float: none; text-align: right;">
878                         <span id="threshold_val2_label">${_('Failure Value')} </span><input type="text" name="threshold_val2" id="threshold_val2" size="10" />
879                         <span id="threshold_min_unit"></span>
880                     </div>
881                     <span id="threshold_percentage"><input type="checkbox" name="use_percentage" id="use_percentage" />${_('Use Percentage')}</span>
882                     <input type="hidden" name="threshold_type" id="threshold_type" value="max" />
883                     <input type="hidden" name="threshold_fraction" id="threshold_fraction" value="0" />
884                 </div>
885             </div>
886
887             <div id="threshold-accordion">
888                 <div class="accordion-header">${_('Warning Settings')}</div>
889                 <div class="accordion-body">
890                     <div class="grayout-param">${_('Warning Script')}<span id="warning_script_help"></span></div>
891                     <div class="grayout-value grayout-form">
892                         <input type="checkbox" name="enable_warning_script" id="enable_warning_script" /> ${_('Enabled')}
893                             <textarea cols="85" rows="3" name="warning_script" id="warning_script"></textarea>
894                     </div>
895                     <div class="grayout-param">${_('Warning Notify Mail')}<span id="enable_warning_mail_help"></span></div>
896                     <div class="grayout-value grayout-form">
897                         <input type="checkbox" name="enable_warning_mail" id="enable_warning_mail">${_('Enabled')}
898                         <br/>
899 % for lang in supported_langs:
900                         <input type="button" name="warning_mail_body_init_${lang}" id="warning_mail_body_init_${lang}" onClick='javascript:set_mail_template("warning","${lang}")' value="${_('Read body template in %s') % _(lang)}">
901 % endfor
902                             <span id="notification_mail_body_warning_help"></span>
903                            <textarea cols="85" rows="6" name="warning_mail_body" id="warning_mail_body"></textarea>
904                     </div>
905                 </div>
906
907                 <div class="accordion-header">${_('Failure Settings')}</div>
908                 <div class="accordion-body">
909                     <div class="grayout-param">${_('Failure Script')}<span id="failure_script_help"></span></div>
910                     <div class="grayout-value grayout-form">
911                         <input type="checkbox" name="enable_failure_script" id="enable_failure_script" /> ${_('Enabled')}
912                             <textarea cols="85" rows="3" name="failure_script" id="failure_script"></textarea>
913                     </div>
914                     <div class="grayout-param">${_('Failure Notify Mail')}<span id="enable_failure_mail_help"></span></div>
915                     <div class="grayout-value grayout-form">
916                         <input type="checkbox" name="enable_failure_mail" id="enable_failure_mail">${_('Enabled')}
917                         <br/>
918 % for lang in supported_langs:
919                         <input type="button" name="failure_mail_body_init_${lang}" id="failure_mail_body_init_${lang}" onClick='javascript:set_mail_template("failure","${lang}")' value="${_('Read body template in %s') % _(lang)}">
920 % endfor
921                             <span id="notification_mail_body_failure_help"></span>
922                             <textarea cols="85" rows="6" name="failure_mail_body" id="failure_mail_body"></textarea>
923                     </div>
924                 </div>
925                 <div class="accordion-header">${_('Okay Settings')}</div>
926                 <div class="accordion-body">
927                     <div class="grayout-param">${_('Okay Script')}<span id="okay_script_help"></span></div>
928                     <div class="grayout-value grayout-form">
929                         <input type="checkbox" name="enable_okay_script" id="enable_okay_script" /> ${_('Enabled')}
930                             <textarea cols="85" rows="3" name="okay_script" id="okay_script"></textarea>
931                     </div>
932                     <div class="grayout-param">${_('Okay Notify Mail')}<span id="enable_okay_mail_help"></span></div>
933                     <div class="grayout-value grayout-form">
934                         <input type="checkbox" name="enable_okay_mail" id="enable_okay_mail">${_('Enabled')}
935                         <br/>
936 % for lang in supported_langs:
937                         <input type="button" name="okay_mail_body_init_${lang}" id="okay_mail_body_init_${lang}" onClick='javascript:set_mail_template("okay","${lang}")' value="${_('Read body template in %s') % _(lang)}">
938 % endfor
939                            <span id="notification_mail_body_okay_help"></span>
940                             <textarea cols="85" rows="6" name="okay_mail_body" id="okay_mail_body"></textarea>
941                     </div>
942                 </div>
943                 <!--
944                 TRANSLATORS:
945                 通知メール設定
946                 -->
947                 <div class="accordion-header">${_('Notify Mail Settings')}</div>
948                 <div class="accordion-body">
949                 <!--
950                 TRANSLATORS:
951                 メールサーバー
952                 -->
953                     <div class="grayout-param">${_('Mail Server')}<span id="notify_mail_mta_help"></span></div>
954                     <div class="grayout-value grayout-form">
955                         ${mta}
956                     </div>
957                     <!--
958                     TRANSLATORS:
959                     差出人メールアドレス
960                     -->
961                     <div class="grayout-param">${_('Mail From')}<span id="notify_mail_from_help"></span></div>
962                     <div class="grayout-value grayout-form">
963                         <input type="text" name="notify_mail_from" id="notify_mail_from" size="40" maxlength="256" value="${myaddress}"/>
964                     </div>
965                     <!--
966                     TRANSLATORS:
967                     宛先メールアドレス
968                     -->
969                     <div class="grayout-param">${_('Mail To')}<span id="notify_mail_to_help"></span></div>
970                     <div class="grayout-value grayout-form">
971                         <input type="text" name="notify_mail_to" id="notify_mail_to" size="40" maxlength="256" value="${myaddress}"/>
972                     </div>
973                 </div>
974             </div>
975
976             <div class="grayout-footer">
977                 <input type="hidden" name="_method" id="_method" />
978                 <a href="#" name="add_watch_button" id="add_watch_button" class="button">
979                     <span class="button-left">&nbsp;</span><span class="button-right">${_('Add')}</span>
980                 </a>
981                 <br style="clear: both;"/>
982             </div>
983         </div>
984         <br style="clear: both;"/>
985     </form>
986 </div>