Skip to content

Instantly share code, notes, and snippets.

file { '/etc/nginx/sites-available/default':
ensure => file,
mode => '0755',
content => template('roles/nodejs-sample.erb')
}
/roles/templates/nodejs-sample.erb
upstream nodejs-sample {
server 127.0.0.1:5000;
class nagios_server {
#Other Puppet configuration goes here
Nagios_host<<||>>
Nagios_service<<||>>
}
@@nagios_host { $fqdn:
ensure => present,
alias => $hostname,
address => $ipaddress,
use => "generic-host",
}
@@nagios_service { "check_ping_${hostname}":
check_command => "check_ping!100.0,20%!500.0,60%",
use => "generic-service",
class application_aspnet_regiis {
include 'param::powershell'
# http://stackoverflow.com/questions/9903543/how-to-check-whether-asp-net-4-0-registered-on-iis-7-5
$onlyif_command_regiis = 'if((c:\Windows\System32\inetsrv\appcmd.exe list config -section:system.webServer/isapiFilters) | where-object {$_.Contains(\"Framework\v4.0.30319\")}) { exit 1 } else { exit 0 }'
$onlyif_command_regiis_64 = 'if((c:\Windows\System32\inetsrv\appcmd.exe list config -section:system.webServer/isapiFilters) | where-object {$_.Contains(\"Framework64\v4.0.30319\")}) { exit 1 } else { exit 0 }'
exec { 'aspnet_regiis':
path => "${param::powershell::path};C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\;${::path}",
command => "${param::powershell::command} -Command \"aspnet_regiis.exe -i\"",
::: [vpc0-logging-es-data-33][w6FMFfyAT9uPvxRZr4nfxA][vpc0-logging-es-data-33][inet[/10.30.6.53:9300]]{tag=v2, master=false}
97.4% (487ms out of 500ms) cpu usage by thread 'elasticsearch[vpc0-logging-es-data-33][management][T#2]'
10/10 snapshots sharing following 11 elements
org.elasticsearch.action.admin.indices.stats.ShardStats.<init>(ShardStats.java:49)
org.elasticsearch.indices.InternalIndicesService.stats(InternalIndicesService.java:211)
org.elasticsearch.node.service.NodeService.stats(NodeService.java:156)
org.elasticsearch.action.admin.cluster.node.stats.TransportNodesStatsAction.nodeOperation(TransportNodesStatsAction.java:100)
org.elasticsearch.action.admin.cluster.node.stats.TransportNodesStatsAction.nodeOperation(TransportNodesStatsAction.java:43)
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$NodeTransportHandler.messageReceived(TransportNodesOperationAction.java:283)
@stack72
stack72 / gist:7a4ce16cb764d8c046b8
Created August 28, 2014 09:43
elasticsearch.yml
bootstrap:
mlockall: false
cluster:
name: centrallogs
discovery:
zen:
minimum_master_nodes: 2
ping:
multicast:
enabled: false
@stack72
stack72 / gist:256d6e06ec0bdee3a3e4
Created August 28, 2014 09:41
_cat/thread_pool?v
host ip bulk.active bulk.queue bulk.rejected index.active index.queue index.rejected search.active search.queue search.rejected
vpc0-logging-es-data-22 10.30.7.238 0 0 0 0 0 0 0 0 0
vpc0-logging-es-data-24 10.30.7.104 0 0 0 0 0 0 0 0 0
vpc0-logging-es-data-39 10.30.6.233 1 0 0 0 0 0 0 0 0
vpc0-logging-es-balancer-05 10.30.7.169 0 0 0 0 0 0 0 0 0
vpc0-logging-es-data-11 10.30.6.54 0 0 0 0 0 0 0 0 0
vpc0-logging-es-data-31 10.30.6.18
{
"cluster_name" : "centrallogs",
"nodes" : {
"w6FMFfyAT9uPvxRZr4nfxA" : {
"timestamp" : 1409218599089,
"name" : "vpc0-logging-es-data-33",
"transport_address" : "inet[/10.30.6.53:9300]",
"host" : "vpc0-logging-es-data-33",
"ip" : [ "inet[/10.30.6.53:9300]", "NONE" ],
"attributes" : {
{:timestamp=>"2014-08-27T22:11:55.574000+0000", :message=>"Failed to flush outgoing items", :outgoing_count=>5000, :exception=>#<RuntimeError: Non-OK response code from Elasticsearch: 504>, :backtrace=>["/opt/logstash/lib/logstash/outputs/elasticsearch/protocol.rb:127:in `bulk_ftw'", "/opt/logstash/lib/logstash/outputs/elasticsearch/protocol.rb:80:in `bulk'", "/opt/logstash/lib/logstash/outputs/elasticsearch.rb:331:in `flush'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.17/lib/stud/buffer.rb:219:in `buffer_flush'", "org/jruby/RubyHash.java:1339:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.17/lib/stud/buffer.rb:216:in `buffer_flush'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.17/lib/stud/buffer.rb:193:in `buffer_flush'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.17/lib/stud/buffer.rb:159:in `buffer_receive'", "/opt/logstash/lib/logstash/outputs/elasticsearch.rb:327:in `receive'", "/opt/logstash/lib/logstash/outputs/base.rb:86:in `handle'", "(eval):23:in `init
https://untappd.com/konabrewing - 101 beers!
https://untappd.com/brewery/11512 - 50 beers!
https://untappd.com/brewery/836 - 176 beers!
https://untappd.com/AlohaBeerCompany - 26 beers!