Can I check a user is logged in using Services I need to be able to integrate an external PHP script with Drupal 7. However because the script also connects to a MySQL database errors are produced when I include the bootstrap.inc, so I'm looking at using the Services module. Will this allow me to determine if the user is logged  in to Drupal, and if so get details about the user? If so, could you please show me how this could be done.

Also, is it possible to secure the server/service so that it can only be accessed by scripts on the same host?
Services module works with the entity system so you should be able to pull some user data out of the box like email, username etc. I'm not exactly sure if Services modules send you any clue about user data that you can use to determine if the user is online or not but you can add a small custom code that alter the read functionality of the Services for User entity to query and return the current session. See code sample below.

Couple of function you might need in the process is:

// you can alter the resources object and use your own 
hook_services_resources_alter()

// implement it as below in your custom module
function YOURMODULE_services_resources_alter(){
  $resources['user']['retrieve']['callback'] = '_YOURMODULE_api_user_resource_retrieve';
}

// then implement the retrive
function _YOURMODULE_api_user_resource_retrieve($uid){
    $account = user_load($uid);
  if (empty($account)) {
    return services_error(t('There is no user with ID @uid.', array('@uid' =&gt; $uid)), 404);
  }

  services_remove_user_data($account);
  // DO YOUR SQL TO CHECK IF USER IS ONLINE
  // _check_this_user_online($uid);

  // Everything went right.

  return $account;
}