Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim pletch

  • Carmel, IN
View GitHub Profile
@pletch
pletch / scrape_opnsense_dhcp_leases.py
Last active Mar 27, 2021
Scrape OpnSense DHCP Leases Status Page and Export Results to JSON
View scrape_opnsense_dhcp_leases.py
#!/usr/bin/env python3
# # This python script provides a function to query the opnSense (+v21.3) dhcp leases status page and return a list of tuples including
# ip, hostname, and mac address. To use, ensure LXML is installed via package manager or via pip.
#
# 27-Mar-2021 - Original release
#
import sys
@pletch
pletch / wl_snmpd.sh
Last active Oct 6, 2020 — forked from anonymous/wl_snmpd.sh
simple script to run a triggered snmp command get to wifi client info
View wl_snmpd.sh
#!/bin/sh
# Modified script to provide detailed wifi client info on atheros 9k based device with LEDE/OpenWRT. Script requires 'bc'
# package to output results. Output was designed to match the OID results from an Engenius EAP600 when queried via SNMP.
#
# Outputs summary of client stats for each radio in the following format "mac address, SNR, total data received,
# connection rate"
# Example output:
# iso.3.6.1.4.1.14125.2.1.1.15.9.0 = STRING: "cc:aa:bb:dd:ee:ff -56 445942Kb 105M,"
# iso.3.6.1.4.1.14125.2.1.1.16.9.0 = STRING: "aa:bb:cc:dd:ee:ff -64 18388740Kb 78M, bb:bb:cc:dd:ee:ff -63 77624Kb 44M,"
@pletch
pletch / scrape_pfsense_dhcp_leases.py
Last active Jun 20, 2022
Scrape PFSense DHCP Leases Status Page and Export Results to JSON
View scrape_pfsense_dhcp_leases.py
#!/usr/bin/env python3
# # This python script provides a function to query the pfsense (+v2.4) dhcp leases status page and return a list of tuples including
# ip, hostname, and mac address. To use, ensure LXML is installed via package manager or via pip.
#
# 16-Dec-2016 - Original release
# 3-Sep-2020 - Minor update to match formatting of leases page in latest pfSense version (2.4.5).
# 9-Sep-2020 - Backported improvements to handle table rows with missing data, use global variables for user/pass/server_ip,
# and return list from scrape function as implemented by fryguy04 in fork here:
# https://gist.github.com/fryguy04/7d12b789260c47c571f42e5bc733a813
@pletch
pletch / get_pfqueue_data.sh
Last active Sep 9, 2020
Scrape pf QOS metrics for forwarding to InfluxDB
View get_pfqueue_data.sh
#!/bin/sh
#
# Shell script: get_pfqueue_data.sh
# Date: 21-Dec-2016
#
# Script to scrape queue metrics from pfctl
# and output in influxdb line protocol with interface name &
# q name as tags and q bytes & q drops as data.
#
# Copy this script to a directory on your pfsense machine and ensure