Skip to content

Instantly share code, notes, and snippets.

View standaloneSA's full-sized avatar

Matt Simmons standaloneSA

View GitHub Profile
all_hosts = [ ]
import redis as _redis
_remHost = "IPADDRESS"
_r = _redis.Redis(host=_remHost, port=6379, db=0, password="PASSWORD")
_setname = "known-hosts"
graphite::gr_max_updates_per_second: 60
graphite::gr_storage_schemas:
- name: "default"
pattern: ".*"
retentions: "1s:60m,1m:7d,5m:3y,1h:10y"
- name: "CCIS Linux Stats"
pattern: "CCIS.systems.linux.*"
retentions: "1s:7d,1m:14d,5m:3y,1h:10y"
graphite::gr_web_servername: graphite.ccs.neu.edu
graphite::gr_enable_carbon_relay: true
#! /bin/bash
#
# collectd - start and stop the statistics collection daemon
# http://collectd.org/
#
# Copyright (C) 2005-2006 Florian Forster <[email protected]>
# Copyright (C) 2006-2009 Sebastian Harl <[email protected]>
#
### BEGIN INIT INFO
# We're going to use fpm to create the package.
# https://github.com/jordansissel/fpm
sudo gem install fpm
cd ~
# This is where we'll install the compiled collectd into
mkdir ~/collectd-package
# Get the source
@standaloneSA
standaloneSA / gist:bc2dc758005bccda4c81
Created April 28, 2015 12:28
Get the switchport a VM NIC is attached to
$MYHOSTNAME = "Your.Host.Here"
$VMNIC = "vmnic0"
$NS = (((Get-VMhost -name $MYHOSTNAME) | Get-View).ConfigManager.NetworkSystem)
(((Get-view -ID $NS).NetworkINfo.Pnic |
Where-Object { $_.Device -eq $VMNIC } |
%{ (Get-View -ID $NS).QueryNetworkHint($_.Device) }).ConnectedSwitchPort).PortID
@standaloneSA
standaloneSA / gist:fdcee007a392a572636a
Created June 30, 2015 13:51
CentOS 7 Bridge - Halp
[vagrant@vagrant-centos7 ~]$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.005056a70416 no eno16780032
veth0
[vagrant@vagrant-centos7 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
Monday, June 22nd, 2015 8 days ago
3:22 PM <MPSimmons> What I'm trying to do is have apache listen on a particular IP, and I'm doing it with ip => "$::fact::ipaddress_eno16780032_1"
3:22 PM <MPSimmons> (using the apache module from puppetforge)
3:22 PM <MPSimmons> facter only shows the first IP of the interface if I don't make it a sub-interface
3:23 PM <Thermi> MPSimmons: Creating a sub interface makes no sense for that
3:23 PM <MPSimmons> Why is that"?
3:23 PM <Thermi> Fix facter then.
3:23 PM <MPSimmons> That facter only shows the first IP is orthogonal to the problem, which is that I don't know how to create a subinterface
3:23 PM <Thermi> Because facter is broken? (Wild guess)
3:24 PM <tigalch> if that IP does not change - why not configure apache to listen to it in the configuration of apache?
msimmons@nagios:/opt/collectd/etc$ cat collectd.conf
# Generated by Puppet
#Hostname localhost
FQDNLookup true
#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"
#TypesDB "/usr/share/collectd/types.db" "/etc/collectd/my_types.db"
Interval 10
open("/var/run/SERVICE.pid", O_RDONLY) = -1 ENOENT (No such file or directory)
getpid() = 5778
open("/var/run/SERVICEd.pid", O_WRONLY|O_CREAT|O_TRUNC|O_NOFOLLOW, 0666) = 3
fcntl(3, F_GETFL) = 0x28001 (flags O_WRONLY|O_LARGEFILE|O_NOFOLLOW)
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08cc83a000
lseek(3, 0, SEEK_CUR) = 0
write(3, "5778\n", 5) = 5
close(3) = 0
munmap(0x7f08cc83a000, 4096) = 0
haproxy::frontend { 'myhost':
collect_exported => false,
mode => 'http',
bind => { "${::ipaddress_eth1}:443" => [ 'ssl', 'crt', '/etc/haproxy/certs/ssl.pem' ] },
options => { 'default_backend' => 'myhost'},
}