diff --git a/README.md b/README.md index f17ad41176cf7a633c4254e6406b1724d068a10a..126417705e43dfc353f0fc1a3308287304129297 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,35 @@ Basic server configuration used for most unix based servers at HsH. * **apt** proxy, sources.list and sources.list.d * **openvmtools** use them for vmware * **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 - * **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 diff --git a/hshbase/defaults.yaml b/hshbase/defaults.yaml index 7f8041127493f9ad287b8e142c2b91ce6c874188..ecbeb53885107b91c51649776c64fa8ea597ee0f 100644 --- a/hshbase/defaults.yaml +++ b/hshbase/defaults.yaml @@ -10,3 +10,4 @@ hshbase: system: en_US.UTF-8 present: - de_DE.UTF-8 + snmpd: True diff --git a/hshbase/init.sls b/hshbase/init.sls index da8c9036126518f2e0b95f80e405d711c6d7bdde..c4f6ed6a3bec22e7cec80f343dfee757e88a46c2 100644 --- a/hshbase/init.sls +++ b/hshbase/init.sls @@ -2,24 +2,9 @@ # Include all submodules by default - they ca be disable in pillar, if necessary include: + - .pythonpackages - .apt - .openvmtools - .time - .locale - -# 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 %} + - .snmpd diff --git a/hshbase/pythonpackages.sls b/hshbase/pythonpackages.sls new file mode 100644 index 0000000000000000000000000000000000000000..e8367fbfa75b952e9578d8fc05480b6aa61e34b5 --- /dev/null +++ b/hshbase/pythonpackages.sls @@ -0,0 +1,16 @@ +# 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 %} diff --git a/hshbase/snmpd/files/default.snmpd b/hshbase/snmpd/files/default.snmpd new file mode 100644 index 0000000000000000000000000000000000000000..60af2f267910958b4889af07f9640aa3e463d941 --- /dev/null +++ b/hshbase/snmpd/files/default.snmpd @@ -0,0 +1,3 @@ +# Don't load any MIBs by default. +# You might comment this lines once you have the MIBs downloaded. +export MIBS=UCD-SNMP-MIB diff --git a/hshbase/snmpd/files/snmpd.conf b/hshbase/snmpd/files/snmpd.conf new file mode 100644 index 0000000000000000000000000000000000000000..b2d713e2b48ef0b514dd44a95130d4928bfc5eb0 --- /dev/null +++ b/hshbase/snmpd/files/snmpd.conf @@ -0,0 +1,23 @@ +# 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 diff --git a/hshbase/snmpd/init.sls b/hshbase/snmpd/init.sls new file mode 100644 index 0000000000000000000000000000000000000000..239a909f2c54749a4b2423680e81e9f48d790b29 --- /dev/null +++ b/hshbase/snmpd/init.sls @@ -0,0 +1,38 @@ +{% 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 %}