Skip to content

Instantly share code, notes, and snippets.

@unicolet
Created October 22, 2012 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unicolet/3931927 to your computer and use it in GitHub Desktop.
Save unicolet/3931927 to your computer and use it in GitHub Desktop.
manage snmpd with salt
snmp_ro_community: xxxxxxx
snmp_management_station: 10.0.0.1
syslocation YOUR LoCATION
syscontact YOUR CONTACT
rocommunity {{ pillar['snmp_ro_community'] }} {{ pillar['snmp_management_station'] }}
ignoreDisk ram*
ignoreDisk loop*
ignoreDisk fd*
ignoreDisk md*
ignoreDisk /proc
ignoreDisk /proc/*
ignoreDisk /sys
ignoreDisk /dev/*
ignoreDisk /var/lib/nfs/rpc_pipefs
includeAllDisks 10%
# snmpd command line options
OPTIONS="-LS 0-4 d -Lf /dev/null -p /var/run/snmpd.pid"
net-snmp:
pkg:
- installed
service:
- name: snmpd
- running
- require:
- pkg: net-snmp
/etc/snmp/snmpd.conf:
file.managed:
- source: salt://files/snmpd.conf
- user: root
- group: root
- mode: 644
- template: jinja
- require:
- pkg: net-snmp
- watch_in:
- service: snmpd
/etc/sysconfig/snmpd.options:
file.managed:
- source: salt://files/snmpd.options
- user: root
- group: root
- mode: 644
- template: jinja
- require:
- pkg: net-snmp
- watch_in:
- service: snmpd
snmpd:
service.running:
- enable: True
- reload: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment