vim, Puppet, Vagrant and Icinga 2 syntax highlighting

vim is my preferred editor after all. Even I hack Icinga 2 code with vim way faster than any other interface. vim requires some configuration love of course.

Many distributions do not install vim or set it as default editor. In the Git training sessions on Debian/Ubuntu we’ll have a lab for making vim the default for example. Inside the CentOS base box used for the Icinga 2 Vagrant boxes I’ll also ensure via puppet manifest to install the vim package.

Now for the configuration bits – one keeps a local $HOME/.vimrc with own customizations. That works fine for your own workstation but what if you want to automate such setups and distribute a custom vimrc config on all your servers? You could keep just a file and sync that using Puppet manifests of course. But what about the mentioned default editor settings? And you do not want to break anything with a syntax error?

I’ve found this puppet-vim module pretty nifty and helpful. The most recent commit inside the Vagrant boxes uses it already.

class { 'vim':
  opt_bg_shading => 'light',
}

There are many other options available such as setting it as default editor on Debian. To mention some more:

  • opt_nocompatible
  • opt_bg_shading – I prefer a light background, also easier on a beamer for an Icinga Camp demo
  • opt_lastposition – jump to the last position when opening a file. I definitely want that everywhere.
  • opt_syntax – enable syntax highlighting. On older systems or Debian this is disabled by default.
  • opt_misc – sets some interesting default values for incremental search, etc.:
    [‘hlsearch’,’showcmd’,’showmatch’,’ignorecase’,’smartcase’,’incsearch’,’autowrite’,’hidden’]

In case you ask – why do you care so much about vim? I wanted to integrate the new Icinga 2 vim syntax highlighting packages into the Vagrant boxes. Just install “vim-icinga2” (currently snapshot packages, available with 2.5.0) and you’re ready to go. This is also part of our Icinga 2 training sessions helping you to understand keywords and object definitions far more easy.

  package { 'vim-icinga2':
    ensure => 'latest',
    require => [ Class['icinga_rpm'], Class['vim'] ],
    alias => 'vim-icinga2'
  }

Enjoy vim everywhere :-)

vagrant_icinga2_vim_syntax_highlighting

Vagrant box playtime

vagrant_icingaweb2_dashboardWhile preparing for our OSMC booth and talk, we thought about enhancing the existing Vagrant boxes and include more demo cases. While the icinga2x-cluster boxes illustrate the cluster in a master-checker setup, the standalone box icinga2x focuses on a single Icinga 2 instance with Icinga Web 2 and the Icinga 2 API.

Alongside the Icinga 2 API and Icinga Web 2 there are numerous additions to the icinga2x Vagrant box:

 

PNP

vagrant_icinaweb2_detail_graphs_ttsPNP4Nagios is installed from the EPEL repository. The Icinga 2 Perfdata feature ensures that performance data files are written and the NPCD daemon updates the RRD files. Navigate to the host or service detail in Icinga Web 2 and watch the beautiful graphs. There’s also a menu entry in Icinga Web 2 providing an iframe to the PNP web frontend on its own.

 

GenericTTS

There are demo comments including a ticket id inside the Vagrant box. A simple script feeds them into the Icinga 2 API and the Icinga Web 2 module takes care of parsing the regex and adding a URL for demo purposes.

 

Business Process

vagrant_icingaweb2_business_processThe box provides 2 use cases for a business process demo: web services and mysql services. In order to check the MySQL database serving DB IDO and Icinga Web 2, we’ve added the check_mysql_health plugin (Icinga 2 v2.4 also provides a CheckCommand inside the ITL <plugins-contrib> already, so integration is a breeze).

These Icinga 2 checks come configured as Business Processes in the Icinga Web 2 module which also allows you to change and simulate certain failure scenarios. You’ll also recognise a dashboard item for the Top Level View allowing you to easily navigate into the BP tree and the host and service details. Pretty cool, eh?

 

NagVis

vagrant_icingaweb2_nagvisThe puppet module installs the latest stable NagVis release and configures the DB IDO as backend. The integration into Icinga Web 2 uses a newly developed module providing a more complete style and integrated authentication for the NagVis backend. Though there are no custom dashboards yet – send in a patch if you have some cool ones :)

 

 

Graphite

vagrant_graphite_webThe Graphite backend installation is helped with Puppet modules, the main difference is that Graphite Web VHost is listening on port 8003 by default (80 is reserved for Icinga Web 2). The carbon cache daemon is listening on 2003 where the Icinga 2 Graphite feature is writing the metrics to.

 

 

Grafana

vagrant_grafanaGrafana 2 uses Graphite Web as datasource. It comes preconfigured with the Icinga 2 dashboard providing an overview on load, http, mysql metrics and allows you to easily modify or add new graphs to your dashboard(s).

 

 

Dashing

vagrant_dashingWe’ve had a Dashing demo using the Icinga 2 API with us at Icinga Camp Portland though it required some manual installation steps. Since the Vagrant box already enabled the Icinga 2 API, the provisioner now also installs Dashing and the demo files. Note: Installing the Ruby gems required for Dashing might take a while depending on your internet connection. If Dashing is not running, call `restart-dashing`.

 

 

Playtime!

The icinga2x box requires a little more resources so make sure to have 2 cpu cores and 2 GB RAM available. You’ll need Vagrant and Virtualbox or Parallels installed prior to provision the box.

git clone https://github.com/Icinga/icinga-vagrant.git
cd icinga-vagrant/icinga2x
vagrant up

The initial provisioning takes a while depending on your internet connection.

Each web frontend is available on its own using the host-only network address 192.168.33.5:

Icinga Web 2 http://192.168.33.5/icingaweb2 icingaadmin/icinga
PNP4Nagios http://192.168.33.5/pnp4nagios
Graphite Web http://192.168.33.5:8003
Grafana 2 http://192.168.33.5:8004 admin/admin
Dashing http://192.168.33.5:8005

 

In the future we’ll add more Icinga Web 2 modules or other addons, just let us know what you want to play with or send a patch even :-)

Docker, Docker, Docker!

docker-logoWe are already using Docker and container based implementations during development, package builds and tests. This helps speed up development quite a lot next to the fancy Vagrant boxes. Since we’ve seen community members creating docker images for everything we thought we’d give it a try for our own official Docker container – our notebooks used in live demos at Icinga Camps certainly say thanks ;)

One problem arises – Docker containers are not made for running multiple applications, you would normally run each application inside its own container, and only export volumes and ports for communication links. A demo environment for Icinga 2 requires as least:

  • Web server (httpd, apache2, etc)
  • Database server (MariaDB, etc)
  • Icinga 2 daemon

Furthermore we want to serve Icinga Web 2 as primary frontend and need to export port 80 for browser access. Even with SSH access for whatever comes to mind.

There’s already a Debian based Docker container using supervisord starting multiple applications in foreground. Taking this example whilst adding our own requirements into a CentOS7 based container (similar to the Vagrant boxes) leads us to our very own icinga2 Docker container.

It requires you to have at least Docker v1.6.0+ installed, then fire away and bind port 80 to your host’s port 3080:

$ sudo docker run -ti -p 3080:80 icinga/icinga2

Navigate to http://localhost:3080/icingaweb2/ and login using icingaadmin/icinga as credentials.

Keep in mind that the Docker container was made for test, development and demo purposes without any further production support.

If you’re planning to try Icinga Web 2 for example and want to test your own local patches, just mount the exported volumes like this:

$ sudo docker run -ti -p 3081:80 -v /usr/share/icingaweb2 /etc/icingaweb2 icinga/icinga2

There are additional volumes for /etc/icinga2 and /var/lib/icinga2 available. If you’re planning to modify the container image, you’ll find all required instructions inside the git repository.

On the long run, one might think of an Icinga 2 application cluster based on Docker containers. Who knows – happy testing & sending patches! :-)

Icinga Core 1.8.1 and Icinga 1.8 Web Virtual Machines

The virtual appliances for Icinga Core 1.8.1 and Icinga 1.8 Web are ripe for your picking!

Select from Virtual and VMWare versions of both Core and Web in three different flavours– Debian, OpenSUSE & CentOS.

If you’re curious as to how we’ve improved this round of virtual machines, see our change log below:

Open SUSE VM
* Added a license file to the OpenSUSE VM to access from desktop #2658
* Enabled queries to be identified by instance_name icinga-demo #2657

All VMs
* Made Icinga users password-free for more demo convenience #2625
* Added locales beyond US.UTF-8 #2624

So, download your preferred VM and let us know if you have ideas for improvements, get stuck, or find a bug you’d like to help us with. Don’t forget that the VMs are not intended for production environments – with that in mind, happy testing!

Icinga VM 1.7 Beta

Icinga VM 1.7 Beta are now available for download and ready to test!

Again, we prepared VirtualBox and VMWare versions for you on three different Linux flavors (CentOS, Debian, OpenSuSE)! Since the last release of the VMs, the new ones include Icinga and Icinga-Web 1.7.

As always, you can use our development tracker to share bugs you might find. You can find tips on how to do that in the FAQ and HowTo sections. Feedback is always welcome!

 

Your help is much appreciated!

Icinga Virtual Appliances for OpenSUSE, CentOS & Debian

A while back we shared a Fedora 13 based virtual appliance for use with Virtual Box 2.2.

Times have moved on and building on user feedback, we (Team Quality Assurance & VM) now present three new virtual appliances in both VirtualBox and VMWare.

Simply download Icinga Virtual Image in your operating system of choice, and have a fully-fledged Icinga instance installed before your eyes.

 

Each neat little package includes your desired interface – Debian 6.0.3 (Squeeze), CentOS 6 or OpenSUSE 11.4 and…

  • 32bit VM
  • Default Icinga 1.6.1 with usual plugins, IDOUtils (MYSQL) and Icinga Web 1.6.1
  • XFCE with auto-login
  • Firefox with three tabs open (README with all the login credentials, Classic UI and Icinga Web)

Requirements: Working virtualization environment (tested on Virtualbox 4.1.8 and VMWare Player 4)

Download VirtualBox VMs:
Icinga VM on Debian
Icinga VM on OpenSUSE

Icinga VM on CentOS

Download VMWare VMs:
Icinga VM on Debian
Icinga VM on OpenSUSE 
Icinga VM on CentOS

NOTE: These virtual appliances are demo systems and are not intended for production environments.

The Icinga VMs can be found on our Sourceforge pages.

As always, let us know how you go with them – in the comments, on the development tracker (VM project) and on the mailing lists.

Also, kudos to Assaf Flatto, who gave me a hand and prepared the CentOS VM. He’s a great addition to the Icinga Team!