Generate Basic Reports

You're able to query our API to pull out your data, so we've created the following to allow you to create html reports for your servers. 

Install Dependencies

sudo apt-get install git php5-cli php5-curl 
git clone https://github.com/serverdensity/sd-php-wrapper.git 
cd sd-php-wrapper 
curl -s http://getcomposer.org/installer | php 
php composer.phar install

Download PHP Scripts

wget https://raw.githubusercontent.com/bencer/scripts/master/sd_report/export_json.php 
wget https://raw.githubusercontent.com/bencer/scripts/master/sd_report/report_json.php

Execute PHP Scripts

Now execute the PHP scripts, replacing YOUR_API_TOKEN and DEVICE_NAME where appropriate, to download your data from the API and to render the report. 

SDTOKEN="YOUR_API_TOKEN" php export_json.php "DEVICE_NAME" 
SDTOKEN="YOUR_API_TOKEN" php report_json.php > report.html

Example ReportScreenShot2016-03-22at16.06.00.png

Customization

The report is HTML so you can customize it as you please or change the styles with CSS. Feel free to edit the PHP scripts to your needs too.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.