Friday, December 30, 2011

Search (and replace) Newlines in Excel

Excel is a great tool for simple and easy data management.
But sometimes there are just limitations (of the user).

For example replace all new lines (line breaks) with some other character sequences.
It can be done, you just have to know how:

1. Open the search replace dialog
2. In the search field enter CTRL+j  (It's OK, it shows nothing)
3. In the replace field enter the new sequecne (For example \n or 0x0a etc.)
4. Hit on "Replace all"

That's it, the magic is done.
Of course microsoft does not tell you this in his offline/online help (For whatever reasons)

Wednesday, December 21, 2011

Doing a Liferay migration from 3.6.1 to 6.0.6

Perhaps you have a older liferay installation and wish to get it updated to the current 6.0.6 release.
The normal upgrade procedure is doing it setp-by-step and it should work.

For me it worked only partially, I had to make some special steps to get a fully working upgrade across these versions.

The full details can be read here:

Any yes, Liferay 6 rocks

Thursday, December 1, 2011

Using free variables in nagios/icinga for snmp community settings

With icinga you can monitor your it environment. It's a fork of the well known nagios monitoring solution.

It's a dropin replacement of nagios with some good extensions/enhancements.

One of the pains to monitor services via SNMP is, that you usually have different SNMP communities per server. The simplest way is to define one service per service+host and there define the snmp community.

But after a your IT environment expands you will get many many service definition, all identical with the exception of the snmp community.

There is a simple way out of this: Use custom object variables
The original documentation can be found here.

The documentation is somewhat short, so here a complete example:
  • On the host configuration, define a variable named _SNMP_COMMUNITY and assign it the value for the specified host.
  • In the check command, specify the $_HOSTSNMP_COMMUNITY$ as the parameter for your command.
The trick is, that your variable names must always start with a underline character. (So it does not clash with other definitions).
The second trick is used when referring to the defined variable: Icinga/Nagios do prefix the variable name you defined with _HOST / _SERVICE or _CONTACT, depending on the place where the variable was specified.
The last trick is, that the leading _ of your variable definition is removed before the final name is built in the evaluation.

Example of such a command definition

define command {
        command_name check_snmp_disk_group
        command_line $USER1$/ -H $HOSTADDRESS$ -C $_HOSTSNMP_COMMUNITY$  -w $ARG1$ -c $ARG2$ -m $ARG3$ -r -T pl -f
        register                        1

The corresponding host definition has then to be similar to this:

define host {
        host_name                       servername
        alias                           serveralias
        address                         ipaddress
        _SNMP_COMMUNITY                 mysnmppassword
        register                        1

A great tool to manage your icinga/nagios configuration is NagiosQL.