Personal Blog of Thomas Hampel - Creative Mythbusting in Development and Collaboration

Query results for : Linux

Domino Portable Edition - Building the smallest Domino server - Hot Pants for Geeks- 3 August 2019 - (0) Comments

Thomas Hampel
 3 August 2019

Two weeks ago at the the HCL Factory Tour #3 we've shown the (possibly) smallest Domino server ever built.
With just 47,88 ccm (6,3 x 9,5 x 0,8 cm) it is just a little bigger than a credit card and small enough to fit your pocket. Also, for those of you who remember, it's much smaller than the
Lotus Foundations box which Mike Rhodin introduced at Lotusphere 2008.
Thanks to
Panagenda we also were able to show that you can run Domino off the grid.

What kind of hardware is this based on?

It is
Zotac Pi 225 pico, a mini PC fully equiped with CPU, memory and storage, all combined in a case that is passively cooled.
The case itself looks like a thin 2,5" HDD - but thinner (for US folks : 3.76 x 2.48 x 0.31 inches )

Image:Domino Portable Edition - Building the smallest Domino server - Hot Pants for Geeks

Compared to the well known
Raspberry Pi, this Zotac device is actually smaller (thinner) because it does not expose an ethernet port.
Image:Domino Portable Edition - Building the smallest Domino server - Hot Pants for GeeksImage:Domino Portable Edition - Building the smallest Domino server - Hot Pants for Geeks

It weights less than 500g and is hardware specs looked promissing: Intel N3350 dual-core CPU (x86 compatible!), 4GB RAM, 32GB internal storage (expandable via microSD card), Intel HD Graphics 500,
Furthermore it provides two USB 3.0 Type-C Ports for connecting keyboard, HDMI an ethernet adapter. It also provides an internal 802.11ac Wi-Fi antenna, which I want use for creating a WiFi Hotspot later on.

You can find it
here on Amazon for approx. €150

Stage 1 - Installing Linux

Zotac comes preinstalled with Windows 10 - an operating system which beside being clunky is not supported for running Domino.

Of course my idea was to install Domino on Linux. As you know IBM/HCL is supporting to run
Domino on SuSE or Redhat Linux and also fully supporting CentOS since last year.
After spending a few hours with CentOS I
had to learn by hard that it can not simply be installed on this Zotac device because it is missing support for this specific Intel Atom CPU.
The installation caused errors and booting it took several hours before it finally failed.

Plan B:

Switch to
Ubuntu 18.04.2 LTS (alternative installer!) which installs without problems from a USB stick.

Stage 2 - Linux tuning

Although the installation itself completed in a few minutes there still are some errors when booting up.

Most annoying this one:
systemd-gpt-auto-generator: Failed to dissect: Input/output error. which is caused by the device using an internal MMC card as disk storage.

To fix this error we have to modify the kernel boot parameters as follows:

sudo nano /etc/default/grub

add a parameter to the line "GRUB_CMDLINE_LINUX_DEFAULT"
GRUB_CMDLINE_LINUX_DEFAULT="systemd.gpt_auto=0"

After saving changes we need to tell grub to update the bootloader using
sudo update-grub


Stage 3 - Install Docker

We could have installed Domino natively on Linux but why wasting time if we can also run Domino on Docker.

Installation of Docker on Ubuntu Linux is staight forward
sudo apt-get install docker-ce


To avoid having to type 'sudo' every time you run the docker command, just add your username to the docker group.

sudo usermod -aG docker ${USER}

For changes to take effect, log off and log on again.

Image:Domino Portable Edition - Building the smallest Domino server - Hot Pants for Geeks

Stage 4 - Create Domino Image for Docker

In order to run Domino in Docker I'm using my (more powerful) MacBook and
this Github repo to build a docker image.
All that needs to be done is...
- clone the repository (or
download and extract the zip file) to a directory of your choice.
- Add the Domino Linux installation package + FP2 package into the subfolder "software"

- run "./build domino"

A few minutes later you'll have a perfect Domino image to work with...

Image:Domino Portable Edition - Building the smallest Domino server - Hot Pants for Geeks

Now we need to export this image by turning it into a tar file using this command:

docker image save -o domino1001fp2.tar ibmcom/domino:10.0.1FP2

Copy the resulting file "domino1001fp2.tar" to a USB stick


Stage 5 - Import Docker Image

Attach the USB stick to the Zotac device and copy the file  "domino1001fp2.tar" to a directory of your choice, e.g. /tmp

Then import the image using the command:

docker image load -i domino1001fp2.tar

Verify results using the command
docker image ls - you should now have one image listed.

in case any TAGs are missing, add them using

docker image tag ibmcom/domino:10.0.1FP2
docker image tag ibmcom/domino:latest


Stage 6 - Run Domino and Enjoy

Finally running Domino in this configuration is a piece of cake:

At first create a persistent volume - this is required because we would like to preserve our data directory in case the container is being restarted or recreated.

docker volume create dominodata

then spin up a (new) Domino server with a name of your choice.

docker run -it -d -e "ServerName=Zotac" -e "AdminPassword=passw0rd" -p 1352:1352 -p 80:80 -p 443:443 -v dominodata:/local/notesdata --cap-add=SYS_PTRACE --name domino ibmcom/domino:10.0.1FP2


Without supplying a
config file, this image will not start the HTTP task by default, so we need to open a shell into the container
docker exec -it domino /bin/bash

and from within the container then run "domino monitor" to access the server console to launch the http task using "load http"


Browsing to http:// will now show up this well known homepage.

Image:Domino Portable Edition - Building the smallest Domino server - Hot Pants for Geeks
For more information on how to work with Domino in Docker please refer to
this documentation ( Thanks Roberto ! )

Finall word of warning:

Certainly this Zotac device produces some heat, so running a Domino server in your trousers will for sure turn them into
hot pants for geeks - so please be careful !

Further ideas & todo:

- I have not done any stress testing, so please dont ask me how many users this device is going to support in production

- Enabling the embedded WiFi antenna and turning it into a WiFi hotspot would make a cool demo
- Zotac Pi 225 is not the smallest device that can run Domino -- I have some more ideas but getting hold of the hardware is more complicated, stay tuned for more :)


References:

-
Zotac Pi 225 nano on Amazon
-
Domino on Docker
- Domino on Docker
Management Script
- Mike Rhodin
announcing Lotus Foundations

Print Email Attachments automatically with a RaspberryPI- 23 June 2015 - (5) Comments

Thomas Hampel
 23 June 2015

I am tired of printing email attachments. Yes, I still need to print some of them e.g. invoices for tax computation or travel reimbursement needs, or credit card balance sheets for archiving them offline.
Most of them are e-mails with PDF file attachments which I need to print on a regular basis. In order to print them I need to be at home, using a device with apropriate printer drivers installed and connected to my home network.

There must be a more simple method, so lets see how to allow mobile or remote printing.


What options do we have for remote printing?
  • Google Cloud Print - would be the easiest option but who wants to forward personal data to Google?
  • Using web-connected printers like those from HP or EPSON or Canon, but my current printer(s) do work fine and I see no reason to replace them.
    Furthermore any mail would be routed to the vendors environment which I dont trust.
    • VPN - probably the best approach, but still requires printer drivers and VPN software to be installed.
      Since none of the options above satisfied my needs, lets see if we can build a solution ourselfes...maybe using a Raspberry Pi
      Main idea is to poll an IMAP account on a regular basis and if new mail will meet certain criteria then print the PDF file attachment.

      Image:Print Email Attachments automatically with a RaspberryPI

      Step 1 - Preparations

      Obviously you need to
      buy a Raspberry PI, the Model B+ is enough. You also need some further equipment like a memory card, power adapter, keyboard, etc.
      Beside
      installing and configuring the operating system you need to:
    • Enable SSH
    • Apply latest patches by running update and Upgrade
      $ sudo apt-get update -y && apt-get upgrade -y
    • Install updates automatically by using apt-cron
      $ sudo apt-get install apt-cron
    • Configure your network adapter preferably assign a static IP
    • Change system locale and keyboard layout to fit your needs
    • Don't forget to Change the default password
    • When using a WiFi dongle disable WiFi Adapter Power Saving Mode
      Step 2 - Set up a new IMAP (or POP3) account

      Contact your provider for a description how to do that. Make sure your provider supports SSL/TLS connections and make sure to enable antivirus/antispam control for your IMAP account.
      Remark: SmartCloud Notes / Connections Cloud users need to enable IMAP access first (
      see details)

      Step 3 - Import SSL Root certificate(s)

      SSH into your Raspberry PI and start by creating a new directory for this project
      mkdir pimailprint
      cd pimailprint
       

      For
      verification of SSL certificates we would like to store SSL certificates of our mail provider locally, preferably in another subdirectory.
      mkdir sslcerts
      wget {url-of-provider certificate} -O ./sslcerts/provider-name.cer
      c_rehash ./sslcerts/

      You can verify the functionality
      using OpenSSL

      Step 4 - Install Prerequisites

      Install the required packages

      sudo apt-get install fetchmail procmail uudeview

      Create a configuration file for fetchmail, in our case the file will be located in the project directory instead of the users home folder.
      With this configuration I'm using procmail as mail delivery agent in order to further process the inbound mail.

      nano ./fetchmail.conf

      using this configuration:

      set no bouncemail
      poll IMAP.YOUR-DOMAIN.COM

      service 993

      protocol imap

      user "YOUR-USERNAME"

      password "YOUR-PASSWORD"

      ssl

      sslcertck

      sslproto TLS1

      no keep

      mda "/usr/bin/procmail -m './procmail.conf'"

      Change file permissions so only you can open and see the file.

      chmod 700 ./fetchmail.conf

      Create a configuration file for procmail...

      nano ./procmail.conf

      and use this configuration which will store mails that contain an attachment in the folder ./maildata

      MAIL_DIR=./maildata
      VERBOSE=off

      LOGFILE=./logs/printmail.log

      :0

      *^content-Type:

      $MAIL_DIR/


      Step 5 - Install and Configure CUPS

      CUPS (Common Unix Printing System) allows any computer to act as a print server.
      Just refer to
      this page for installation and configuration instructions
      Remark: Make sure to set this printer to be your default printer.
      Once completed you can manage the printer queue remotely using https://[ip-address-or-dns-name-of-your-raspberrypi]:631

      Image:Print Email Attachments automatically with a RaspberryPI

      Step 4 - Build your Script

      Create a new shell script...

      touch ./printmail.sh
      chmod +x ./printmail.sh

      nano ./printmail.sh

      using the following code
      #!/bin/bash
      # Parameters

      BASEDIR=$(dirname $0)

      CURDIR=$(pwd)

      MAILDIR=./maildata

      LOGFILE=./logs/printmail.log

      ATTACH_DIR=./attachments

      # change directory

      echo "Switching directory to : $BASEDIR"

      cd $BASEDIR

      # create log file if it does not exist

      touch $LOGFILE

      date +%r-%-d/%-m/%-y >> $LOGFILE

      # fetch mail

      echo "Checking for new mail..."

      fetchmail -f ./fetchmail.conf -L $LOGFILE

      # process new mails

      shopt -s nullglob

      for i in $MAILDIR/new/*

      do

       echo "Processing : $i" | tee -a $LOGFILE

       uudeview $i -i -p $ATTACH_DIR/

      # process file attachments with space
        cd $ATTACH_DIR

        for e in ./*

            do

                mv "$e" "${e// /_}"

        done

        for f in *.PDF

            do

            mv $f ${f%.*}.pdf

        done

        cd $BASEDIR
      # end of patch
       echo "Printing PDFs" | tee -a $LOGFILE

       for x in $ATTACH_DIR/*.pdf

       do

               echo "Printing : $x" | tee -a $LOGFILE

               lpr $x

               echo "Deleting file : $x" | tee -a $LOGFILE

               rm $x | tee -a $LOGFILE

       done

       echo "Clean up and remove any other attachments"

       for y in $ATTACH_DIR/*

       do

               rm $y

       done

       # delete mail

       echo "Deleting mail : $i" | tee -a $LOGFILE

       rm $i | tee -a $LOGFILE

      done

      shopt -u nullglob

      echo "Job finished." | tee -a $LOGFILE

      cd $CURDIR


      Step 5 - Test and Scheduling

      in order to test the whole script, just run it :)

      ./printmail.sh
      To run it on a schedule, just add the whole path to crontab.
      crontab -e -u pi

      in my case it is enough to run this script once per hour, feel free to customize it to your needs

      @hourly  /home/pi/pimailprint/printmail.sh

      Image:Print Email Attachments automatically with a RaspberryPI

      Results

      By forwarding a mail to a specific email address I can now print attachments automatically. Back home all the documents I wanted have already been printed or will be printed when switching on my printer and I can quickly process them further on, e.g. for claiming travel expenses back.
      In my case I am forwarding mails manually to a new account if I want to print them. Of course it is also possible to use mail rules for processing mails automatically.

      Enhancement requests / what needs to be done:
      • End to end encryption with S/MIME
    • Reply to sender when print job has completed
    • Define printer settings based on acronym in subject line
      Remark: Feel free to use this script at your own risk.
  • Monitoring IBM Domino Server on Linux via SNMPv3- 5 January 2015 - (0) Comments

    Thomas Hampel
     5 January 2015

    Monitoring Domino servers via SNMP should be a simple task, if it would be documented properly.
    There are quite a few blog posts out there on the internet such as
    this nice article by Detev Schuemann which unfortunately is in German.. So I'd like to provide an english translation with a few updates which in my opinion are valuable.

    Background

    Simple Network Management Protocol (SNMP) is a protocol for monitoring network devices such as routers, switches, servers, printers and much much more.
    Vendors of a device are providing a definition of values which can be read or modified in form of a
    MIB (Management Information Base). Those values are called OIDs (object identifiers) and are ordered in a hierarchical structure.

    MIB definitions for Domino can be found online
    http://www.oidview.com/mibs/334/NOTES-MIB.html
    A MIB file for IBM Domino can be found in the Domino program directory and is called "domino.mib"

    On a Linux server the file can be found here /opt/ibm/domino/notes/latest/linux/domino.mib


    Step-by-step Instructions

    For each Domino server which you want to monitor, you need to enable SNMP support, the following is a step by step description of what you need to do for a Domino server on Linux.
    Instructions for Windows are available here
    Examples below are based on
    CentOS which is using yum as package manager. For other Linux distributions commands are slightly different, also path references shown in the example below might not be the same for you.

    Step 1 - SNMP Master Agent

    Although Domino its own snmp master agent, I recommend not to use it because the version supplied with Domino is the rather dated version 5.0.7
    .
    Currently version 5.7.3 is the latest version available. Check the
    net-snmp change log to see what has changed between versions.
    Obviously you should prefer using the operating system snmp master agent which comes preinstalled for a number of Linux distributions.
    If not already installed, you can install the package net-snmp with the following command.

    # yum install net-snmp

    The library net-snmp-utils provides some additional tools like snmpwalk, which we will need later on for testing functionality
    # yum install net-snmp-utils

    To check the version you are running...

    $ snmpwalk --version

    Image:Monitoring IBM Domino Server on Linux via SNMPv3
    Note: Current releases of CentOS and Redhat provide net-snmp version 5.7.2 by default.


    Option B - NET-SNMPD v5.0.7 provided by Domino

    Domino provides net-snmpd in version 5.0.7  - again, I do not recommend using this version.

    However, if really want to use it enter these commands to copy the required files to the /etc directory and make sure the service is started after a reboot.

    # cp /opt/ibm/domino/notes/latest/linux/net-snmpd* /etc
    # ln –f –s /etc/net-snmpd.sh /etc/init.d/net-snmpd

    # chkconfig --add net-snmpd

    # chkconfig net-snmpd on

    Note that in this type of configuration your settings are stoed in the file  /etc/net-snmpd.conf

    Step 2 - Update Configuration

    Back up the original config file to a location of your choice

    cp /etc/snmp/snmpd.conf /root

    Edit the file /etc/snmp/snmpd.conf . Modifying this file is only required if you are using the master agent provided by your OS.

    # nano /etc/snmp/snmpd.conf

    1.) Search for sysLocation and update it according to your needs as shown here:
    sysLocation    YourDataCenterLocation
    sysContact     email@yourdomain.com


    2.) define a username/password combination for SNMP v3 authentication
    Of course the user name and password used in this example are to be changed to fit your needs

    createUser SNMPv3UserName MD5 SNMPUserSecretPassword AES


    3.) At the end of the same file, add this line:
    smuxpeer 1.3.6.1.4.1.334.72 NotesPasswd

    Dont forget to save the file


    Step 3 - SNMP Startup Script

    Although you could add /usr/sbin/snmpd as a service directly, its probably more useful to use a startup script.

    Domino already provides such a script - you just need to modify the configuration so that it can be used.


    # cp /data/ibm/domino/notes/latest/linux/net-snmpd.sh /etc/init.d/net-snmpd

    # nano /etc/init.d/net-snmpd


    Update the configuration (starting in line 31) as follows:

    INSTDIR=/usr/sbin
    PROGNAME=snmpd

    PROGPATH=$INSTDIR/$PROGNAME

    CONFNAME=snmpd.conf

    CONFPATH=/etc/snmp/$CONFNAME

    LOGPATH=/var/log/snmpd.log

    PROGARGS="-C -c $CONFPATH -l $LOGPATH"

    Make sure the startup script runs at next boot

    # chkconfig --add net-snmpd
    # chkconfig net-snmpd on


    Step 4 - Update Firewall Rules

    SNMP requires UDP port 161 to be accessible, so you need to open this port on the local firewall.
    Do not forget to open this port on any other firewall on your network which is between the monitoring server and your Domino server
    # iptables -I INPUT -p udp --dport 161 -j ACCEPT


    Step 3 - Testing basic functions

    Test basic SNMP functionality
    from the local host and also from a remote server.
    # snmpwalk -v3 -u SNMPv3UserName -A SNMPUserSecretPassword -a MD5 -l authnoPriv dominoserver.domain.com .1.3.6.1.4.1.2021.100.2.0

    As a result you should get the version number of the SMTP master agent

    Image:Monitoring IBM Domino Server on Linux via SNMPv3

    Step 5 - Enable Domino SNMP Agent

    Make sure LNSNMP will be started after a reboot. (Note: change the path to match your configuration!
    )
    # ln -f -s /opt/ibm/domino/notes/latest/linux/lnsnmp.sh /etc/rc.d/init.d/lnsnmp
    # chkconfig --add lnsnmp

    # chkconfig lnsnmp on
    # service lnsnmp start

    In case you get the error  "LOTUSDIR must be set in the environment or in this script." you need to update script so that it can find the path to your Domino server, e.g. LOTUSDIR=/opt/ibm/domino


    if everything has worked out, starting the lnsnmp should provide the following output

    New sub-agent on server is registering a sub-tree with branch ID:
    1.3.6.1.4.1.334.72.3

    Sending SNMP "Server Up" trap for server .

    service lnsnmp startNew sub-agent on server is registering a sub-tree with branch ID:

    1.3.6.1.4.1.334.72.1


    Step 6 - Domino Tasks

    Start the following tasks from the Domino server console

    load quryset
    load intrcpt
    load collect

    "quryset" is required to support SNMP queries

    "intrcpt" is required to support SNMP traps for Domino events

    "Collect" is required to support statistic threasold traps

    Create a program document or add the tasks to the Notes.ini variable "ServerTasks=" so ensure they are started automatically after a server restart.

    Step 7 - Testing Domino SNMP agent response

    Now its time to test if we can access Domino objects via SNMP, e.g. by reading a single value.

    $ snmpget -v3 -u SNMPv3UserName -A SNMPUserSecretPassword -a MD5 -l authnoPriv dominoserver.domain.com .1.3.6.1.4.1.334.72.1.1.6.2.1.0

    Should return the fully qualified Domino Server name as a string

    Image:Monitoring IBM Domino Server on Linux via SNMPv3

    Ok, you're done... the Domino SNMP Agent is configured and can be used.

    However, there still is some work to be done on your SNMP management console e.g.
    Nagios ,FAN , Cacti (or whatever you are using) in order to monitor Domino via SNMP (for example, server down).

    Next Actions:

    If you like this post, please let me know via Twitter
    @ThomasHampel or by leaving a comment below. Please note that comments are moderated and wont show up before being approved.
    Hint... configuring Nagios for Domino monitoring and configuring Cacti for trend analysis is subject of another blog post which I'm already working on.


    Troublshooting
    • Check snmpd.log for errors
      # cat /var/log/snmpd.log
    • Error : refused smux peer: oid SNMPv2-SMI::enterprises.334.72, descr Lotus Notes Agent
      see
      IBM Technote 1313318
    • Error - Unknown User
      Either a typo in the user name or you forgot to add the user to the snmpd.conf file in step 1, search the config file for something like this:
      createUser SNMPv3UserName MD5 SNMPUserSecretPassword AES
    • Error in packet. Reason: authorizationError (access denied to that object)
      The user exists and the password worked, but does not have access rights required. Check snmpd.conf to see if you have granted at least read only rights, search the file for a string like this:
      rouser SNMPv3UserName

    Tools:

    Take a look at
    Paessler SMTP Tester (Freeware / Windows)
    Image:Monitoring IBM Domino Server on Linux via SNMPv3

    Further reading:

    Websphere Plugin Customization Toolkit does not start- 7 January 2014 - (1) Comments

    Thomas Hampel
     7 January 2014

    Working with IBM Websphere 8.5.5 on Linux, in my case CentOS,  I ran into an issue where the Websphere Customization Toolbox did not start.
    Trying to use the console command to start it ( /opt/IBM/WebSphere/Toolbox/WCT/wct.sh ) did not provide any further information about the problem.

    So lets have a look into the recent logs
    #tail /var/logs/messages


    Which showed some warnings... :  [ warning] [Gtk] Unable to locate theme engine in module_path: "clearlooks"

    One suggestion to address this issue is to install gtk2-engines in a 32bit version, so lets try that....
    # yum install gtk2-engines.i686


    The next attempt to start the Toolkit brought more details, this time with a reference to a log file
    Image:Websphere Plugin Customization Toolkit does not start

    Looking into this log file ( /root/.ibm/WebSphere/workspaces/WCT85/.metadata/.log  ) revealed a missing library.

    java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
            /root/.ibm/WebSphere/configurations/WCT85/org.eclipse.osgi/bundles/45/1/.cp/libswt-pi-gtk-3659.so (libXtst.so.6: cannot open shared object file: No such file or directory)


    Solution
    Bottom line, the solution was to install those two packages
    • # yum install gtk2-engines.i686
    • # yum install libXtst.i686
    Finally the Customization Toolbox started up and is working fine..

    Why you need Evolution- 26 February 2012 - (0) Comments

    Thomas Hampel
     26 February 2012

    A note to self... dont try to uninstall evolution from a CentOS 6.x installation because it will make break the gnome desktop.
    for details see this bug report

    beside the libraries listed, it seems like Gnome Display Manager (gdm) was uninstalled by mistake.
    To fix this problem, just use
    #yum install gdm

    error while loading shared libraries: libnotes.so- 3 May 2011 - (2) Comments

    Thomas Hampel
     3 May 2011

    Installing Lotus Notes on Linux is rather simple, the UI starts right away without any problems.
    However if you happen to run command level operations such as compact or fixup you may run into problems because the following error message may appear:

    "error while loading shared libraries: libnotes.so: cannot open shared object file: No such file or directory"

    Notes is complaining it can’t find libnotes.so which normally resides in the /usr/lib folder on your machine.
    All you have to do is to create some links so that the Notes/Domino code can find this file

    To do so you will have to be root or have sudo rights and execute the following commands
    sudo ln -s /opt/ibm/lotus/notes/libnotes.so /usr/lib/libnotes.so
    sudo ln -s /opt/ibm/lotus/notes/libndgts.so /usr/lib/libndgts.so
    sudo ln -s /opt/ibm/lotus/notes/libxmlproc.so /usr/lib/libxmlproc.so

    or if you want a more propper solution, use those commands (thanks to Brian for reminding me)

    # Create the conf file and put into place
    echo “/opt/ibm/lotus/notes” >/tmp/lotus-notes.conf
    sudo install -m 644 /tmp/lotus-notes.conf /etc/ld.so.conf.d/

    # Tell the linker to use it
    sudo ldconfig

    Note: Of course all these commands refer the the standard Notes client installation directories, which you may need to adjust to fit your installation.
    Go ElsewhereSubscribe to RSSAboutStay ConnectedAnd More
    Thomas Hampel, All rights reserved.