Tag Archive for 'API'

Icinga development visualized by Gource

Hi there,

Icinga and the fork happened not that long ago but during this period of time a lot of nice things happened.

Providing Icinga Core with integrated IDOUtils supporting MySQL/Postgres/Oracle, fresh docbook format and therefore enhanced documentation, a completely new Icinga API based on IDOUtils and providing data for the new upcoming Icinga Web. Also lots of other improvements and enhancements.

Writing a historical overview would get boring soon. So we decided to catch up on another Idea: gource.

It’s a small program fetching all commits within our git repositories (core, doc, api, web) and presenting the timeline and changes using rendered pictures.

But that’s not all, it is possible to convert that to nice looking movies.

But there is so much to tell…

Not this time!

Just relax and watch :-)

Icinga Core

Icinga Doc

Icinga API

Icinga Web

  • Share/Bookmark

Icinga Core 1.0 Stable & Icinga Web 0.9.1 alpha released!

December 16 2009: Today the Icinga Team releases the Icinga Core 1.0. This is a milestone for both the team and the project as a whole. After many months of hard work we are proud to bring you a stable, alternative monitoring solution. This release includes many changes as suggested by the community and in particular the inclusion of Oracle in IDOUtils.

With just as many new improvements, Icinga Web UI has hit release 0.9.1 alpha. We have added a makefile for easier installation and fixed installation permission and cache problems. More changes are still to come, including an ExtJS update to 3.0.3. See below for the full list of new developments across Icinga Core, API, Docs and Web.

As we are always eager to keep the momentum going, we have decided to release the stable Icinga Core alongside the Icinga Web 0.9.1 alpha. These two will converge again in the coming months to a uniform release status. Till then, we hope you like the latest improvements.

Core:

  • Improved IDOUtils with Oracle
    Added prepared statements for most called queries
    Split code into ocilib OR libdbi, to allow oracle to decide which rdbm lib will be used during configuration
  • idoutils: fixed duplicate rows in table system commands, timed events, timed event queue (missing unique keys)
  • idoutils: added upgrade path/sql queries for unique key failure – check docs for more information
  • idoutils: changed default data_processing_options in idomod.cfg
  • idoutils: fixed this version and perl path generation in db install scripts
  • idoutils: fixed save custom variables segfault

Docs:

  • Updates and fixes for quickstart guides
  • New section on upgrading Icinga & IDOUtils
  • Revised section for Icinga Web

API:

  • Restructured DB access for upcoming RDBM support
  • Made several fixes for table prefix, exception handling
  • Started a ‘how-to’ guide for upcoming documentation

Web:

  • Added makefile for easier installation
  • Fixed installation permission and cache problems
  • Modified .htaccess
  • Removed yui
  • Removed php notice warnings (isset, undef vars)
  • In the process of changing API result keys to uppercase
  • In the process of updating ExtJS to 3.0.3
  • Introducing commands through the web

Should you find any issues, please report them to the following links:

As always we look forward to your feedback, so feel free to drop us a comment.

  • Share/Bookmark

Icinga Web 0.9.0 alpha is revealed!

Sorry for the delay on the release, we had to catch several technical issues next to OSMC.

We decided to split the releases into Icinga Core and Icinga Web. Therefore you will find two several packages to download and install.

The Core contains the Icinga API and IDOUtils which are needed for a functional Web this time. Make sure to download Icinga 1.0 RC1 and install it with IDOUtils for MySQL, the API will be installed automatically in share/icinga-api/

The Icinga Web depends on the API – you have to point the config to the actual install path. There are also several prerequisites and dependencies to resolve, so please catch on the instructions in doc/install-fromscratch.txt and do not hesitate to ask questions on the mailinglists and/or report any issues/bugs on our dev tracker.

Please keep in mind that this is an alpha release and be patient while we are working on future versions! :-)

  • Share/Bookmark

Ode to Agavi

Closing into the 14 day rush to the next Icinga release 0.8.2, we had a moment to reflect on our coding madness. As a developer, the one thing that makes such work easier is the choice of a good framework. And that is why we take our hats off to our trusty Agavi framework.

Why Agavi? It was no hard choice. As an open source, PHP 5, object oriented framework, it met all our web interface needs.

Thanks to its very strict Model-view-controller architectural pattern, we have very clean, testable and easily extensible code. By separating user input from application actions and from the interface view, there is much less complexity in the design architecture which leads to greater flexibility and easier extension. Less complexity and not to mention PHP open Icinga to a much larger developer community.

Extensibility is also built in through its modular structure which is perfect for all the Icinga addons that will no doubt come in time. Addons can be easily integrated into the frontend, added on as modules.

Icinga Web Architecture – a home for an Addon

Icinga Web Architecture – a home for an Addon

Unlike other frameworks which restrict which components can be used, Agavi is highly flexible and leaves most implementation choices the developer. So at the end of the day we have complete control over the code. It’s independence from database abstractions and multi-language support further enhances to Icinga’s flexibility, making it accessible to diverse users.

As Agavi is an active project, we trust it can only get better. Most recently, Agavi’s improvements to its build system and its integration of the Phing (Phing is not GNU make) makes coding that bit faster. And if you notice that ever ticking counter on the right, you would understand why.

  • Share/Bookmark

Using Icinga-API for fun and profit – IDO basics – part 1

Since Icinga-API is finally capable of supporting developers with
data we are going to blog a little to make coders out there feel
comfortable with this wonderful piece of work.

Here you can see the current progress of the API and related interfaces:

  • API overall: 50%
  • IDO interface: 50%
  • file interface: 25%

If you want to fetch data from the IDO you have to take care about the
following requirements:

  • PHP5
  • web-server module for PHP PDOs

Enough talking… let’s see some code!

1.) configuration

Configuration is simply done by using an associative array.

$idoConfig = array (
	‘type’ 		=><Type of database>,
	‘host’ 		=><Database hostname>,
	‘database’ 	=><Databasename>,
	‘user’ 		=><Username>,
	‘password’ 	=><password>,
	‘persistent’ 	=> <true | false>,
	‘table_prefix’ 	=><table prefix>,
);

Example:

$idoConfig = array (
	‘type’ 		=>mysql,
	‘host’ 		=> ‘localhost’,
	‘database’ 	=> ‘ido’,
	‘user’ 		=> ‘idouser’,
	‘password’ 	=> ‘idopassword’,
	‘persistent’ 	=> true,
	‘table_prefix’ 	=> ‘icinga_’,
);

2.) fetching data: hostnames and corresponding states
Create an instance of class IcingaApi:

$api = IcingaApi::getConnection(IcingaApi::CONNECTION_IDO, $idoConfig);

Create your search:

$apiRes = $api->createSearch()
->setSearchTarget(IcingaApi::TARGET_HOST)
->setResultColumns(array(’HOST_NAME’, ‘HOST_CURRENT_STATE’))
->fetch();

By using setSearchFilter() you can define filters to narrow down the result set:

$apiRes = $api->createSearch()
->setSearchTarget(IcingaApi::TARGET_HOST)
->setResultColumns(array(’HOST_NAME’, ‘HOST_CURRENT_STATE’))
->setSearchFilter(HOST_NAME, ‘Switch%, IcingaApi::MATCH_LIKE)
->fetch();

3.) processing result

foreach($apiRes as $apiHandle){
	echo ‘Host ‘.$apiHandle->host_name.’ has state ‘.$apiHandle->host_current_state.<br />;
}

Output without filter:
Host localhost has state 0
Host MySql has state 0
Host router-01 has state 0
Host windows100 has state 0
Host Apache_01 has state 0

Output with filters:
Host switch70 has the current state 0
Host switch71 has the current state 0
Host switch72 has the current state 0
Host switch73 has the current state 0
Host switch74 has the current state 0
Host switch75 has the current state 0
Host switch76 has the current state 0
Host switch77 has the current state 0

4.) complete code without use of filters:

<?
// Path to icinga api file
$apiFile = ‘icinga-api/IcingaApi.php’;
 
// Database connection
$idoConfig = array (
	‘type’ 		=>mysql,
	‘host’ 		=> ‘localhost’,
	‘database’ 	=> ‘ido’,
	‘user’ 		=> ‘idouser’,
	‘password’ 	=> ‘idopass’,
	‘persistent’ 	=> true,
	‘table_prefix’ 	=> ‘icinga_’,
);
 
// Include required files
require_once($apiFile);
 
// Instance the class
$api = IcingaApi::getConnection(IcingaApi::CONNECTION_IDO, $idoConfig);
 
// Create search
$apiRes = $api->createSearch()
->setSearchTarget(IcingaApi::TARGET_HOST)
->setResultColumns(array(’HOST_NAME’, ‘HOST_CURRENT_STATE’))
->fetch();
 
// Create output
foreach($apiRes as $apiHandle){
	echo ‘Host ‘.$apiHandle->host_name.’ has the current state ‘.$apiHandle->host_current_state.<br />;
}
?>

That’s all folks but there’s more to follow!

Please have a look at the git repository for further information:
https://git.icinga.org/index?p=icinga-api.git;a=summary

Have fun!

  • Share/Bookmark