Masato Taruishi
taru****@sourc*****
2004年 6月 23日 (水) 18:19:17 JST
=================================================================== RCS file: demo/haviewer/haviewer.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- demo/haviewer/haviewer.rb 2004/06/23 09:16:51 1.10 +++ demo/haviewer/haviewer.rb 2004/06/23 09:19:17 1.11 @@ -77,23 +77,23 @@ end def snmp - status = "-----" - pid = "-----" - since = "-----" + statusbuf = "-----" + pidbuf = "-----" + sincebuf = "-----" 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') + statusbuf = line.gsub(/^[^"]+"(.+)"\n/, '\1') when /#{OID_PID}/ - pid = line.gsub(/^[^"]+"(.+)"\n/, '\1') + pidbuf = line.gsub(/^[^"]+"(.+)"\n/, '\1') when /#{OID_SINCE}/ - since = line.gsub(/^[^"]+"(.+)"\n/, '\1') + sincebuf = line.gsub(/^[^"]+"(.+)"\n/, '\1') end end - @status = status - @pid = pid - @since = since + @status = statusbuf + @pid = pidbuf + @since = sincebuf c = "" case @status