Skip to content

Instantly share code, notes, and snippets.

View jantman's full-sized avatar
💭
I have a status.

Jason Antman jantman

💭
I have a status.
View GitHub Profile
@jantman
jantman / zmeventnotification.pl
Created July 5, 2018 17:14
zmeventnotification.pl
#!/usr/bin/perl -T
#
# ==========================================================================
#
# HEAVILY HACKED-UP VERSION OF zmeventnotification.pl from
# https://github.com/pliablepixels/zmeventserver/blob/master/zmeventnotification.pl
# as of b31b08f
#
# Modified to just execute a system() shell command and pass it the EventId, MonitorId and Cause.
# The command is run with "&" appended to background it and return control to Perl so we don't
@jantman
jantman / Jenkinsfile
Last active June 11, 2018 19:52
c7n_custom_template
#!/usr/bin/env groovy
// internal/private shared library; not terribly important to the functionality
@Library('re-pipeline-library@master') _
node {
deleteDir()
checkout scm
stash name: 'configs', includes: '*.yml, templates/*.html.j2'
#!/usr/bin/env python
"""
Process URL for intersphinx targets and emit html or text
originally retrieved from:
https://gist.github.com/gmr/11359058
fixed for python3 and pep8 compliance by jantman
"""
@jantman
jantman / set_pool_for_vip.py
Created January 7, 2016 13:23
bigsuds_python_f5_set_pool_for_vip
# This is a COMPLETELY UNTESTED code sample, written off the top of my head. Consider it pseudocode.
# It also needs more error checking; BigSuds *should* raise exceptions for any problem.
import re
import bigsuds as pc
# INPUTS
vip_name = 'myvip'
new_pool_name = 'bluepool' # the pool to send traffic to
@jantman
jantman / manual-example.html
Created January 20, 2014 17:20
Markdown generated html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Manual Examples</title>
<link rel="stylesheet" href="../../../theme/css/main.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@jantman
jantman / manual-example.md
Created January 20, 2014 17:18
Example Pelican markdown

Title: Manual Examples Date: 2014-01-19 06:00 Author: admin Category: Foo Tags: foo Slug: manual-examples

These are some manual examples...

A fenced code block of Python:

@jantman
jantman / 0_description.md
Created August 21, 2014 15:51
service noop issues

I feel like I must be missing something here.

  • The catalog JSON clearly shows noop=true on the Service[httpd] resource.
  • The agent log clearly shows the service was refreshed anyway
  • The httpd service logs clearly show the refresh actually happened (take my word on this one)
  • The report clearly does not reflect the refresh event - "out_of_sync_count: 0" "change_count: 0"
@jantman
jantman / error_output
Created July 30, 2014 14:03
beaker error - see rabbitmqadmin_spec.rb line 51
/home/jantman/personal/git/puppetlabs-rabbitmq/vendor/ruby/1.9.1/gems/beaker-1.16.0/lib/beaker/dsl/helpers.rb:438:in `confine': undefined method `hosts=' for #<Class:0x000000035b2360> (NoMethodError)
from /home/jantman/personal/git/puppetlabs-rabbitmq/spec/acceptance/rabbitmqadmin_spec.rb:51:in `block (2 levels) in <top (required)>'
from /home/jantman/personal/git/puppetlabs-rabbitmq/vendor/ruby/1.9.1/gems/rspec-core-2.99.1/lib/rspec/core/example_group.rb:368:in `module_eval'
from /home/jantman/personal/git/puppetlabs-rabbitmq/vendor/ruby/1.9.1/gems/rspec-core-2.99.1/lib/rspec/core/example_group.rb:368:in `subclass'
from /home/jantman/personal/git/puppetlabs-rabbitmq/vendor/ruby/1.9.1/gems/rspec-core-2.99.1/lib/rspec/core/example_group.rb:342:in `describe'
from /home/jantman/personal/git/puppetlabs-rabbitmq/spec/acceptance/rabbitmqadmin_spec.rb:47:in `block in <top (required)>'
from /home/jantman/personal/git/puppetlabs-rabbitmq/vendor/ruby/1.9.1/gems/rspec-core
@jantman
jantman / linkd-configuration.xml
Created April 18, 2014 14:43
linkd-configuration.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<linkd-configuration threads="5" initial_sleep_time="3600000"
snmp_poll_interval="18000000" discovery_link_interval="1800000"
enable-discovery-download="true">
<iproutes>
<vendor vendor_name="netscreen" sysoidRootMask=".1.3.6.1.4.1.3224"
class-name="org.opennms.netmgt.linkd.snmp.IpRouteTable">
<specific>1.51</specific>
@jantman
jantman / example.pp
Created February 7, 2014 17:02
puppet-managed nagios resources with purging
$config_dir = '/etc/nagios'
Nagios_host <<||>> {
target => "${config_dir}/nagios_host.cfg",
before => File["${config_dir}/nagios_host.cfg"],
}
file { "${config_dir}/nagios_host.cfg":
ensure => file,
owner => $nagios_user,