<%= error_messages_for 'sentinel' %> Sentinel <%= text_field 'sentinel', 'name' %> <%= text_area 'sentinel', 'description', :style => 'width: 98%', :rows => 4 %> <%= select "sentinel", "action", Sentinel::ACTIONS.invert %> <%= help_button "cron" %> <%= text_field 'sentinel', 'cron_interval' %> <%= check_box "sentinel", "send_mail" %> <%= check_box "sentinel", "include_csv_in_email" %> <%= check_box "sentinel", "include_report_in_email" %> <%= short_help "Mailto","A email address where the alarm should be sent to. Can be a list seperated by ','." %> <%= text_field 'sentinel', 'mail_to' %> <%= short_help "Threshold","Normally you should set here 0 - this means if the query contains any row a alarm is sent. If you want to send an alarm only if the query more than 1000 records. Set this to 1000. In other words this is the maximum allowed records that will not initiate an alarm."%> <%= text_field 'sentinel', 'threshold' %> View <%= short_help "View","The selected view is the datasource for your sentinel. The count of this view will be compared to the threshold. This datasource can also be used for your report. If the report template has no view selected, this view will be taken."%> <%= select("sentinel", "view_id", View.find(:all,:order => "name").collect {|v| [v.name , v.id]}) %> <%= text_field_with_auto_complete :sentinel, :time_range, :autocomplete => "off", :style => 'width: 98%', :rows => 4 %> <%= text_field "sentinel", "filters" %> (id, id, id)
Possible Filters for view <%= fobj(@sentinel.view) %>: <%= Filter.find(:all,:order => "name").select {|f| f.valid_for_table?(@sentinel.view)}.map{|f| "#{f.id}:'#{fobj(f)}'"}.join(", ") %> Alarm <%= short_help "Alarm Level","If no level is selected, no alarm will be created. This is useful for reporting only purpuse"%> <%= select("sentinel", "alarm_level",Alarm::ALARM_LEVELS.sort{|a,b| a[0] <=> b[0]}.map{|a,b| ["#{a}: #{b}",a]}, { :include_blank => true} ) %> Report <%= select("sentinel", "report_template_id", ReportTemplate.find(:all).collect {|v| [v.name , v.id]}, :include_blank => true) %>