The best use for GNU Screen

March 29th, 2007 by Alexander Mamchenkov

I have worked with GNU screen WM for a while now and I have heard a lot of people also like it. Personally, I find the tool to be very handy when you need to run something on a remote terminal without being connected to it all the time. The idea is that I login to the remote machine using SSH, then start screen (screen -a), then start the app I need (for ex top) and then just detach the screen using <Ctrl>-A,D shortcut and disconnect from the remote server, while my top command continues running there. In while, when I need to check how thing are going with my app, I just connect back through SSH and reattach the screen by using screen -r  command.

Though top is a too trivial example of a command one may run, I use screen for real-time parsing of Nagios perf-data which is retrieved by my script (will publish it here one day) from named pipe (to which nagios writes all performance data) and then creates RRDs.

Posted in Technology, Linux, Network, OS, SSH, Communications | 2 Comments »

Twitter as Nagios notification gateway

March 26th, 2007 by Alexander Mamchenkov

Here it is - I managed to get it all together and set up SMS notification from Nagios alerts via twitter. The job to be done is very easy:

First create an account on twitter to be used along with nagios. You probably also want to indicate that the account should be private via twitter settings in order for the whole internet not to see what is going on with you monitoring :). So go twitter and get an account.

Second, here is a piece of code for a script which I use as a notification handler:


#/usr/bin/perl -w
use strict;
use Net::Twitter;
my $msg = shift;
my $twit = new Net::Twitter(username => "twitter_user",password => "twitter_pass");
if (defined($msg) && $msg !~ /^\s*$/) {
$twit->update($msg);
}

Don’t forget to replace twitter_user and twitter_pass with the details of twitter account you have created in above stage.

Now modify the nagios notification commands in the misc. commands config file (/etc/nagios/misccommands.cfg in my case) to utilize the erlier created twitter.pl script. I have the following definitions:


define command {
command_name notify-by-epager
command_line /path/to/twitter.pl "$NOTIFICATIONTYPE$ - $HOSTNAME$-$SERVICEDESC$ - $SERVICESTATE$ - $SERVICEOUTPUT$"
}

and the same for host-notify-by-epager.

Finally adjust your nagios contact definition to use the above commands for notifications and don’t forget to enable all the notifications you need.

The above part will post all alerts to nagios twitter account. In order to be able to receive them via SMS or GTalk, add nagios twitter account as a friend to your personal twitter account (don’t forget to grant access to become a fried from nagios twitter account if you made it private) and follow up :)

Posted in Technology, Network | 14 Comments »

Synaptics TouchPad driver and scrolling

March 25th, 2007 by Alexander Mamchenkov

Each time a install Linux on laptop with synaptics touchpad, I am looking around to find out how to disable scrolling. In order to make my searches shorter, let me just write it here once.

All the job is done in the “InputDevice” section of /etc/X11/xorg.conf where it mentions the synaptics device.

  1. To disable horizontal scrolling, use Option “HorizScrollDelta” 0
  2. To disable vertical scrolling, use Option “VertScrollDelta” 0
  3. To use touchpad configuration programs like ksynaptics and gsynaptics, use Option “SHMconfig” “on” which will allow realtime touchpad configuration through shared memory.

Posted in Technology, Linux, OS, Hardware | No Comments »

MS Exchange corrupted mailbox items

March 23rd, 2007 by Alexander Mamchenkov

I had this problem when Veritas Backup Exec was giving me errors like “Access denied” on some items during backup of MS Exchange 2k3 mailboxes. The idea was that mailboxes had some corrupted items and it was impossible to delete them from Outlook any other more or less standard way. Today I found how to solve the problem: there is a tool from MS called MFCMapi which makes it possible to connect to MS Exchange and do a lot of stuff including deleting even corrupted items.

Posted in Technology, Windows | No Comments »

Profile unload issues

March 19th, 2007 by Grigory

We all know this problem – an application keeps connection to a resource (a registry key) during log off and it takes hours to turn of Windows. Moreover, there is no much information in event log about source of the trouble. To solve this just download and install User Profile Hive Cleanup Service. During log off it will force resources to close and then write event 1401 with description source of the trouble.

Posted in Technology | No Comments »

« Previous Entries