Create our own plugins for Check_MK and WATO

For a long time I used Nagios Core without Check_MK or any other GUI for configuration. I used pynag for massive changes, but nothing else.

When I needed to check for something specific, I just wrote what I needed on bash, put as many arguments/parameters/variables I wanted and added it to the commands.cfg file.

But with Check_MK and WATO, that’s a little different. We could add whatever we want as script but configure the arguments it’s not so easy (it’s not hard either). Mathias Kettner explains it very well on the documentation, but I wanted to have my own experience on my blog.

I won’t write about how to do a script. I will just give an example about what I did.

Necessary files

We will create 3 files: the plugin itself – the check function – the manual page

/usr/lib/check_mk_agent/plugins/lxc_mem
/usr/share/check_mk/checks/lxc_mem
/usr/share/doc/check_mk/checks/lxc_mem.mem

We also will modify this one:

/usr/share/check_mk/web/plugins/wato/check_parameters.py
Continue Reading

Install GlusterFS Cluster on Debian 8

Introduction

GlusterFS is a scalable network filesystem. Using common off-the-shelf hardware, you can create large, distributed storage solutions for media streaming, data analysis, and other data- and bandwidth-intensive tasks. GlusterFS is free and open source software.

Preliminary Note

In this tutorial, I will use three systems, two servers and a client:

  • gfsnode01.lplinux.com.ar: IP address 192.168.1.100 (server)
  • gfsnode02.lplinux.com.ar: IP address 192.168.1.101 (server)
  • proxmox01.lplinux.com.ar: IP address 192.168.1.102 (client)

All three systems should be able to resolve the other systems’ hostnames. If this cannot be done through DNS, you should edit the /etc/hosts file so that it looks as follows on all three systems:

vim /etc/hosts
127.0.0.1 localhost
192.168.1.100 gfsnode01.lplinux.com.ar gfsnode01
192.168.1.101 gfsnode02.lplinux.com.ar gfsnode02
192.168.1.102 proxmox01.lplinux.com.ar proxmox01


# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

(It is also possible to use IP addresses instead of hostnames in the following setup.

Continue Reading

Create an LXC Container on Proxmox 4.1

With our server installed we are going to  create our first VM using LXC.

Imagen10

We have to select the node where we want to create the VM (if we have a cluster we could pick any node), the VMID, the hostname (FQDN or not) and the root password:

Imagen11

Next step is select the storage that contains the templates and pick one for the new machine (you can download from here or have your own).

Imagen12

Go next and put the disk and the storage that should contain the VM (be careful with this value, since you won’t be able to change it easily).

Imagen13

Next we have to set the CPU Limit and CPU Units for the machine.

Imagen14

We also have to set the memory assigned to the machine…

Imagen15

… and the network parameters.

Imagen16

We could set a different DNS Server or just leave the same of the host.

Imagen17

As final step

Continue Reading

Install Proxmox 4.1

First thing to do is download and burn the ISO file of Proxmox VE Server 4.1:

http://www.proxmox.com/en/downloads/item/proxmox-ve-4-1-iso-installer

Boot and pick the installation process.

Imagen01

Agree with the EULA.

Imagen02

Select the Hard drive to install the OS.

Imagen03

 

Set up the TimeZone and the Location.

Imagen04

Set the root password and an email.

Imagen05

Specify the hostname (FQDN) and network parameters.

Imagen06

Wait until the installation process is finished.

Imagen08

 

Reboot the system and ready to start managing it through th GUI https://192.168.1.133:8006/

Imagen09

Continue Reading