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

Proper location for gluster and documentation

parent bb58e423
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,86 @@
This formula provides rough capabilities to install the checkmk-agent and basic plugins that come with it.
It also contains a rough construction to run eapol_test against radsecproxy or freeradius.
## Structure of this formula
### States
* `checkmk/debian/` all states related to debian based boxes.
* `checkmk/freebsd.sls` for freebsd we are only able to roll out the agent - this state does it.
### Files used by states and needed for our minions.
* `checkmk/checkmk_files/` contains files that came from check_mk itself.
Including files to install checkmk agent and agent plugins that were distributed by check mk itself.
* `checkmk/custom_files/` contains agent plugins we've written ourselfes
* `checkmk/third-party-files/` contains agent plugins provided by someone else
## States
This formula provides several states that install or configure checkmk further.
The following example shows how to install the agent on a minion together with additional plugins.
**/srv/salt/top.sls**
```
base:
'yourminionglob':
- checkmk.debian
- checkmk.debian.mk_apt
- checkmk.debian.mk_logins
- checkmk.debian.netstat
- checkmk.debian.apache_status
```
### `checkmk.debian`
Installs and enables the checkmk agent on debian based systems.
### `checkmk.freebsd`
Installs and enables the checkmk agent on freebsd based systems.
### `checkmk.debian.apache_status`
Installs the [apache_status](https://checkmk.com/cms_check_apache_status.html) agent plugin.
Also configures checkmk regarding the plugin and the apache webserver as well.
Related files are in this folder directly.
### `checkmk.debian.contrack`
Installs the contrack agent plugin from heinlein.
### `checkmk.debian.gluster`
Installs the gluster agent plugin.
It is a custom plugin from us - located in `checkmk/custom-files/gluster`.
Documentation is currently located inside of the bash script.
### `checkmk.debian.netstat`
Installs the [netstat.linux](https://checkmk.com/cms_check_netstat.html) agent plugin
### `checkmk.debian.nginx_status`
Installs the [nginx_status](https://checkmk.com/cms_check_nginx_status.html) agent plugin.
### `checkmk.debian.mk_apt`
Installs the [mk_apt](https://checkmk.com/cms_check_apt.html) agent plugin
### `checkmk.debian.mk_logins`
Installs the [mk_logins](https://checkmk.com/cms_check_logins.html) agent plugin
### `checkmk.debian.mk_postgres`
Installs the [mk_postgres](https://checkmk.com/cms_check_postgres_stats.html) agent plugin
### `checkmk.debian.radsec`
Installs the radsec plugin.
### `checkmk.debian.smart`
Installs the [smart.stats](https://checkmk.com/cms_check_smart.stats.html) agent plugin
\ No newline at end of file
#!/bin/bash
# gluster agent plugin
#
# * determine all volumes
# * determie all bricks for this volume
# * discover brick information - yields output like that:
#
# Status of volume: fileadmin
# ------------------------------------------------------------------------------
# Brick : Brick t3web-00.it.hs-hannover.de:/srv/gluster/fileadmin
# TCP Port : 49152
# RDMA Port : 0
# Online : Y
# Pid : 609
# File System : xfs
# Device : /dev/sdd1
# Mount Options : rw,relatime,attr2,inode64,noquota
# Inode Size : N/A
# Disk Space Free : 108.5GB
# Total Disk Space : 120.0GB
# Inode Count : 62914048
# Free Inodes : 62693863
#
# We currently only utilize the Online: Y information.
# check the status of all bricks in all volumes
echo "<<<local>>>";
# iterate over all available volumns
for volume in $(gluster volume list)
do
# find all bricks for this volume
for brick in $(gluster volume info $volume | grep -E '^Brick[0-9]: ' | sed -e 's/Brick[0-9]: //g')
do
# grab the full status of this brick
brick_status=$(gluster volume status $volume $brick detail)
online=$(echo "$brick_status" | grep -E '^Online' | cut -d ':' -f2 | tr -d '[:space:]')
case "$online" in
......@@ -17,6 +44,7 @@ do
done
done
# expose glusterfs mounts as well
# https://github.com/bbhenry/check_mk_agent/blob/master/plugins/mk_gluster_mount.sh
echo "<<<mounts>>>";
grep fuse.glusterfs < /proc/mounts
......
hsh_checkmk_gluster_plugin:
file.managed:
- name: /usr/lib/check_mk_agent/plugins/gluster
- source: salt://checkmk/checkmk-files/gluster
- source: salt://checkmk/custom-files/gluster
- mode: 755
- user: root
- group: root
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment