[Ultrapossum-cvs 212] demo/haviewer 1.5,1.6,haviewer.rb

Back to archive index

Masato Taruishi taru****@sourc*****
2004年 6月 23日 (水) 01:09:31 JST


===================================================================
RCS file: demo/haviewer/haviewer.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- demo/haviewer/haviewer.rb	2004/06/22 15:46:30	1.5
+++ demo/haviewer/haviewer.rb	2004/06/22 16:09:31	1.6
@@ -9,7 +9,7 @@
 
 class HAViewer
 
-  Column = ["S", "Host", "Type", "Status", "Pid", "Since", "I" ]
+  Column = ["S", "Host", "Type", "Status", "Pid", "Since" ]
   Hosts = []
   OID = "private.12345"  # .2.101.1"
   OID_STATUS = OID + ".2.101.1"
@@ -53,7 +53,7 @@
       @viewer = viewer
       @list = viewer.list
       @row =****@list*****
-      @color = Yellow
+      @color = ""
       @status = ""
       @type = type
       update
@@ -77,18 +77,18 @@
     end
 
     def snmp
+      @status = "-----"
+      @pid = "-----"
+      @since = "-----"
       buf = `snmpget -v1 -c ultrapossum #{@host} #{OID_STATUS} #{OID_PID} #{OID_SINCE}`
       buf.each_line do |line|
         case line
 	when /#{OID_STATUS}/
           @status = line.gsub(/^[^"]+"(.+)"\n/, '\1')
-          @status = "-----" if****@statu***** == 0
         when /#{OID_PID}/
           @pid = line.gsub(/^[^"]+"(.+)"\n/, '\1')
-          @pid = "-----" if****@pid***** == 0
 	when /#{OID_SINCE}/
           @since = line.gsub(/^[^"]+"(.+)"\n/, '\1')
-          @since = "-----" if****@since***** == 0
 	end
       end
 
@@ -115,7 +115,7 @@
 
   def initialize(glade)
     @glade = @glade = GladeXML.new(glade) {|handler| method(handler)}
-    @list = Gtk::ListStore.new(String, String, String, String, String, String, String)
+    @list = Gtk::ListStore.new( String, String, String, String, String, String)
     @columns = []
     Column.size.times do |i|
       @columns << Gtk::TreeViewColumn.new(Column[i], Gtk::CellRendererText.new, { :markup => i })  # {:text => i, :markup => 1})



Ultrapossum-cvs メーリングリストの案内
Back to archive index