Skip to content

Instantly share code, notes, and snippets.

View liveaverage's full-sized avatar
⚙️

J.R. Morgan liveaverage

⚙️
View GitHub Profile
@liveaverage
liveaverage / mod_cda.py
Created August 7, 2014 15:05
Syslog-ng "listener" Python app that digest ISE RADIUS accounting syslog messages and generates CDA/AD-agent RADIUS accounting update requests
import mod_radacct
# Dictionary path (can be relative or absolute):
dictionary = "dictionary"
# If missing a user domain in the syslog msg, this is provided:
default_domain = "DefaultDomain"
# List of CDA identity maintainers. Can include legacy AD Agent servers:
servers = [ "cda1", "cda2", "ada1", "ada2" ]
@liveaverage
liveaverage / update_cda.py
Created August 7, 2014 14:58
Syslog-ng "listener" Python app that digest ISE RADIUS accounting syslog messages and generates CDA/AD-agent RADIUS accounting update requests
#!/usr/bin/env python
import logging, re, sys, time
import mod_cda
PYTHONUNBUFFERED = "true"
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
@liveaverage
liveaverage / Set-Dhcp-Scope.ps1
Created July 30, 2014 20:55
Powershell wrapper for netsh and dnscmd functions used for DHCP scope creation.
############################
#AUTHOR: JR Morgan
#CREATED: 20120417
#MODIFIED: 20140611
############################
<#
.Synopsis
Adds DHCP Scope to ALL specified DHCP servers. If split-scope is desired
the script uses IP Math to automatically add the desired exlcude ranges.
@liveaverage
liveaverage / Execute-Local-64.bat
Created July 29, 2014 14:08
Local Check_MK: Bulk execute local checks in 64-bit consoles from x86 Check_MK
@echo off
REM Note that SysNative is available on x86 2008, and on x86 2003 with KB942589 applied
set CONSOLE_WIDTH=500
CD %ProgramFiles(x86)%\check_mk\local-64
FOR /R %%X IN ("*") DO ( %WINDIR%\SysNative\windowspowershell\v1.0\powershell.exe -File "%%X")
@liveaverage
liveaverage / check_Exchange_StorageGroups.ps1
Created July 29, 2014 13:50
Local Check_MK: check_Exchange_StorageGroups.ps1
$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size(900,900)
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$check_name = "Exchange_SG_CopyStatus"
$OK = 0
$Warn = 1
@liveaverage
liveaverage / check_Exchange_SG_LogTruncate.ps1
Created July 29, 2014 13:48
Local Check_MK: check_Exchange_SG_LogTruncate.ps1
$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size(900,900)
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$check_name = "Exchange_SG_LogTrunc"
$OK = 0
$Warn = 1
$Crit = 2
$Unk = 3
@liveaverage
liveaverage / check_DNS_Scavenge.ps1
Created July 29, 2014 13:47
Local Check_MK: check_DNS_Scavenge.ps1
$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size(500,300)
$server = $env:COMPUTERNAME
$global:debug = ""
$global:n_stat = ""
$global:n_stattext = ""
@liveaverage
liveaverage / check_dhcp_all_pools.sh
Created July 29, 2014 13:25
Different take on Lars Michelsen's original plugin/script to accommodate monitoring of all available DHCP scopes on your monitored Windows server. You no longer need to add separate service definitions to monitor all available scopes.
#! /bin/bash
# ##############################################################################
# check_dhcp_all_pools.sh - Nagios plugin
#
# This script querys a MS Windows DHCP-Server via SNMP v2 to fetch informations about the given DHCP-Pool.
#
# Copyright (C) 2006, 2007 Lars Michelsen <[email protected]>,
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@liveaverage
liveaverage / Sync-Dhcp-Reservations.ps1
Last active July 3, 2023 17:23
Sync-Dhcp-Reservations.ps1
<#
.Synopsis
Synchronizes DHCP reservations to all or select authorized DHCP servers in a given domain.
.Description
This script utilizes a user-specified source (master) DHCP server and synchronizes
all or some scope reservations between other, authorized DHCP servers for a given domain.
Netsh commands can be generated for manual execution or executed automatically.
.Parameter Source
@liveaverage
liveaverage / mod_radacct.py
Last active August 29, 2015 13:56
Cisco CDA (formerly Cisco AD Agent) RADIUS Accounting
import random, socket, sys, logging
import pyrad.packet
from pyrad.client import Client
from pyrad.dictionary import Dictionary
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
#Logger Console Handler