├── app ├── static │ ├── js │ │ ├── lib │ │ │ ├── jquery-ui.js │ │ │ └── md5.js │ │ ├── sw_lib.js │ │ ├── sw_upgrade_0.9.js │ │ └── status_wolf_colors.js │ ├── fonts │ │ ├── ElegantIcons.eot │ │ ├── ElegantIcons.ttf │ │ └── ElegantIcons.woff │ ├── img │ │ └── Status_Wolf2.png │ ├── sass │ │ ├── sw_dark.scss │ │ ├── print.scss │ │ ├── ie.scss │ │ ├── adhoc.scss │ │ ├── _animations.scss │ │ ├── login.scss │ │ ├── _colors_dark.scss │ │ ├── _fonts.scss │ │ ├── dashboard.scss │ │ └── _mixins.scss │ ├── css │ │ ├── print.css │ │ ├── ie.css │ │ ├── adhoc.css │ │ ├── login.css │ │ ├── screen.css │ │ └── dashboard.css │ ├── config.rb │ └── constants │ │ └── Constants.php ├── favicon.ico ├── Widgets │ ├── ExampleWidget │ │ ├── css │ │ │ └── sw.examplewidget.css │ │ └── ExampleWidget.json │ └── OpenTSDBWidget │ │ ├── OpenTSDBWidget.json │ │ ├── config.rb │ │ └── Controller │ │ └── GraphWidgetController.php ├── .htaccess ├── templates │ ├── footer.twig │ ├── navbar.twig │ ├── header.twig │ ├── sw_config.twig │ ├── dashboard_menu.twig │ ├── login.html │ ├── adhoc_menu.twig │ ├── no_upgrade.html │ ├── upgrade.html │ ├── adhoc.html │ └── dashboard.html ├── index.php └── sw.php ├── tests ├── StatusWolf │ └── Tests │ │ ├── Config │ │ ├── Fixtures │ │ │ ├── sw_config_empty.json │ │ │ ├── sw_config_broken.json │ │ │ └── sw_config_good.json │ │ └── ConfigServiceProviderTest.php │ │ ├── StatusWolfApplicationTest.php │ │ ├── StatusWolfApplicationWebTest.php │ │ └── Security │ │ └── User │ │ └── SWUserProviderTest.php └── bootstrap.php ├── icon.png ├── .htaccess ├── src └── StatusWolf │ ├── Exception │ ├── ConfigWriterException.php │ ├── ApiNetworkFetchException.php │ └── InvalidConfigurationException.php │ ├── Config │ ├── ConfigReaderInterface.php │ ├── ConfigWriterInterface.php │ ├── ConfigWriterServiceProvider.php │ ├── ConfigReaderServiceProvider.php │ ├── JsonConfigWriter.php │ ├── JsonConfigReader.php │ ├── ConfigWriterService.php │ └── ConfigReaderService.php │ ├── Model │ ├── TimeSeriesDataInterface.php │ └── TimeSeriesDownsample.php │ ├── Controllers │ ├── ApiDatasourceController.php │ ├── ApiSessionController.php │ ├── ApiController.php │ ├── ApiAnomalyController.php │ ├── DashboardController.php │ ├── ApiOpenTSDBController.php │ ├── ApiDashboardController.php │ └── AdhocController.php │ ├── Utility │ ├── SWLegacyConfig.php │ └── StatusWolfDBUpgrade.php │ ├── Security │ ├── Authentication │ │ ├── Token │ │ │ └── SWChainAuthToken.php │ │ └── Provider │ │ │ └── SWChainAuthProvider.php │ ├── User │ │ ├── SWUser.php │ │ └── SWUserProvider.php │ └── Firewall │ │ └── SWChainAuthListener.php │ └── Network │ └── Curl.php ├── plan.md ├── conf ├── sw_datasource_example.json ├── sw_config_example_no_ldap.json ├── sw_config_example_ldap.json └── statuswolf.sql ├── phpunit.xml ├── composer.json ├── setup_requirements.sh ├── CONTRIBUTING.md ├── README.md └── LICENSE /app/static/js/lib/jquery-ui.js: -------------------------------------------------------------------------------- 1 | jquery-ui-1.11.0.custom.min.js -------------------------------------------------------------------------------- /tests/StatusWolf/Tests/Config/Fixtures/sw_config_empty.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/StatusWolf/master/icon.png -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/StatusWolf/master/app/favicon.ico -------------------------------------------------------------------------------- /app/Widgets/ExampleWidget/css/sw.examplewidget.css: -------------------------------------------------------------------------------- 1 | .widget-container { 2 | height: 350px; 3 | } -------------------------------------------------------------------------------- /app/static/fonts/ElegantIcons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/StatusWolf/master/app/static/fonts/ElegantIcons.eot -------------------------------------------------------------------------------- /app/static/fonts/ElegantIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/StatusWolf/master/app/static/fonts/ElegantIcons.ttf -------------------------------------------------------------------------------- /app/static/img/Status_Wolf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/StatusWolf/master/app/static/img/Status_Wolf2.png -------------------------------------------------------------------------------- /app/static/fonts/ElegantIcons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/StatusWolf/master/app/static/fonts/ElegantIcons.woff -------------------------------------------------------------------------------- /tests/StatusWolf/Tests/Config/Fixtures/sw_config_broken.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug": "true", 3 | broken: "true" 4 | } 5 | -------------------------------------------------------------------------------- /tests/StatusWolf/Tests/Config/Fixtures/sw_config_good.json: -------------------------------------------------------------------------------- 1 | { 2 | "sw_app": { 3 | "debug": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | add('StatusWolf\Tests', __DIR__); 5 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine on 3 | RewriteRule ^$ app/ [L] 4 | RewriteRule (.*) app/$1 [L] 5 | -------------------------------------------------------------------------------- /app/static/sass/sw_dark.scss: -------------------------------------------------------------------------------- 1 | @charset 'utf-8'; 2 | 3 | @import 'animations'; 4 | @import 'colors_dark'; 5 | @import 'base'; 6 | @import 'fonts'; -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteRule ^ index.php [QSA,L] 5 | 6 | -------------------------------------------------------------------------------- /app/static/css/print.css: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. Use this file to define print styles. 2 | * Import this file using the following HTML or equivalent: 3 | * */ 4 | -------------------------------------------------------------------------------- /app/static/sass/print.scss: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. Use this file to define print styles. 2 | * Import this file using the following HTML or equivalent: 3 | * */ 4 | -------------------------------------------------------------------------------- /app/static/css/ie.css: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. Use this file to write IE specific override styles. 2 | * Import this file using the following HTML or equivalent: 3 | * */ 6 | -------------------------------------------------------------------------------- /app/static/sass/ie.scss: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. Use this file to write IE specific override styles. 2 | * Import this file using the following HTML or equivalent: 3 | * */ 6 | -------------------------------------------------------------------------------- /src/StatusWolf/Exception/ConfigWriterException.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 13 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Exception; 13 | 14 | class ConfigWriterException extends \RuntimeException {} 15 | -------------------------------------------------------------------------------- /src/StatusWolf/Exception/ApiNetworkFetchException.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 5 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Exception; 13 | 14 | 15 | class ApiNetworkFetchException extends \RuntimeException {} 16 | -------------------------------------------------------------------------------- /src/StatusWolf/Config/ConfigReaderInterface.php: -------------------------------------------------------------------------------- 1 | 6 | * Date Created: 24 February 2014 7 | * 8 | */ 9 | 10 | namespace StatusWolf\Config; 11 | 12 | interface ConfigReaderInterface { 13 | function read($config_file); 14 | function understands($config_file); 15 | } 16 | -------------------------------------------------------------------------------- /src/StatusWolf/Config/ConfigWriterInterface.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 13 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Config; 13 | 14 | interface ConfigWriterInterface { 15 | function write($config_file, $config_parts); 16 | } 17 | -------------------------------------------------------------------------------- /src/StatusWolf/Exception/InvalidConfigurationException.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 5 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Exception; 13 | 14 | class InvalidConfigurationException extends \InvalidArgumentException {} 15 | -------------------------------------------------------------------------------- /app/static/sass/adhoc.scss: -------------------------------------------------------------------------------- 1 | @import 'colors_dark'; 2 | @import 'mixins'; 3 | 4 | .adhoc-container { 5 | height: 90%; 6 | } 7 | 8 | .widget-container.opentsdb-widget.adhoc-widget { 9 | position: relative; 10 | top: 0; 11 | left: 0; 12 | height: 100%; 13 | width: 100%; 14 | margin: 0; 15 | } 16 | 17 | li#change-datasource-menu-item { 18 | white-space: nowrap; 19 | } -------------------------------------------------------------------------------- /plan.md: -------------------------------------------------------------------------------- 1 | # Phase 1: Ad Hoc search interface 2 | 3 | * Done 4 | 5 | # Phase 2: Dashboard interface 6 | 7 | * Done 8 | 9 | # Other: 10 | 11 | * Optimizations for OpenTSDB searching 12 | * Asynchronous javascript queries 13 | * Find method to kill in-progress queries if the options change 14 | * Break up large queries (> 4 hours?) into 1-hour chunks, live updates to the 15 | graph as data comes in. 16 | -------------------------------------------------------------------------------- /app/Widgets/ExampleWidget/ExampleWidget.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sw.examplewidget" 3 | ,"title": "Example Widget" 4 | ,"description": "Empty Widget Base" 5 | ,"version": "1.0" 6 | ,"author": { 7 | "name": "StatusWolf Project" 8 | ,"url": "http://wwww.statuswolf.com/" 9 | } 10 | ,"maintainers": [ 11 | { 12 | "name": "Mark Troyer" 13 | ,"email": "disco@box.com" 14 | } 15 | ] 16 | ,"license": "Apache v2.0", 17 | "enabled": false 18 | } -------------------------------------------------------------------------------- /conf/sw_datasource_example.json: -------------------------------------------------------------------------------- 1 | { 2 | "datasource": { 3 | "OpenTSDB": { 4 | "enabled": true, 5 | "type": "ajax", 6 | "url": [ 7 | "opentsdb1.server.name:4242", 8 | "opentsdb2.server.name:4242" 9 | ], 10 | "trim": "301", 11 | "proxy": false 12 | // "proxy": true, 13 | // "proxy_url": "localhost:8081" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/static/css/adhoc.css: -------------------------------------------------------------------------------- 1 | /* 2 | *======= 3 | * Mixins 4 | *======= 5 | */ 6 | /* line 4, ../sass/adhoc.scss */ 7 | .adhoc-container { 8 | height: 90%; 9 | } 10 | 11 | /* line 8, ../sass/adhoc.scss */ 12 | .widget-container.opentsdb-widget.adhoc-widget { 13 | position: relative; 14 | top: 0; 15 | left: 0; 16 | height: 100%; 17 | width: 100%; 18 | margin: 0; 19 | } 20 | 21 | /* line 17, ../sass/adhoc.scss */ 22 | li#change-datasource-menu-item { 23 | white-space: nowrap; 24 | } 25 | -------------------------------------------------------------------------------- /app/static/sass/_animations.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================= 3 | * Animations 4 | * ======================= 5 | */ 6 | @-webkit-keyframes fadeOut { 7 | from { opacity: 1;} 8 | to { opacity: 0; } 9 | } 10 | 11 | @keyframes fadeOut { 12 | from { opacity: 1; } 13 | to { opacity: 0; } 14 | } 15 | 16 | @-webkit-keyframes fadeIn { 17 | from { opacity: 0; } 18 | to { opacity: 1; } 19 | } 20 | 21 | @keyframes fadeIn { 22 | from { opacity: 0; } 23 | to { opacity: 1; } 24 | } 25 | -------------------------------------------------------------------------------- /src/StatusWolf/Model/TimeSeriesDataInterface.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 7 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Model; 13 | 14 | interface TimeSeriesDataInterface { 15 | 16 | function read($key = null); 17 | 18 | function read_json($key = null); 19 | 20 | function read_csv($key = null); 21 | 22 | function get_start(); 23 | 24 | function get_end(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/templates/footer.twig: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | ./tests/StatusWolf/ 15 | 16 | 17 | 18 | 19 | ./src 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/Widgets/OpenTSDBWidget/OpenTSDBWidget.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sw.opentsdbwidget" 3 | ,"title": "OpenTSDB Widget" 4 | ,"description": "Widget for displaying graphs for OpenTSDB Data" 5 | ,"version": "1.1" 6 | ,"author": { 7 | "name": "StatusWolf Project" 8 | ,"url": "http://wwww.statuswolf.com/" 9 | } 10 | ,"maintainers": [ 11 | { 12 | "name": "Mark Troyer" 13 | ,"email": "disco@box.com" 14 | } 15 | ] 16 | ,"license": "Apache v2.0", 17 | "enabled": true, 18 | "dependencies": { 19 | "js": [ 20 | "bootstrap-datetimepicker.js" 21 | ], 22 | "css": [ 23 | "sw.opentsdbwidget.css" 24 | ] 25 | }, 26 | "datasource": "OpenTSDB" 27 | } -------------------------------------------------------------------------------- /tests/StatusWolf/Tests/StatusWolfApplicationTest.php: -------------------------------------------------------------------------------- 1 | 6 | * Date Created: 15 April 2014 7 | * 8 | */ 9 | 10 | namespace StatusWolf\Tests; 11 | 12 | class StatusWolfApplicationTest extends \PHPUnit_Framework_TestCase { 13 | 14 | public function test_get_widgets() { 15 | 16 | $_SERVER['HTTP_HOST'] = 'localhost'; 17 | $_SERVER['SCRIPT_FILENAME'] = '/Users/mtroyer/code/StatusWolf/app/sw.php'; 18 | $sw = require_once __DIR__ . '/../../../app/sw.php'; 19 | 20 | $widgets = $sw['get_widgets']; 21 | $this->assertTrue(array_key_exists('OpenTSDBWidget', $widgets)); 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/StatusWolf/Config/ConfigWriterServiceProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 13 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Config; 13 | 14 | use Silex\Application; 15 | use Silex\ServiceProviderInterface; 16 | use StatusWolf\Config\ConfigWriterService; 17 | 18 | class ConfigWriterServiceProvider implements ServiceProviderInterface { 19 | 20 | public function register(Application $sw) { 21 | 22 | $sw['sw_config.writer'] = $sw->share(function($sw) { 23 | return new ConfigWriterService(); 24 | }); 25 | } 26 | 27 | public function boot(Application $sw) {} 28 | } 29 | -------------------------------------------------------------------------------- /src/StatusWolf/Controllers/ApiDatasourceController.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 5 March 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Controllers; 13 | 14 | use Silex\Application; 15 | use Silex\ControllerProviderInterface; 16 | use Symfony\Component\HttpFoundation\Request; 17 | 18 | class ApiDatasourceController implements ControllerProviderInterface { 19 | 20 | public function connect(Application $sw) { 21 | 22 | $sw->mount('/api/datasource/opentsdb', new ApiOpenTSDBController()); 23 | 24 | $controllers = $sw['controllers_factory']; 25 | 26 | return $controllers; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/StatusWolf/Config/ConfigReaderServiceProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * Date Created: 27 February 2014 9 | * 10 | */ 11 | 12 | namespace StatusWolf\Config; 13 | 14 | use Silex\Application; 15 | use Silex\ServiceProviderInterface; 16 | use StatusWolf\Config\ConfigReaderService; 17 | 18 | class ConfigReaderServiceProvider implements ServiceProviderInterface { 19 | 20 | public function register(Application $sw) { 21 | 22 | $sw['sw_config.config'] = array(); 23 | 24 | $sw['sw_config'] = $sw->share(function($sw) { 25 | return new ConfigReaderService(); 26 | }); 27 | 28 | } 29 | 30 | public function boot(Application $sw) {} 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/templates/navbar.twig: -------------------------------------------------------------------------------- 1 |