Polish up our SNMP checks and playbooks

This commit is contained in:
Salt 2021-08-15 13:09:04 -05:00
parent c745de9309
commit 2918a3348b
2 changed files with 19 additions and 1 deletions

View File

@ -19,3 +19,11 @@
snmpd_disks_include_all: yes
snmpd_disks_include_all_threshold_minpercent: "10%"
tags: [ snmp ]
- hosts: all
tasks:
- name: disable snmpd when not tagged
systemd: name={{ item }} state=stopped enabled=no
with_items:
- snmpd.service
when: "'tags_snmp' not in group_names and item in services"
tags: [ zerotier ]

View File

@ -50,7 +50,11 @@ define service {
}
# Commands
# Ain't nobody here but us chickens...
define command {
# This command was manually added and should be present in all backups
command_name check_snmp_storage_v3
command_line /opt/Custom-Nagios-Plugins/check_snmp_storage.pl -H $HOSTADDRESS$ -l {{ secret_snmp_rouser_username }} -x {{ secret_snmp_rouser_password }} -X {{ secret_snmp_rouser_privacy_passphrase }} -L sha,aes -t 20 -m $ARG1$ -w $ARG2$ -c $ARG3$
}
# Services for all hosts
define service {
@ -73,6 +77,12 @@ define service {
check_command check_snmp!-P 3 -a SHA -x AES -o 1.3.6.1.2.1.1.1.0 -U {{ secret_snmp_rouser_username }} -A {{ secret_snmp_rouser_password }} -X {{ secret_snmp_rouser_privacy_passphrase }} -r $HOSTNAME$ -L authPriv
hostgroup_name snmp
}
define service {
use ansible-generic-service
service_description SNMP Check Disk
check_command check_snmp_storage_v3!^/$!80!90
hostgroup_name snmp
}
# Hostgroups
# Everything here is dynamically-generated based on tags from Netbox