Fasinator 0.3 – Watcher 0.3 – ICE week

ICE, Mac OS, The Fascinator Desktop, Ubuntu/Linux, Window, iPhone, watcher No Comments

Soo what have I been doing lately?

The Fascinator Desktop
The Fascinator 0.3 Desktop was released 3 weeks ago.

Features implemented in The Fascinator 0.3 Desktop can be found in: http://fascinator.usq.edu.au/trac/wiki/tf2/Version0.3.0

P.S: for new features and enhancements request for The Fascinator 0.4 can be found in: http://fascinator.usq.edu.au/trac/wiki/tf2/Planning

So what are the features have been implemented in The Fascinator Desktop so far? I have compiled and created a simple features page for easy browsing: http://fascinator.usq.edu.au/trac/wiki/tf2/DeveloperNotes/Features

Watcher
Together with The Fascinator 0.3 Desktop, we released Watcher Watcher 0.3beta and 0.3pyinotify, http://fascinator.usq.edu.au/trac/wiki/Watcher

In Watcher 0.3beta, we start to support multi platform File system watcher. Ron Ward developed the watcher code in .NET, thus for linux/Mac OS X users, the same code base can be used through mono

For Watcher 0.3pyinotfy, this will be the last release for Linux that use pyinotify. Why we are not using pyinotify anymore? Basically it’s only work in Linux.

Issue found in both version of Watcher-s: file rename/move from a directory to another directory in Linux/Mac OS X is not working properly. This is a known bugs found in mono, https://bugzilla.novell.com/show_bug.cgi?id=418241 as well as pyinotify http://trac.dbzteam.org/pyinotify/ticket/30.

ICE week
Last week is ICE week. Peter Sefton wrote ICE week background on his blog: http://ptsefton.com/2009/11/25/ice-week-background.htm.

My task was generating eBook plugin for ICE package in ePub format based on the manifest items found in the ICE organiser.
Result? The generated eBook can be viewed in Peter’s Android phone as well as my iPhone. During this development, I encounter a usefull tool to check the validity of the epub structure that I created. This tool can be downloaded from http://code.google.com/p/epubcheck/

I also successfully implement epub generation in The Fascinator Desktop. This feature will be included in The Fascinator 0.4 release. Some note about epub feature in The Fascinator Desktop: http://fascinator.usq.edu.au/trac/wiki/tf2/DeveloperNotes/Features/eBook

I realise that I have been using a lot of links in this blog entry ==”. But maybe it’s for the best instead of duplicating the documentation that I have written in the wiki page. :)

Stay tune!!

funbrain

Setting up Nagios 3 in Ubuntu 9.04 Jaunty + forward notification using postfix

ICE, Open Office, The Fascinator Desktop, Ubuntu/Linux, eResearch 7 Comments

Since The Fascinator Desktop 0.1 Release, #tf4desktop, we need to make sure ICE service and OpenOffice are running in the server to support the conversion sent thru The Fascinator Desktop.

I managed to setup Nagios in ICE server to watch ICE and OpenOffice process and when ICE or OpenOffice or even server are down, notification email will be sent to the developer team. I wrote the installation and configuration instruction below on setting up nagios in ubuntu:

Step 1: Installing Apache and other libraries

  • Install required library before installing nagios3
    [html]
    sudo -s apt-get install libgd2-xpm-dev build-essential apache2
  • Configure Apache if you want apache to listen to other port (by default, apache is listening to port 80)
    [html]
    gedit /etc/apache2/ports.conf
  • Change the Listen port number, apache is listening to port 85 in the below example:
    [html]
    NameVirtualHost *:80
    Listen 85
    <IfModule mod_ssl.c>
              # SSL name based virtual hosts are not yet supported, therefore no
              # NameVirtualHost statement here
              Listen 443
    </IfModule>
  • Restart apache:
    [html]
    /etc/init.d/apache2 restart
  • Check if Apache is running: http://localhost or http://localhost:85 (if you change the port number)

Step 2: Nagios 3

  • Creating user for nagios

    [html]
    /usr/sbin/useradd nagios
    passwd nagios
  • Creating group for nagios user
    [html]
    /usr/sbin/usermod -G nagios nagios
    /usr/sbin/groupadd nagcmd
    /usr/sbin/usermod -G nagcmd nagios
    /usr/sbin/usermod -G nagcmd www-data
  • Download nagios
    [html]
    cd /tmp
    wget http://freefr.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz
  • Untar and compile
    [html]
    tar zxvf nagios-3.0.6.tar.gz
    cd nagios-3.0.6
    ./configure --with-command-group=nagcmd
    make all
    make install
    make install-init
    make install-config
    make install-commandmode
    make install-webconf
  • Get the nagios plugin
    [html]
    cd /tmp
    wget http://freefr.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
  • Untar and compile
    [html]
    tar zxvf nagios-plugins-1.4.13.tar.gz
    cd nagios-plugins-1.4.13
    ./configure --with-nagios-user=nagios --with-nagios-group=nagios
    make
    make install
  • Make sure nagios is running every time system started.
    [html]
    ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
  • Configure contact for nagios
    [html]
    gedit /usr/local/nagios/etc/objects/contacts.cfg

    Put the contact information:

    [html]
    define contact{
            contact_name                    nagiosadmin     ; Short name of user
        use             generic-contact     ; Inherit default values from generic-contact template (defined above)
            alias                           Nagios Admin        ; Full name of user

            email                           me@gmail.com            ; Email where the notification will be forwarded to
        host_notifications_enabled  1                       ; Enable host notification
        service_notifications_enabled   1                       ; Enable service notification
        service_notification_period 24x7                    ; Period of notification
        host_notification_period    24x7                    ; Period of notification
        service_notification_options    w,u,c,r                 ; Notify if service: w: warning; u: unreachable; c: critical; r: recovered
        host_notification_options   d,u,r                   ; Notify if host: d: down; u: unreachable; r: recovered
        service_notification_commands   notify-service-by-email ; Service notification command
        host_notification_commands  notify-host-by-email    ; Host notification command
        can_submit_commands     1                       ; Enable allow command submission
            }
  • If you would like to add new command or edit existing command such as “notify-service-by-email” or “notify-host-by-email”, you can do it through:
    [html]
    gedit /usr/local/nagios/etc/objects/command.cfg

    Below are example of adding new command to check if OpenOffice is still running in port 2002:

    [html]
    # 'check_tcp_local' command definition
    define command{
            command_name    check_tcp_local
            command_line    $USER1$/check_tcp -p $ARG1$ $ARG2$
            }
  • Configure nagios host
    [html]
    gedit /usr/local/nagios/etc/objects/localhost.cfg

    Configuration:

    [html]
    define host{
            use                     linux-server            ; Name of host template to use
                                                            ; This host definition will inherit all variables that are defined
                                                            ; in (or inherited by) the linux-server host template definition.
            host_name               localhost
            alias                   localhost
            address                 XX.XXX.XXX.XXX          ; IP address of the host where the nagios is going to watched
            }
  • Adding Services to be watched. (below are the example how nagios watching ICE and Openoffice)
    [html]
    gedit /usr/local/nagios/etc/objects/localhost.cfg

    Adding new services at the end of the localhost.cfg file:

    [html]
    define service{
            use                             local-service         ; Name of service template to use
            host_name                       localhost             ; Must be the same as the host_name define on the top
            service_description             ICE running           ; Name of the new service
            check_command                   check_tcp!80          ; ICE is running in port 80, so we use check_tcp command to check if ICE is still running
            check_interval                  60                    ; Checking interval 60 minutes
            check_period                    24x7                  ; Allow 24x7 checking
            retry_interval                  3                     ; Trying for three times
            max_check_attempts              3                     ; Maximum trying attempt
            notification_interval           60                    ; Notify admin every 60 minutes if ICE service is still not running
            notification_period             24x7                  ; Enable notification for 24x7
            notification_options            w,c,u                 ; Notify if: w: warning; c: critical; u: unreachable
            contact_groups                  admins                ; Notify admins group
            }

    define service{
            use                             local-service         ; Name of service template to use
            host_name                       localhost             ; Must be the same as the host_name define on the top
            service_description             Open Office running   ; Name of the new service
            check_command                   check_tcp_local!2002  ; OpenOffice is running in port 2002, so we use check_tcp_local command to check if OpenOffice is still running
            check_interval                  60                    ; Checking interval 60 minutes
            check_period                    24x7                  ; Allow 24x7 checking
            retry_interval                  3                     ; Trying for three times
            max_check_attempts              3                     ; Maximum trying attempt
            notification_interval           60                    ; Notify admin every 60 minutes if ICE service is still not running
            notification_period             24x7                  ; Enable notification for 24x7
            notification_options            w,c,u                 ; Notify if: w: warning; c: critical; u: unreachable
            contact_groups                  admins                ; Notify admins group
            }

    NOTE: if the SSH and HTTP are not enabled in the host, comment out the service configuration from localhost.cfg

    [html]
    #define service{
    #        use                             local-service         ; Name of service template to use
    #        host_name                       localhost
    #        service_description             SSH
    #        check_command                   check_ssh
    #        notifications_enabled           0
    #        }

    #define service{
    #        use                             local-service         ; Name of service template to use
    #        host_name                       localhost
    #        service_description             HTTP
    #        check_command                   check_http
    #        notifications_enabled           0
    #        }
  • Before you start up Nagios, make sure there are no errors with the command. (This need to be done everytime the configuration files has been modified)
    [html]
    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
  • Restart apache & nagios
    [html]
    /etc/init.d/apache2 restart
    /etc/init.d/nagios start
  • Check if nagios has started
    [html]
    /etc/init.d/nagios status
  • Nagios from web (Assume that apache listening port is 85). Log in using username nagiosadmin and password for nagiosadmin
    http://localhost:85/nagios
  • To see nagios log:
    [html]
    tail -f /usr/local/nagios/var/nagios.log &

Step 3: Postfix to send outgoing mail

  • Install postfix

    [html]
          apt-get install postfix
  • Configure postfix
    [html]
          dpkg-reconfigure postfix

    Configuration:

    • General type of mail configuration: Internet Site
    • System mail name: e.g. smtp.gmail.com
    • Root and postmaster mail recipeint: e.g. me@gmail.com
    • Other destinations to accept mail for (blank for none): use the default value
    • Force synchronous updates on mail queue?: Yes
    • Local networks: Use default: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    • Mailbox isze limit (bytes): 0 (default)
    • Local address extension character: + (default)
    • Internet protocols to use: all (default)
  • Do some testing using mailx:
    [html]
    sudo apt-get install mailx
    echo test |mail -s "test mail sent to external" me@gmail.com
    echo test |mail -s "test mail sent to normal user" <normal user name>
    echo test |mail -s "test mail sent to root" root
  • To forward email to me@gmail.com (change to your email address)
    [html]
          echo me@gmail.com > ~/.forward

The Fascinator Desktop 0.1.0 Release

The Fascinator Desktop, Ubuntu/Linux, Window, eResearch No Comments

Working together with Oliver Lucido (Main developer), Ron Ward (developer), me (developer), Duncan Dickinson (Project Manager) and Bron Chandler (Project Manager), last week we announced the release of The Fascinator Desktop 0.1.0: http://fascinator.usq.edu.au/trac/wiki/tf2/Version0.1.0

The information about what is The Fascinator Desktop, installation instruction and coding documentation can be found in:
http://fascinator.usq.edu.au/trac/wiki/Fascinator2