code: 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,)f 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,))
docs: Submits the status lines in the status_file to Nagios' external cmd file.