Skip to content

Instantly share code, notes, and snippets.

@perzizzle
perzizzle / agent.json
Created July 17, 2019 15:19
Consul server agent config
{
"bootstrap_expect": 3,
"server": true,
"log_level": "INFO",
"enable_syslog": true,
"datacenter": "dc1",
"data_dir": "/consul/data",
"encrypt": "asdfasdfasdf==",
"client_addr": "127.0.0.1",
"enable_local_script_checks": true,
@perzizzle
perzizzle / redfish_update.py
Created March 29, 2019 16:33
Some python for using the redfish api to apply firmware
# Inspired by https://github.com/dell/iDRAC-Redfish-Scripting/blob/master/Redfish%20Python/DeviceFirmwareDellUpdateServiceREDFISH.py
import requests
import json
import time
def main():
module = AnsibleModule(
argument_spec = dict(
idrac_hostname = dict(type='str', required=True),
@perzizzle
perzizzle / sideload.tick
Last active September 12, 2018 13:46
Example template for sideloading a value for threshold
//template
var data = batch
|query(query)
.period(window)
.every(every)
.groupBy(groups)
|sideload()
.source(path)
.order(file)
.field(key, default)
@perzizzle
perzizzle / service_control.ps1
Created June 15, 2016 19:20
service control
Param(
[Parameter(Mandatory=$True,Position=1)] [string] $cmd,
[Parameter(Mandatory=$True,Position=2)] [string] $serviceName
)
$Services = Get-Service | Where-Object {$_.name -like $serviceName}
foreach ($Service in $Services) {
$name = $Service.name
$status = $Service.status
@perzizzle
perzizzle / bigip_gtm_facts.yml
Created September 14, 2015 19:56
GTM Facts
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Michael Perzel
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@perzizzle
perzizzle / extra_vars.yml
Last active August 29, 2015 14:24
GTM extra vars example
---
f5_gtm_server: 123.456.789 #f5 ip address
f5_username: mperzel #username
f5_password: IamSecure #password
gtm_wide_ip: my_wide_ip #wide ip name
#lb_method: ratio
lb_method: round_robin
gtm_virtual_server_name: my_virtual_server_name
gtm_virtual_server_server: my_virtual_server_server
address: 987.654.321 #virtual server address
@perzizzle
perzizzle / main_wide_ip.yml
Created July 6, 2015 21:13
Ansible playbook to validate bigip_gtm_wide_ip.py
---
- name: Network Automation Validation Playbook
hosts: 127.0.0.1
connection: local
gather_facts: false
tasks:
- name: Validate wide-ip Set lb method
bigip_gtm_wide_ip:
server={{ f5_gtm_server }}
@perzizzle
perzizzle / bigip_gtm.py
Last active August 29, 2015 14:20
GTM F5 Python wide_ip/pool
try:
import bigsuds
except ImportError:
bigsuds_found = False
else:
bigsuds_found = True
def bigip_api(bigip, user, password):
api = bigsuds.BIGIP(hostname=bigip, username=user, password=password)
return api
@perzizzle
perzizzle / jenkins.groovy
Last active August 29, 2015 14:19
Jenkins API Calls
package com.surescripts.devops.util
import hudson.model.*
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.ContentType
import static groovyx.net.http.Method.*
// get current thread / Executor
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27475 awx 20 0 1069m 458m 6896 S 5.3 12.0 2:06.13 awx-manage
27509 awx 20 0 490m 47m 3768 S 0.7 1.2 0:00.73 awx-manage
27358 awx 20 0 1028m 70m 5984 S 0.3 1.9 0:11.79 httpd
27473 root 20 0 191m 9848 1028 S 0.3 0.3 0:00.84 supervisord
27477 awx 20 0 308m 47m 4948 S 0.3 1.2 0:05.32 awx-manage
27506 awx 20 0 320m 45m 2924 S 0.3 1.2 0:00.34 awx-manage
27507 awx 20 0 333m 38m 812 S 0.3 1.0 0:00.16 awx-manage
31554 awx 20 0 491m 47m 3812 S 0.3 1.3 0:02.78 awx-manage