<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,10 +2,13 @@
 
 * Log entries in task view can now be filtered by date. By default only entries
   from the last 24 hours are shown.
+* Added ability to reload and edit existing tasks [dvdplm]
 * Added experimental 'dont_wait' parameter to the Taskr4Rails action that 
   forces the remote code to be forked so that it does not hold up the entire 
   server. Currently this will only work if the remote Rails server is running 
-  on Mongrel. 
+  on Mongrel.
+* Taskr can be configured to send SNMP traps whenever task events are logged.
+  See the config.example.yml file's &quot;LOGGING&quot; section for more info.
 
 === 0.3.0 :: 2008-06-19
 </diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,19 @@ task_log:
   # ERROR, WARN, INFO, or DEBUG
   level: DEBUG
   
+### SNMP Traps
+# Taskr can be configured to send out SNMP traps whenever task events occur.
+# That is, in addition to logging task events to the Task Log (see above),
+# Taskr can send out SNMP traps notifying an SNMP listener of the event.
+# This functionality relies on the Net-SNMP package's `snmptrap` command-line
+# utility, so make sure you have the PERL Net-SNMP installed on your system
+# before enabling the following configuration options.
+
+#snmp:
+#  send_traps: true
+#  to_host: snmp.example.net
+#  community: public
+#  enterprise_oid: 1.3.6.1.4.1.55555.7007
   
 ##### MISC #####################################################################
 </diff>
      <filename>config.example.yml</filename>
    </modified>
    <modified>
      <diff>@@ -39,10 +39,11 @@ unless Object.method_defined? :gem
   alias gem require_gem
 end
 
+gem 'picnic', '&gt;=0.6.5'
 require 'picnic'
 require 'camping/db'
 
 require 'reststop'
 
-gem 'rufus-scheduler', '~&gt; 1.0.7'
+gem 'rufus-scheduler', '&gt;=1.0.7'
 require 'rufus/scheduler'</diff>
      <filename>lib/taskr/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -200,7 +200,7 @@ module Taskr::Models
     end
     
     def to_s
-      &quot;#{self.class.name.demodulize}(#{task_action})&quot;
+      &quot;#{self.class.name.demodulize}(#{action_class})&quot;
     end
   end
 
@@ -261,6 +261,51 @@ module Taskr::Models
             :data =&gt; data
           )
         end
+        
+        # Send SNMP traps through net-snmp if Taskr is configured to send them.
+        if Taskr::Conf[:snmp] &amp;&amp; Taskr::Conf[:snmp][:send_traps]
+          snmp_community = Taskr::Conf[:snmp][:community]
+          enterprise_oid = Taskr::Conf[:snmp][:enterprise_oid] || '1.3.6.1.4.1.55555.7007'
+          to_host        = Taskr::Conf[:snmp][:to_host]
+          snmp_persistent_dir = Taskr::Conf[:snmp][:snmp_persistent_dir] || '/tmp'
+          my_host        = ENV['HOSTNAME'] || `hostname`.strip || 'taskr'
+          
+          # see http://www.oid-info.com/get/1.3.6.1.4.1.9.5.1.14.4.1.2
+          level_oid = '1.3.6.1.4.1.9.5.1.14.4.1.2'
+          level_typ = 'i'
+          case level
+          when 'DEBUG'  then level_val = 8
+          when 'INFO'   then level_val = 7
+          when 'WARN'   then level_val = 5
+          when 'ERROR'  then level_val = 4
+          end
+        
+          # see http://www.oid-info.com/get/1.3.6.1.4.1.9.9.41.1.2.3.1.4
+          sevr_oid = '1.3.6.1.4.1.9.9.41.1.2.3.1.4'
+          sevr_typ = 's'
+          sevr_val = level
+          
+          # TODO: make msg format configurable
+          msg = (&quot;Taskr #{level} on task #{task}[#{action}]: #{data}&quot;).gsub(/&quot;/, '\&quot;')
+          
+          # see http://www.oid-info.com/get/1.3.6.1.4.1.9.9.41.1.2.3.1.5
+          msg_oid = '1.3.6.1.4.1.9.9.41.1.2.3.1.5'
+          msg_typ = 's'
+          msg_val = msg
+          
+          cmd = %{snmptrap -v 1 -c #{snmp_community} #{to_host} #{enterprise_oid} #{my_host} 6 #{level_val} '' \
+#{level_oid} #{level_typ} &quot;#{level_val}&quot; \
+#{sevr_oid} #{sevr_typ} &quot;#{sevr_val}&quot; \
+#{msg_oid} #{msg_typ} &quot;#{msg_val}&quot;}
+          
+          # Band-aid fix for bug in Net-SNMP.
+          # See http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1588455&amp;group_id=12694&amp;atid=112694
+          ENV['SNMP_PERSISTENT_DIR'] ||= snmp_persistent_dir
+          
+          $LOG.debug &quot;SENDING SNMP TRAP: #{cmd}&quot;
+          
+          `#{cmd}`
+        end
       end
       
       # Produces a Logger-like class that will create log entries for the given</diff>
      <filename>lib/taskr/models.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0b742f6a1cc9849fa9e387d10f5a72a4c53d7f31</id>
    </parent>
  </parents>
  <author>
    <name>zuk</name>
    <email>matt@zukowski.ca</email>
  </author>
  <url>http://github.com/zuk/taskr/commit/39561e2c0e605b674ca15a50c0cc00579a861f97</url>
  <id>39561e2c0e605b674ca15a50c0cc00579a861f97</id>
  <committed-date>2008-10-14T12:06:41-07:00</committed-date>
  <authored-date>2008-10-14T12:06:41-07:00</authored-date>
  <message>* Taskr can be configured to send SNMP traps whenever task events are logged.
  See the config.example.yml file's &quot;LOGGING&quot; section for more info.

git-svn-id: http://ruby-taskr.googlecode.com/svn/trunk@219 dda205c7-5e3f-0410-a417-dfc30505af65</message>
  <tree>7e1e88305a08d02b05bd51c92cd407ada218d517</tree>
  <committer>
    <name>zuk</name>
    <email>matt@zukowski.ca</email>
  </committer>
</commit>
