№42

... it's better to have good questions

Docker Shell Corner Cases

January 18, 2017 2 min read Ronny Trommer

During work building Docker executables, I ran in an interesting corner case. Fortunately the Docker IRC channel helped me to investigate with special credits to Ravensoul.

When you build a container as an executable you can use the ENTRYPOINT for your binary to execute and CMD as a default overwritable argument. In most cases the CMD is the --help argument to provide a useful default behavior in case you just run the container without anything specified.

Continue reading

Mac OS X and DHCP is screwing your Host Name

August 12, 2016 1 min read Ronny Trommer

I’m using Mac OS X with iterm2, oh-my-zsh and spend 75% of my time in those terminals. It is totally annoying to me if I connect to a DHCP network and it screws up my hostname. Especially when I’m used to looking at the prompt which tells me the host I’m connected to.

term2

It is possible to fix your computer name for several things using the scutil command which requires administration permissions. I’ve found a link to the Mac OS X Server Worksheet which explains a few things in more detail. Here is what I did to prevent my computer changing the host name.

Continue reading

IPv6 and Monitoring

March 19, 2016 3 min read Ronny Trommer

We are all happy when we are able to get IPv6 connectivity for our new servers. In case the network is provided by someone else and some kernel settings you can get in some tricky situations.

With IPv6 there are so many addresses your Laptop and Mobile can have a unique public IPv6 address forever - pretty cool huh? The downside is, it would be pretty easy to trace every connection you ever do back to your device - this really not what you want! When you provide a service this behavior is not so useful. Otherwise there are several ways to autoconfigure your IPv6 configuration, beside DHCPv6 the interesting one is stateless address configuration.

Continue reading

Investigate file descriptor issues

November 7, 2014 2 min read Ronny Trommer

If you run a centralized monitoring system in large environment you can run in some issues regarding file descriptor limits. Linux gives you very detailed information in the kernel control and information center in /proc. The soft and hard limits have effect for file and network sockets, which can end up in a too many files open exception in OpenNMS.

The default values for soft and hard limits can be checked with

Continue reading

RRDtool graph improvement

March 18, 2014 1 min read Ronny Trommer

If you have OpenNMS with RRDtool running, you can improve the whole rendering a little bit just by replacing the command.prefix in the following files:

  • snmp-graph.properties
  • snmp-adhoc-graph.properties
  • response-graph.properties
  • response-adhoc-graph.properties
command.prefix=/usr/bin/rrdtool graph - --imgformat PNG --font DEFAULT:7 --font TITLE:10 --start {startTime} --end {endTime} -E --width=1000 --height=180

I don’t like the stamp size graphs in OpenNMS, so I changed it for all. It could be problematic if you have grouped graph report (KSC report). So if you have trouble, you can just remove the –width and –height parameter. The command will also overwrite the width and height for all graphs, so they have all the same size. You have to be careful if you have KSC reports with multiple columns. If you have RRDtool running, you can improve the graphs with anti-aliasing using a few additional parameters:

Continue reading

OUCE 2013 Lab Setup

March 15, 2013 3 min read Ronny Trommer

System

  • Ubuntu 12.10
  • Language: English
  • Keyboard Layout: English
  • Login: opennms
  • Pass: ouce2013

Admins toolbox

sudo -s
apt-get install openssh-server
apt-get install vim tcpdump git-core htop joe nmap iftop
apt-get install snmp snmpd snmp-mibs-downloader

Maven2 and Oracle Java 1.6

apt-get install maven2
wget http://files.opennms-edu.net/jdk-6u41-linux-x64.bin
chmod +x jdk-6u41-linux-x64.bin
./jdk-6u41-linux-x64.bin
mv jdk1.6.0_41 /opt
update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.6.0_41/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.6.0_41/bin/javac" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/jdk1.6.0_41/bin/javaws" 1
update-alternatives --install "/usr/bin/jar" "jar" "/opt/jdk1.6.0_41/bin/jar" 1
update-alternatives --install "/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so" "/opt/jdk1.6.0_41/jre/lib/amd64/libnpjp2.so" 1
update-alternatives --config java

Some privacy and data leak stuff

apt-get remove unity-lens-shopping
System Settings -> Privacy Include Online Search results OFF / Record Activity OFF

Installing OpenNMS

update-alternatives --config java
vi /etc/apt/sources.list.d/opennms.list
deb http://debian.opennms.org stable main
deb-src http://debian.opennms.org stable main
wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -
apt-get update
apt-get install opennms
echo "export JAVA_HOME=\"/opt/jdk1.6.0_41\"" >> /etc/profile
echo "export OPENNMS_HOME=\"/usr/share/opennms\"" >> /etc/profile
source /etc/profile
/usr/share/opennms/bin/runjava -s
vi /etc/postgresql/9.1/main/pg_hba.conf
file:/etc/postgresql/9.1/main/pg_hba.conf

host    all             all             127.0.0.1/32            trust
service postgresql restart
/usr/share/opennms/bin/install -dis
echo JAVA_HEAP_SIZE=768 >> /etc/opennms/opennms.conf
echo START_TIMEOUT=0 >> /etc/opennms/opennms.conf
service opennms start
apt-get install libwww-perl libxml-twig-perl

iReport installieren

cd ~
wget http://files.opennms-edu.net/iReport-3.7.6.tar.gz
tar xzf iReport-3.7.6.tar.gz
mv iReport-3.7.6 /opt
chown opennms:opennms /opt/iReport-3.7.6 -R
apt-get install --no-install-recommends gnome-panel
gnome-desktop-item-edit /usr/share/applications/ --create-new
Name: iReport 3.7.6
Binary: /opt/iReport-3.7.6/bin/ireport
Icon: gnome-power-statistics.png
Comment: Jasper Reports-Report Designer

Wallpaper

cd ~/Pictures
wget http://files.opennms-edu.net/wallpaper/free-software-ulf.jpg
cd /usr/share/backgrounds
wget http://files.opennms-edu.net/warty-final-ubuntu-ouce.png
sudo -i
xhost +SI:localuser:lightdm
su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-user-backgrounds 'false'
gsettings set com.canonical.unity-greeter draw-grid 'false'
gsettings set com.canonical.unity-greeter background '/usr/share/backgrounds/warty-final-ubuntu-ouce.png'

RRD-Tool

sudo apt-get install rrdtool

Groovy

sudo -s
cd /root
wget http://files.opennms-edu.net/groovy-binary-2.1.1.zip
mv groovy-2.1.1 /opt
echo "export GROOVY_HOME=\"/opt/groovy-2.1.1\"" >> /etc/profile
source /etc/profile
ln -s /opt/groovy-2.1.1/bin/groovy /usr/local/bin/groovy
ln -s /opt/groovy-2.1.1/bin/groovyc /usr/local/bin/groovyc
ln -s /opt/groovy-2.1.1/bin/groovyConsole /usr/local/bin/groovyConsole
ln -s /opt/groovy-2.1.1/bin/groovysh /usr/local/bin/groovysh

Gradle

wget http://files.opennms-edu.net/gradle-1.4-all.zip
unzip gradle-1.4-all.zip
mv gradle-1.4 /opt
echo "export GRADLE_HOME=\"/opt/gradle-1.4\"" >> /etc/profile
ln -s /opt/gradle-1.4/bin/gradle /usr/local/bin/gradle

Workshop: Rule based event processing

cd ~
git clone http://www.github.com/m-schneider/ouce2013
cd ouce2013/groovy
. ./setenv.sh
cd ./non-gradle
./change-rules.sh

Output should look like:

Continue reading
Newer posts