 proc counterrors {pattern logs} {
   set errorcount 0
   foreach line [split $logs "\n"] {
+    if { [regexp "/var/log/messages" $line] } {
+      continue
+    }
     if { [regexp $pattern $line] } {
       incr errorcount 1
     }

        expect "*% " {send -s "exit\r"}
      }
    }
     send_user "\n#### $host in total has $errorperhost errors ####\n"
    expect "*> " { send -s "exit\r"}
  }
}

    set errorpermember 0
    set done 0
    for { set x 0 } { $x<=9 } { incr x } {
      if { $x != $master } {
        expect timeout {
          send_user "\n$host: CONNECTION ERROR - connection timeout\n"
          break
        } eof {
          send_user "\n$host: CONNECTION ERROR - got eof\n"
          break
        } "*> " { 
          send -s "request session member $x\r"
        }
        
        expect timeout {
          send_user "\n$host: CONNECTION ERROR - connection timeout\n"
          break
        } eof {
          send_user "\n$host: CONNECTION ERROR - got eof\n"
          break
        } "assword: " {
          send -s "$pass\r"
          exp_continue
        } "No route to host" {
          continue
        } "*> " {
          send -s "start shell\r"
          exp_continue
