<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def submit_status_external_cmd(cmd_file, status_file):
  ''' Submits the status lines in the status_file to Nagios' external cmd file.
  '''
  try:
    with open(cmd_file, 'a') as cmd_file:
      cmd_file.write(status_file.read())
  except IOError:
    exit("Fatal error: Unable to write to Nagios external command file '%s'.\n"
         "Make sure that the file exists and is writable." % (cmd_file,))