Logging the load balance
Constants in UPPERCASE

@username = 'user'
@password =  nil
@host     = 'server_to_run_command_on'


should be constants, as well as:

LOGFILE = "path/to/log.txt"


Marking a variable as constant in Ruby just needs upper-casing its name.

Return value simplification

res = check.exec!(cmd)
data = res
write_data(data)


Is unnecessarily long just write:

write_data( check.exec!(cmd) )




Other then this minor remarks, the code looks as straightforward and readable as it can get.