среда, 6 июля 2011 г.

SMS notifications in OpenNMS

We just got a lot of problems when our air conditioning system controller in data center went mad and didn't notice the failure of two air conditioners. The 60 Celsius degrees is not the best temperature for servers operations...
After dealing with this situation we decided to setup SMS-notification service at least for temperature in server room and several other parameters. We already had OpenNMS monitoring system configured, so we had to add SMS-notification to our setup.
This task was done in several steps. First of all, we created a script which would send SMS. We used Google Calendar for this purpose. One dedicated user (let's say opennms) was created for our monitoring system and all system administrators imported his calendar with the following notification settings:

  • Events reminders - By default remind me via sms 1 minutes before each event

  • New Invitations - SMS


Of course, system administrators had to register their phone numbers in Google Calendar.
When we want to send SMS notification, we create new event in opennms's calendar using gcalcli for this purpose.
We used the following script to create a new event (sleep was inserted to prevent mass event creation in case when everything is bad):

#!/bin/sh
H=$(/bin/date "+%H")
M=$(/bin/date "+%M")
sleep 1
event_text="$H:$M $@"
/usr/local/bin/gcalcli --user opennms --pw OurPassword --cals=owner quick "$event_text"


Then, we described a notification command in /usr/local/opennms/etc/notificationCommands.xml:

<command binary="true">
<name>SendSMS</name>
<execute>/root/bin/send_sms.sh</execute>
<comment>Send SMS by gcalcli</comment>
<argument streamed="false">
<switch>-subject</switch>
</argument>
<argument streamed="false">
<switch>-tm</switch>
</argument>
</command>

Argument elements describe script parameters, here we pass it notice subject and notice body (full list of possible parameters may be found here).

Later we created a destinationPath in /usr/local/opennms/etc/destinationPaths.xml:

<path name="SMS-Admins" initial-delay="0s">
<target interval="0s">
<name xmlns="">admin</name>
<autoNotify xmlns="">auto</autoNotify>
<command xmlns="">SendSMS</command>
</target>
</path>

You have to set some legal OpenNMS user or group here (in name target's sub-element).

Now you can create some notifications using OpenNMS Web UI. To control outstanding characteristics of certain parameters you should set trigger event to uei.opennms.org/threshold/highThresholdExceeded and set destinationPath for it to "SMS-Admins". You can do it by hand, adding the following entry to /usr/local/opennms/etc/notifications.xml:

<notification name="High Threshold" status="on" writeable="yes">
<uei xmlns="">uei.opennms.org/threshold/highThresholdExceeded</uei>
<description xmlns="">High threshold exceeded</description>
<!-- some filter -->
<rule xmlns="">(NODELABEL = 'our label')</rule>
<destinationPath xmlns="">SMS-Admins</destinationPath>
<text-message xmlns="">The parameter %parm[ds]% is high on node: %nodelabel%, interface:%interface%. The parameter %parm[ds]% reached a value of %parm[value]% while the threshold is %parm[threshold]%. This threshold for this alert was %parm[threshold]%.</text-message>
<subject xmlns="">Notice #%noticeid%</subject>
<numeric-message xmlns="">111-%noticeid%</numeric-message>
</notification>


The only interesting question I have now is how to do notification only for several thresholds. Just for now I deleted all unimportant (for me) thresholds. It would be cool, however, to specify instead in notification description only thresholds you are interested in...

среда, 15 июня 2011 г.

среда, 1 июня 2011 г.

A little joke: Oracle donates openoffice.org code to Apache Foundation...

I've just had something like little orgasm on reading this piece of news... Oracle managers are genii, you can't underestimate this joke. We are goody-goody, we support open source, and you (Document Foundation) are in deep arse: try to compete with ASF, if you can :)

вторник, 24 мая 2011 г.

Never get involved with Coral Travel or Odeon Tours

I dislike complaining. But Russian and Turkish travel agencies Coral Travel and Odeon Tours made everything to spoil my holidays. Their attempt was unsuccessful, but very serious...
At first, Coral played with flight time table: while buying a tour I was promised to have a flight at 6.00. In fact we left at about 18.00. We were notified that flight would be postponed till 16.00 , but after arriving to our airport, we found out that the flight was postponed till 17.30 or something like that. In fact, we left about 18.00.
Further worries were connected with work of hotel guide (from Odeon Tours). First of all, we didn't get his contacts and were informed that he could be found at hotel reception the next day at 9 o'clock. Luckily, we didn't need his service...
When we met the guide, he suggested us to go to different excursions. Later we found out that suggested prices were at least twice higher than prices of other tour operators. For example, we liked prices and excursions suggested by Maxwell travel agency, their office could be found accross the road from our hotel (Sea Gull Hotel). The hotel guide talked out of renting a car or a bike. In my opinion, he didn't want his company to be responsible in case of car accident. More on that - he significantly overstated the price of bus ticket to Kemer (it seems, for the same reason)... He even stated that if we would have some accidents during our excursions with other travel agency, nor Odeon Tours, nor Coral Travel would be responsible.
But that's not all. There was an evident deal between our travel agency and the hotel administration. We were told that hotel wouldn't provide us packed lunch when we visit excursions held by another tour operator (but the hotel would provide it if went to Coral/Odeon excursions).

To summarize, I liked my holidays in Turkey, but it was despite the behavior of my tour operator.

P.S. I read a lot of negative reviews on Sea Gull Hotel. Don't believe them! Our room was cleaned regularly (thanks to Fatima, who decorated our room with flowers), staff was responsive (and most of them spoke Russian) and food was good. It would be good to have free sport inventory (such as tennis rackets), but what do you want - it is not a 5-star hotel. At least there was rather normal fitness center: not super, but it had enough inventory for you to keep shape.

четверг, 5 мая 2011 г.

Two useful illumos-related links

I've just found two interesting resources:

  • planet.illumos.org site - it's always interesting to know what is happening in opensource Solaris. I'm still looking at this project. We'll hardly make something like OpenIndiana our main platform, but for me it's a preferrable alternative to Linux where FreeBSD is not the best sollution (e.g. I'd prefer to use something Solaris-based for hardly loaded file server because of some stability issues with ZFS in FreeBSD and we still should decide what to do with our existing SXCE-based terminal servers). And planet.opensolaris.org became very quiet now..

  • src.illumos.org - sometimes you just have to look at some subsystem to understand what has gone wrong. Web access to code is useful thing to have for such cases.



And I would like to play with stable OpenIndiana release. In particular it's interesting to see how do it deal with multipath on our EMC Clarion storage.

среда, 20 апреля 2011 г.

вторник, 19 апреля 2011 г.