scoutapp/scout-client — pull request #5 by gstark (2012-07-19 03:34:07+00:00)
Title: Adds a SCOUT_HOSTNAME to override Socket.gethostname

On some of my servers, and only on some boots, Socket.gethostname returns a fully qualified hostname. It isn't clear why my server does this. This causes the server to be recognized by Scout as new while the existing server shows as "no data." By adding a SCOUT_HOSTNAME environment I can control the hostname being used. I set via:

```shell
export SCOUT_HOSTNAME=`hostname | awk -F. '{print $1}'`
```

I have monkey patched this on my server and confirms I am once again delivering data to the correct server.

Two things I'm not 100% happy with on this pull request:
* No tests
* I'm not sure an ENV variable is the best way. I'd think a --client-hostname command line option would be better, but it wasn't clear how to get that data to the places where Socket.gethostname is currently used.