1 <%doc>Copyright (C) 2010 HDE, Inc.</%doc>
2 <%inherit file="../include/common.part" />
4 <script type="text/javascript">
6 function validates_watch(){
12 CHECK_EMPTY | CHECK_ONLYSPACE,
20 $("#continuation_count"),
21 CHECK_EMPTY | CHECK_VALID | CHECK_MIN | CHECK_MAX,
22 "${_('continuation_count')}",
23 CONTINUATION_COUNT_MIN,
24 CONTINUATION_COUNT_MAX
28 $("#prohibition_period"),
29 CHECK_EMPTY | CHECK_VALID | CHECK_MIN | CHECK_MAX,
30 "${_('prohibition_period')}",
31 PROHIBITION_PERIOD_MIN,
32 PROHIBITION_PERIOD_MAX
35 if ($("#threshold_fraction").val() == "0"){
38 CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
39 $("#threshold_val1_label").text(),
46 CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
47 $("#threshold_val2_label").text(),
52 check = check_fraction(
54 CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
55 $("#threshold_val1_label").text(),
58 parseInt($("#threshold_fraction").val())
61 check = check_fraction(
63 CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
64 $("#threshold_val2_label").text(),
67 parseInt($("#threshold_fraction").val())
71 if ($("#threshold_type").val() == "max"){
75 $("#threshold_val1_label").text(),
77 $("#threshold_val2").val()
79 } else if ($("#threshold_type").val() == "min"){
83 $("#threshold_val2_label").text(),
84 $("#threshold_val1").val(),
89 if ($("#notify_mail_from").val() != ""){
90 check = check_mailaddress(
91 $("#notify_mail_from"),
92 CHECK_LENGTH | CHECK_VALID,
100 if ($("#notify_mail_to").val() != ""){
101 check = check_mailaddress(
102 $("#notify_mail_to"),
103 CHECK_LENGTH | CHECK_VALID,
112 show_alert_msg("${_('Please input correct value.')}\n" + ERROR_MSG);
118 function show_target_section(target) {
119 $("#watch_setting div[id$='section']:visible").hide();
120 $("#" + target + "-section").show();
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");
129 var dom_info = new Array();
131 % for domname in dom_info.keys():
132 dom_info["${domname}"] = {'vcpu': ${dom_info[domname]['vcpu']},
133 'network': new Array(),
136 % for network in dom_info[domname]["network"]:
137 dom_info["${domname}"]['network'].push("${network}");
139 % for disk in dom_info[domname]["disk"]:
140 dom_info["${domname}"]['disk'].push("${disk}");
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));
154 if (target == "disk") {
155 $("#libvirt_disk_target").after($('#libvirt_disk_target').clone()).remove();
156 $("#libvirt_disk_target").html("");
158 $.each(dom_info[$("#libvirt_target_machine").val()]["disk"], function(index, value){
159 $("#libvirt_disk_target").append($('<option>').attr({ value: value}).text(value));
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));
169 $("#${plugins['libvirt']}-" + value + "-section").show();
171 $("#${plugins['libvirt']}-" + value + "-section").hide();
176 function set_mail_template(severity,lang) {
177 target = $("#watch_target").val();
178 uri = "${ctx.homepath}${ctx.path}".replace(".part", "");
180 uri + "/" + target + "/" + lang + ".json",
182 function(data, status) {
183 if(severity == "warning") {
184 $("#warning_mail_body").val(data.mail_template_warning);
186 if(severity == "failure") {
187 $("#failure_mail_body").val(data.mail_template_failure);
189 if(severity == "okay") {
190 $("#okay_mail_body").val(data.mail_template_okay);
197 function set_threshold_slider(target) {
198 $("#threshold_percentage").hide();
199 $("#threshold_fraction").val("0");
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");
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");
209 case "${plugins['df']}":
210 var target_disk = $('#df_target_fs').val();
211 var disk_size = ${disk_size_info}[target_disk]
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();
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);
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);
229 if ($("#use_percentage").attr("checked") == true) {
230 set_slider("#threshold_setting",0, 100, 20, 80, "%");
232 set_slider("#threshold_setting",0, disk_size, Math.floor(disk_size * 0.2), Math.floor(disk_size * 0.8), "MB");
234 $("#threshold_percentage").show();
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");
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");
245 case "${plugins['libvirt']}":
248 switch ($("#libvirt_target").val()) {
250 max_value = MAX_LIBVIRT_CPU_TIME;
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]}";
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";
266 if ($("#libvirt_network_status").val() == "octets") {
267 max_value = MAX_NETWORK_OCTETS;
270 max_value = MAX_NETWORK_PACKETS;
275 set_slider("#threshold_setting",0, max_value, Math.floor(max_value * 0.2), Math.floor(max_value * 0.8), unit);
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");
286 $(document).ready(function(){
290 "${ctx.homepath}${ctx.path}",
291 "#watch_setting :input",
295 $("#libvirt_target_machine").change(function(){
296 show_libvirt_target_section($("#libvirt_target").val());
297 set_threshold_slider("${plugins['libvirt']}");
299 $("#libvirt_network_status").change(function(){
300 set_threshold_slider("${plugins['libvirt']}");
303 $("#watch_target").change(function(){
304 show_target_section($(this).val());
306 set_threshold_slider($(this).val());
307 if ($(this).val() == "${plugins['libvirt']}") {
308 show_libvirt_target_section($("#libvirt_target").val());
311 $("#df_target_fs").change(function(){
312 set_threshold_slider("${plugins['df']}");
314 $("#network_status").change(function(){
315 set_threshold_slider("${plugins['interface']}");
318 $("#libvirt_target").change(function(){
319 show_libvirt_target_section($(this).val());
320 set_threshold_slider("${plugins['libvirt']}");
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));
330 $("#threshold_setting").slider("values",0,$(this).val());
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));
340 $("#threshold_setting").slider("values",1,$(this).val());
344 $("#threshold_change_button").click(function(){
345 switch ($("#threshold_type").val()) {
347 change_slider_type("min");
350 change_slider_type("max");
356 helptip("#watch_name_help",
358 "${_('Name of a new watch to add.')}");
360 helptip("#watch_target_help",
361 "${_('Watch Target')}",
362 "${_('Watch target module.')}");
368 helptip("#watch_logical_cpu_number_help",
369 "${_('CPU Number')}",
370 "${_('Observed CPU number.')}");
376 * Nice : 優先度によるユーザーレベルのCPU使用率
377 * User : ユーザーモードで使われたCPU使用率
378 * Wait : I/O待ちしているCPU使用率
379 * System : システムモードで使われたCPU使用率
380 * SoftIRQ : ソフトウェア割り込みで使われたCPU使用率
381 * Steal : ハードウェア割り込みで使われたCPU使用率
383 helptip("#watch_cpu_status_help",
384 "${_('CPU Status')}",
385 "${_('State of CPU from among Idle, User, etc.')}");
390 * 空きメモリ容量 : 空きメモリの容量を監視対象にします。
391 * キャッシュ容量 : キャッシュの容量を監視対象にします。
392 * バッファ容量 : バッファの容量を監視対象にします。
393 * 使用メモリ容量 : 使用メモリの容量をを監視対象にします。
395 helptip("#watch_memory_status_help",
396 "${_('Memory Status')}",
397 "${_('State of memory to be observed.')}");
401 * 現在システムがマウントしているファイルシステムを指定します。
403 helptip("#watch_target_disk_help",
404 "${_('Target Disk')}",
405 "${_('Disk of watched target.')}");
410 * 空き容量 : 空き容量を監視対象にします。
411 * 使用容量 : 使用容量監視対象にします。
413 helptip("#watch_df_disk_status_help",
414 "${_('Disk Status')}",
415 "${_('Status(free space or used space) of target disk.')}");
419 * 監視するインターフェースを指定します。
421 helptip("#watch_network_target_interface_help",
422 "${_('Target Interface')}",
423 "${_('Network interface to watch.')}");
427 * 監視するネットワークの状態を指定します。
428 * トラフィック : トラフィック数を監視対象にします。
429 * パケット数 : パケット数を監視対象にします。
430 * エラーパケット数 : エラーパケットを監視対象にします。
432 helptip("#watch_network_status_help",
433 "${_('Network Status')}",
434 "${_('State of network interface to be watched.')}");
442 helptip("#watch_network_direction_help",
444 "${_('Direction of network traffic (receive or send)')}");
446 helptip("#watch_libvirt_target_host_help",
447 "${_('Target Guest')}",
448 "${_('Target guest to watch.')}");
450 helptip("#watch_libvirt_target_help",
451 "${_('Module To Watch')}",
452 "${_('Target module of virtual machine to watch.')}");
454 helptip("#watch_libvirt_vcpu_target_help",
455 "${_('Target Virtual CPU')}",
456 "${_('Target virtual machine CPU to watch.')}");
458 helptip("#watch_libvirt_disk_target_help",
459 "${_('Target Disk')}",
460 "${_('Target disk of virtual machine to watch.')}");
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).')}");
466 helptip("#watch_libvirt_target_interface_help",
467 "${_('Target Interface')}",
468 "${_('Network interface to watch.')}");
470 helptip("#watch_libvirt_network_direction_help",
472 "${_('Direction of network traffic(reveive or send) of network interface in virtual machine.')}");
484 helptip("#watch_load_term_help",
486 "${_('Load average term to watch (short: 1min, middle: 5mins, long: 15mins).')}");
488 helptip("#continuation_count_help",
489 "${_('Alert Trigger Count')}",
490 "${_('Alert actions will be pended until alert counts reach over this value.')}");
492 helptip("#prohibition_period_help",
493 "${_('Silent Period (seconds)')}",
494 "${_('Silent period after reaching alert trigger count.')}");
496 helptip("#threshold_value_help",
497 "${_('Threshold Settings')}",
498 "${_('Value of threshold of which it warns.')}");
502 * 警告値を超えた場合に実行されるスクリプトを指定することができます。
506 * echo "Alert!!" >> /tmp/Alert
508 helptip("#warning_script_help",
509 "${_('Warning Script')}",
510 "${_('Script execute when a warning value is exceeded.')}");
514 * 警告値を超えた場合に通知メールを指定することができます。
515 * 日本語、英語のメールテンプレートを利用することができます。
517 helptip("#enable_warning_mail_help",
518 "${_('Warning Notify Mail')}",
519 "${_('Contents of the mail notified when the warning value exceeded.')}");
521 helptip("#failure_script_help",
522 "${_('Failure Script')}",
523 "${_('Script execute when a failure value is exceeded.')}");
525 helptip("#enable_failure_mail_help",
526 "${_('Failure Notify Mail')}",
527 "${_('Contents of the mail notified when the failure value exceeded.')}");
529 helptip("#okay_script_help",
530 "${_('Okay Script')}",
531 "${_('Script execute when a okay value is exceeded.')}");
533 helptip("#enable_okay_mail_help",
534 "${_('Okay Notify Mail')}",
535 "${_('Contents of the mail notified when the okay value exceeded.')}");
537 helptip("#notify_mail_from_help",
538 "${_('Notify Mail From')}",
541 メールで通知を行う際に使用するFrom(差出人)メールアドレスを1つ指定します。
544 "${_('From address when mail is notified.')}");
546 helptip("#notify_mail_to_help",
547 "${_('Notify Mail To')}",
550 メールで通知を行う際に使用するTo(宛先)メールアドレスを1つ指定します。
553 "${_('To address when mail is notified.')}");
557 * ※※※※※少し前に消された説明を再掲。helptipの中ではHTMLタグが有効になります。※※※※※※
558 * 通知メールのメッセージをカスタマイズできます。
559 * メールヘッダと本文の間には空行を一つ以上入れてください。
560 * 設定するメッセージの中に下記の文字列を入れると、送信されるメール内で文字列の置き換えが行われます。<br/>
563 <td> %{app_name} </td>
572 <td> 検知したホストの名前 </td>
579 <td> %{plugin_instance} </td>
584 <td> 監視対象のサブカテゴリ </td>
587 <td> %{type_instance} </td>
595 <td> %{current_value} </td>
596 <td> 検知した時点での監視対象の値 </td>
599 <td> %{threshold_value </td>
603 <td> %{failure_max} </td>
604 <td> 危険値の閾値(上限設定) </td>
607 <td> %{warning_max} </td>
608 <td> 警告値の閾値(上限設定) </td>
611 <td> %{failure_min} </td>
612 <td> 危険値の閾値(下限設定) </td>
615 <td> %{warning_min} </td>
616 <td> 警告値の閾値(下限設定) </td>
619 <td> %{severity} </td>
623 <td> %{script_result_message} </td>
624 <td> アクションスクリプト実行結果 </td>
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: ")}");
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: ")}");
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: ")}");
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.')}");
644 $("#libvirt_target").change();
645 $("#watch_target").change();
647 $("#threshold-accordion").accordion({
648 header: ".accordion-header",
652 header: "accordion-header-icon",
653 headerSelected: "accordion-header-icon-open"
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>
666 <br style="clear: both;"/>
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>
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>
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>
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>
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>
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">
729 <option id="df_target_fs_${fs['Filesystem']}" value="${fs['Filesystem']}">${fs['Filesystem']}</option>
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>
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>
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>
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>
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>
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>
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>
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']}');">
805 監視する入出力処理の内容(読み込みもしくは書き込み)を指定します。
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>
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">
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>
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>
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>
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>
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>
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>
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>
869 <div id="threshold_setting">
870 <div id="value-slider-left" class="slider-left"></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>
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>
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" />
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>
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')}
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)}">
902 <span id="notification_mail_body_warning_help"></span>
903 <textarea cols="85" rows="6" name="warning_mail_body" id="warning_mail_body"></textarea>
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>
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')}
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)}">
921 <span id="notification_mail_body_failure_help"></span>
922 <textarea cols="85" rows="6" name="failure_mail_body" id="failure_mail_body"></textarea>
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>
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')}
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)}">
939 <span id="notification_mail_body_okay_help"></span>
940 <textarea cols="85" rows="6" name="okay_mail_body" id="okay_mail_body"></textarea>
947 <div class="accordion-header">${_('Notify Mail Settings')}</div>
948 <div class="accordion-body">
953 <div class="grayout-param">${_('Mail Server')}<span id="notify_mail_mta_help"></span></div>
954 <div class="grayout-value grayout-form">
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}"/>
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}"/>
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"> </span><span class="button-right">${_('Add')}</span>
981 <br style="clear: both;"/>
984 <br style="clear: both;"/>