Skip to content

Instantly share code, notes, and snippets.

@anatolijd
Created February 28, 2015 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anatolijd/558f0b4d63ed44b331ee to your computer and use it in GitHub Desktop.
Save anatolijd/558f0b4d63ed44b331ee to your computer and use it in GitHub Desktop.
Uchiwa custom template
<!-- Author: Anatoliy Dobrosynets, Recorded Future, Inc. -->
<div ng-init="dashboard_base='<%= @grafana_url %>/#/dashboard'; kibana_base='<%= @kibana_url %>/#/dashboard/file';">
<!-- unconditional link -->
<span class="small-nav"> Instance
<a ng-href="{{dashboard_base}}/script/instance.js?i={{client.name}}" target="_blank">
<i class="fa fa-tachometer"></i></a>
<a ng-href="{{kibana_base}}/logstash.json?query=host:\&quot;{{client.name}}\&quot;" target="_blank">
<i class="fa fa-bar-chart-o"></i></a>
</span>
<span>
<!-- iterate through the list of subscriptions, filter by regexp -->
<span ng-repeat="subscr in client.subscriptions">
<!-- Backend data processes -->
<span ng-if="subscr.match('(^backend_app_).*')">
<span>
| {{subscr|extractName:'_app_'}}
<a ng-href="{{dashboard_base}}/script/process.js?p={{subscr|extractName:'_app_'|lowercase}}" target="_blank">
<i class="fa fa-tachometer"></i></a>
<a ng-href="{{kibana_base}}/logstash.json?query=process:\&quot;{{subscr|extractName:'_app_'|lowercase}}\&quot;" target="_blank">
<i class="fa fa-bar-chart-o"></i></a>
</span>
</span>
<!-- ES clusters -->
<span ng-if="subscr.match('(^Elasticsearch_cluster_(?!checks|monitoring)).*')">
<span>
| ES cluster: {{subscr|extractName:'_cluster_'}}
<a ng-href="{{dashboard_base}}/db/es-cluster?var-name={{subscr|extractName:'_cluster_'|lowercase}}" target="_blank">
<i class="fa fa-tachometer"></i></a>
</span>
</span>
</span>
</span>
<!-- define regular processes, snowflakes, legacy processes, etc
TODO: store it in Chef configuration and generate hash table during the chef-client run-->
<span ng-init=" processes=[
{role:'Collector_process', dashboard:'db/old_collector', arg:''},
{role:'Aggregator_old', dashboard:'db/old_aggregator', arg:''},
{role:'Aggregator2', dashboard:'db/old_aggregator', arg:''},
{role:'Inferno_legacy_app', dashboard:'db/old_crawler', arg:'var-queue=All'}
]" >
<span ng-repeat="subscr in processes">
<span ng-if="client.subscriptions.indexOf(subscr.role) > -1">
| {{subscr.role}}
<a ng-href="{{dashboard_base}}/{{subscr.dashboard}}&{{subscr.arg}}" target="_blank">
<i class="fa fa-tachometer"></i></a>
</span>
</span>
</span>
<span ng-if="selectedCheck">
<!-- check_name is one of the below -->
<span ng-if="['disk_usage','swapping','disk_iostat'].indexOf(selectedCheck.check) > -1">
| <a ng-href="{{dashboard_base}}/script/detailed_io.js?i={{client.name}}" target="_blank">disk IO</a>
</span>
</span>
<div ng-if="selectedEvent">
<div ng-if="selectedCheck.check.match('^jenkins_.*')">
<span ng-if="selectedEvent.check.playbook">
<a ng-href="{{selectedEvent.check.playbook}}">Help</a>
</span>
<div ng-include src="'partials/client/jenkins.html'"></div>
</div>
</div>
</div>
@jothoma1
Copy link

jothoma1 commented Jan 25, 2017

Hi, is this still usable with the last uchiwa ? i dont find the same files like in your blog article http://anatolijd.blogspot.fr/2015/02/just-enough-angular-for-uchiwa.html

I dont find the directories for the html and JS files
Thanks in advance !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment