Deployment: Install Script
We have an automatic deployment script which will automatically install the agent and add the new server into your account. All you need to do is run the script and then launch the agent on each server.
1. Download
The script is bundled with the agent package but is also available as a separate download.
wget http://www.serverdensity.com/downloads/sd-deploy.tar.gz
2. Extract
Once downloaded, you need to extract the agent files. They will be extracted to the current directory:
tar xvfz sd-deploy.tar.gz
3. Execute
The script is written in Python and can be executed using the following command line:
python sd-deploy.py [API URL] [SD URL] [username] [password] [[init]]
Arguments
[API URL]- The URL to the API endpoint. For hosted Server Density users this will behttp://api.serverdensity.com.[SD URL]- The URL to your Server Density account. For hosted Server Density users this will beexample.serverdensity.comwhereexampleis your account subdomain.[username]- The username of a Server Density user with API access (see below).[password]- The password of a Server Density user with API access (see below).[[init]](optional) - If this is specified, the deploy script will also install the init.d startup scripts. The deploy script must be run as root for this option to work.
Example usage
To install without the init.d scripts:
python sd-deploy.py http://api.serverdensity.com example.serverdensity.com ausername apassword
Or to install with the init.d scripts:
python sd-deploy.py http://api.serverdensity.com example.serverdensity.com ausername apassword init
API User
The deploy script uses the Server Density API to add the new server and so you must specify the login details of a user with API access. To enable API access:
- Log into your Server Density account as an admin user.
- Click the Users tab.
- Click Edit next to the user you wish to enable API access for.
- Tick the API enabled? box and click Edit.
- This user now has access to the API using their username and password.
4. Launch
All that is left to do is launch the newly installed agent.
If you did not install the init.d scripts
python /path/to/sd-agent/agent.py start
If you did install the init.d scripts
/etc/init.d/sd-agent start