Skip to content
Snippets Groups Projects
Commit 37af4e78 authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

Add snmpd states; move pythonpackages into seperate .sls

parent 02cba444
No related branches found
No related tags found
No related merge requests found
...@@ -7,10 +7,35 @@ Basic server configuration used for most unix based servers at HsH. ...@@ -7,10 +7,35 @@ Basic server configuration used for most unix based servers at HsH.
* **apt** proxy, sources.list and sources.list.d * **apt** proxy, sources.list and sources.list.d
* **openvmtools** use them for vmware * **openvmtools** use them for vmware
* **locale** setup your servers locales * **locale** setup your servers locales
* **python-packages** we are using for salt grains or modules. * **time** use the configured time server and zone
* **snmpd** let whats up gold talk to you
* **python-packages** we are using for salt grains or modules
* **netifaces** useful information in grains about net cfg * **netifaces** useful information in grains about net cfg
* **psutil** who needs that?! * **psutil** TODO: who needs that?!
### hshbase
Installs everything
### hshbase.apt
Configures apt package manager on debian and ubuntu machines
### hshbase.time
Install NTP, and sets timezone + timeserver
### hshbase.openvmtools
Install the package open-vm-tools
### hshbase.locale
Install system locales and additional ones optionally
### hshbase.snmpd
Install snmpd ready to be used with [Whats Up Gold](https://whatsup.fh-h.de/)
## Configuration ## Configuration
......
...@@ -10,3 +10,4 @@ hshbase: ...@@ -10,3 +10,4 @@ hshbase:
system: en_US.UTF-8 system: en_US.UTF-8
present: present:
- de_DE.UTF-8 - de_DE.UTF-8
snmpd: True
...@@ -2,24 +2,9 @@ ...@@ -2,24 +2,9 @@
# Include all submodules by default - they ca be disable in pillar, if necessary # Include all submodules by default - they ca be disable in pillar, if necessary
include: include:
- .pythonpackages
- .apt - .apt
- .openvmtools - .openvmtools
- .time - .time
- .locale - .locale
- .snmpd
# Always ships this packages - we need them for grains
{% if grains['os'] == 'Debian' and grains['oscodename'] != 'squeeze' or grains['os'] == 'Ubuntu' %}
salt-python-packages:
pkg.installed:
- pkgs:
- python-netifaces
- python-psutil
{% elif grains['os'] == 'FreeBSD' %}
salt-python-packages:
pkg.installed:
- pkgs:
- net/py-netifaces
- py27-psutil
{% endif %}
# Always ships this packages - we need them for grains
{% if grains['os'] == 'Debian' and grains['oscodename'] != 'squeeze' or grains['os'] == 'Ubuntu' %}
hsh_python_packages_salt:
pkg.installed:
- pkgs:
- python-netifaces
- python-psutil
{% elif grains['os'] == 'FreeBSD' %}
hsh_python_packages_salt:
pkg.installed:
- pkgs:
- net/py-netifaces
- py27-psutil
{% endif %}
# Don't load any MIBs by default.
# You might comment this lines once you have the MIBs downloaded.
export MIBS=UCD-SNMP-MIB
# Listen on all interfaces - default is good
agentAddress udp:161,udp6:[::1]:161
# Credentials for SNMPv3 - used in What's Up Gold
createUser hshuser MD5 "hshmonitoringtest"
defaultMonitors yes
# specific disk monitoring
disk / 10000
disk /var 5%
# also list all other disks
includeAllDisks 10%
iquerySecName hshuser
linkUpDownNotifications yes
# maximum load threshold (1min, 5min, 15min)
load 12 10 5
master agentx
rouser hshuser
sysContact HsH Webteam
sysLocation HsH IT VDC
# 72 is alright for now. (No idea)
sysServices 72
# default systemonly view is fine
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
{% from "hshbase/map.jinja" import hshbase with context %}
{% if hshbase.snmpd %}
{% if grains['os'] == 'Debian' or grains['os'] == 'Ubuntu' %}
hsh_snmpd_installed:
pkg.installed:
- pkgs: [snmpd, snmp-mibs-downloader]
/etc/snmp/snmpd.conf:
file.managed:
- source: salt://hshbase/snmpd/files/snmpd.conf
- mode: 644
- user: root
- group: root
/etc/default/snmpd:
file.managed:
- source: salt://hshbase/snmpd/files/default.snmpd
- mode: 644
- user: root
- group: root
hsh_snmpd_service_running:
service.running:
- name: snmpd
- reload: True
- enable: True
- watch:
- file: /etc/snmp/snmpd.conf
- file: /etc/default/snmpd
- require:
- file: /etc/snmp/snmpd.conf
- file: /etc/default/snmpd
- pkg: hsh_snmpd_installed
{% endif %}
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment