lib/fluent/diagtool/validutils.rb in fluent-diagtool-0.1.2 vs lib/fluent/diagtool/validutils.rb in fluent-diagtool-0.1.3

- old
+ new

@@ -36,10 +36,11 @@ :net_ipv4_ip_local_port_range => ["10240", "65535"]} @logger.debug("Initialize Validation Utils:") @logger.debug(" Default ulimit: #{@def_ulimit}") @logger.debug(" Default sysctl: #{@def_sysctl}") end + def valid_ulimit(ulimit_file) @logger.info("Loading ulimit file: #{ulimit_file}") File.readlines(ulimit_file).each { |line| if line.chomp.to_i >= @def_ulimit.to_i @logger.info(" ulimit => #{line.chomp.to_i} is correct") @@ -48,9 +49,10 @@ @logger.warn(" ulimit => #{line.chomp.to_i} is incorrect, should be #{@def_ulimit}") return false, @def_ulimit.to_i, line.chomp.to_i end } end + def valid_sysctl(sysctl_file) h = Hash.new() v = Hash.new { |i,j| i[j] = Hash.new(&h.default_proc) } @logger.info("Loading sysctl file: #{sysctl_file}") File.readlines(sysctl_file).each{ |line|