Skip to content

Instantly share code, notes, and snippets.

@timconradinc
timconradinc / get-datastores.ps1
Created May 30, 2012 15:12
Connect to vcenter, get list of datastores
Connect-VIServer -Server vcenter.example.com -User someuser
$output = "c:\datastores.csv"
$report = @()
foreach ($ds in Get-Datastore) {
$row = "" | Select Name, FreeSpaceMB, CapacityMB
$row.FreeSpaceMB = $ds.FreeSpaceMB
$row.Name = $ds.Name
$row.CapacityMB = $ds.CapacityMB
$report += $row
@timconradinc
timconradinc / gist:5273375
Created March 29, 2013 20:22
csv filter addition
# CSV filter. Takes an event field containing CSV data, parses it,
# and stores it as individual fields (can optionally specify the names).
#
# Example config:
# filter {
# grok {
# type => "SomeSyslogType"
# pattern => "%{SYSLOGTIMESTAMP} %{HOSTNAME} %{GREEDYDATA:csvdata}"
# }
#
@timconradinc
timconradinc / gist:5279530
Created March 31, 2013 04:19 — forked from rashidkpc/gist:3794465
Fixed - changed /static to /public
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
PassengerRuby /usr/bin/ruby
<VirtualHost *:80>
ServerName logs.example.com
ServerAlias logs.example.com
DocumentRoot /home/httpd/Kibana/public
mutate {
type => "PaloAltoTestTrafficLog"
add_field => ["SourceAddressFQDN", ""]
add_field => ["DestinationAddressFQDN", ""]
}
mutate {
type => "PaloAltoTestTrafficLog"
replace => [ "SourceAddressFQDN", "%{SourceAddress}" ]
replace => [ "DestinationAddressFQDN", "%{DestinationAddress}" ]
<!-- the env variables are controlled by Chef and passed in via -D on the java command-line -->
<!-- This is using the appender here: https://github.com/t0xa/gelfj -->
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
<param name="graylogHost" value="${graylog.server}"/>
<param name="originHost" value="${graylog.origin}"/>
<param name="extractStacktrace" value="true"/>
<param name="addExtendedInformation" value="true"/>
<!-- The _web part is because a given app has multiple components -->
<!-- This app might have a _web as well as an _batch component -->
<param name="facility" value="${graylog.facility}_web"/>
def somefunc(msg):
results = ""
results = msg.swapcase()
return results
if __name__ == "__main__":
x = somefunc("himom")
@timconradinc
timconradinc / beaver.conf
Last active December 16, 2015 23:29
Beaver Issue #135
[beaver]
redis_url:redis://10.99.9.99:6379/0
[/syslog/logs/palo*/user-info*log]
type: PaloAltoTrafficLog
[/syslog/logs/palo*/local*log]
type: PaloAltoThreatLog
# this is for testing/troubleshooting
@timconradinc
timconradinc / gist:5527644
Last active December 17, 2015 01:19
es stuff
ES Connectivity -
- Should respond properly when can't write to ES
- Should tell user if they can't connect to ES
Events
- Fields should be able to slide wider/narrower & 'close' the panel when not needed.
Editing
- Saving should default to same name, or easily add name of current config
- 'Create Panel' shows up below the scroll. Perhaps a better place would be opposite of 'create panel' -
@timconradinc
timconradinc / gist:5550356
Last active December 17, 2015 04:28 — forked from bitprophet/gist:5493982
Graphing Graphite Graphs Grappling Groo

Cluster graphing

  • It's frequently useful to graph a metric over a cluster of hosts, e.g. "show me the number of requests/s being handled by all of my load balancers".
  • Doing this in vanilla Graphite is easy - it honors both glob expressions (lb*) and brace expressions ({a,b,c,d}).
  • But how do we generate these for clusters whose hostnames don't glob well, and/or whose members change over time?

Descartes

  • Generally flippin' awesome.
  • Has a database of Metrics, Graphs composing 1+ Metrics, and Dashboards composing 1+ Graphs.
[beaver]
redis_url:redis://10.5.88.6:6379/0