Skip to content

Instantly share code, notes, and snippets.

@dlangille
dlangille / create.sh
Last active December 26, 2023 22:01
snmp v3 clients for LibreNMS
For more up to date information, see https://dan.langille.org/2023/08/16/configuration-of-net-mgmt-net-snmpd-on-freebsd/
Do this on the snmpd client:
service snmpd stop
net-snmp-config --create-snmpv3-user -ro -A 'AuthPass' -X 'PrivPass' -a SHA -x AES MyRoGroup
chmod go-rwx /var/net-snmp/snmpd.conf /usr/local/share/snmp/snmpd.conf
verify MyRoGroup is in /usr/local/share/snmp/snmpd.conf
@tomoconnor
tomoconnor / dhcpd.conf
Created April 20, 2011 17:11
snippet to show usage of dhcp-event (don't forget to set apparmor to allowing (complain) mode)
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", host-decl-name));
execute("/usr/local/bin/dhcp-event", "commit", ClientIP, ClientMac, host-decl-name);
}