• Wer ist schuld am Amoklauf von Winnenden?

    Published 12. March 2009 at 11:38 am - 3 Comments

    So...

  • McColo offline – Spam Volume drops

    Published 13. November 2008 at 5:44 pm - No Comments

    After...

  • Mugabe, Zimbabwe, die Wahl, die Waffen und die “An Yue Jiang”

    Published 21. April 2008 at 11:08 pm - No Comments

    Seit meinem Besuch im August 2007 im westlichen Teil von Zimbabwe geht mir dieses Thema verständlicherweise viel näher als vorher. Nicht allein weil ich live miterleben konnte, wie das Land zu Grunde geht, sondern auch wegen der Anteilnahme, die unsere südafrikanischen Führer der Situation entgegenbrachten und wie sie uns dafür sensibilisierten (links unsere damalige Reiseroute mit Endstation in Zimbabwe). Damals schon wurde hoffnungsvoll auf die kommenden Wahlen geblickt, die nun am 29.3.2008 stattfanden und bei denen allgemein gehofft wurde, dass der 84-jährige Robert Mugabe nach 28-jähriger Amtszeit als Regierungsoberhaupt endlich abgelöst wird. Kein Zweifel besteht daran, dass er in seiner Amtszeit das Land mit diktatorischen und unmenschlichen Aktionen heruntergewirtschaftet hat – im Februar diesen Jahres hatte die Inflationsrate 100.000% überschritten. Die Touristenhochburg Zimbabwes liegt im westlichen Zipfel: Die mächtigen Victoria Falls sind nach wie vor ein beliebtes Reiseziel und sehr beeindruckend, doch auch im Touristädtchen mit dem gleichen Namen macht sich die Armut bemerkbar. An den Tankstellen gibt es keinen Sprit, Softdrinks werden in Kneipen als Spezialität des Tages gelistet (und das ist kein Scherz) und der allgemeine Trend eines jeden zimbabwischen Einwohners ist das Pilgern nach Victoria Falls, um sich dort wenigstens ein kleines Scheibchen vom Tourismus abschneiden zu können. Schlangen über hunderte Meter bilden sich morgens an einem kleinen 7-Eleven Laden, weil das Gerücht umherging, es gäbe Brot. Einheimische kommen dir alle paar Meter entgegen und wollen dir ihre geschnitzten Figuren verkaufen – nicht für Geld, sondern im Tausch gegen dein altes verschwitzes T-Shirt oder deine dreckigen Schuhe. Rießige Hotelanlagen wie “The Kindgom“, das einst Michael Jackson gehörte, sind wie leergefegt – trotz Tourismus. Die Fressmeile im Inneren des Hotelkomplexes hat nur noch wenige Läden geöffnet und wenn man sich eine Pizza bestellen willst, muss man auf 40% seiner Toppings verzichten oder Kompromisse eingehen. Für ein Trinkgeld von einem Dollar wirst du hier zu einem Gott erklärt. Ich habe noch nie jemanden so glücklich über ein kleines Trinkgeld gesehen. Der Import vom Nachbarland Zambia geht nur stückchenweise voran. An der Grenze entstehen unglaublich lange Wartezeiten, nur als Touri darf man schnell mal vor, um die Wasserfälle von der anderen Seite zu sehen. Und jetzt kam Ende März endlich die Wahl und versprach Besserung, die Oppositionspartei Movement for Democratic Change (MDC) hatte eine sehr gute Ausgangsposition und allem Anschein nach auch gewonnen. Allem Anschein nach? Ja, denn nach drei Wochen sind die Wahlergebnisse immernoch nicht veröffentlicht. Mugabe verlange eine erneute Auszählung, da es in einigen Gebieten Probleme bei der Wahl gab – natürlich waren das die MDC-Hochburgen. Da der Verdacht auf möglichen Wahlbetrug schon vor der Wahl (berechtigterweise) laut wurde, waren viele unabhängige Wahlbeobachter im Land. Jüngst bei den Neuauszählungen kam es hier jedoch zu massivem Wahlbetrug, zu Gewalt, Unterdrückung und Folterung Oppositioneller in Foltercamps. Südafrikanische Zeitungen berichten unterdessen, dass Militär, Polizei, der Geheimdienst und sogar Mugabes Leibwache dringend neue Munition und neue Waffen brauchten. Mehrere Lieferungen – Hauptlieferant China – hätten storniert werden müssen, weil die Staatsbank die Rechnungen nicht habe bezahlen können. Und ohne Waffen ist schließlich keine Unterdrückung möglich. Leider jedoch ist die Staatskasse leer und ohne Geld keine Waffen. Im Endeffekt also keine Macht mehr. Doch wer Mugabe kennt, weiß, dass er sich trotz internationalem Druck keine Möglichkeit entgehen lässt, sich an seine Macht zu klammern. Waffen müssen also her, koste es was es wolle. Die “An Yue Jiang” ist ein chinesisches Containerschiff mit genau dieser lang ersehnten Lieferung: 70 Tonnen Waffen und Munition (laut taz: 1.500 Raketen, 2.500 Mörsergranaten, fast 100 Granatwerfer und 3,5 Millionen Schuss Munition) , angeblich im Wert von 40 Millionen EURO. Damit hätte man dem Land auf ganz andere Art und Weise dienen können. Blöd auch, dass Zimbabwe keinen Hafen hat und alle möglichen Anlaufhäfen von Regierungen geführt werden, die verhindern wollen, dass diese Waffen nach Zimbabwe gelangen. So wurde die Entladung im südafrikanischen Durban verweigert und der Transport nach Zimbabwe ohnehin verboten. Abgesehen davon: Die [deutsche] Entwicklungsbank habe dem simbabwischen Staatskonzern “Iron & Steel Company” zur Errichtung eines Stahlwerks 1998 und dann noch einmal als Aufstockung im Jahr 2000 insgesamt Kredite “in zweistelliger Millionenhöhe” bewilligt, für die Simbabwe eine Staatsgarantie übernommen habe. Da Mugabe also noch Schulden in etwa der Höhe der Ladung bei der deutschen Kreditanstalt für Wiederaufbau (KfW) hat, hat die Entwicklungsbank eine Pfändung der Ladung erwirkt – bevor diese jedoch in Kraft treten konnte, legte das Schiff hastig wieder von Durban ab, Ziel unbekannt. Aufgetankt werden konnte vorher allerdings nicht mehr. Es darf gespannt sein, wo das Schiff wiederentdeckt wird und welchen Hafen es versucht anzulaufen. Ob Angola erreicht werden kann steht aufgrund des Spritmangels in den Sternen und ob die Ladung bei Mugabe ankommt ist mehr als fraglich, aber aufgrund der internationalen Mobilmachung und der Entladungsweigerung der südafrikanischen Transportarbeitergewerkschaft hoffentlich eher unwahrscheinlich. Nicht nur Südafrikas Mann im internationalen Bund der Transportarbeiter macht Front gegen Mugabe. Auch die 300.000 Mitglieder starke südafrikanische Transportarbeitergewerkschaft Satawu hat ihre Kollegen in der ganzen Welt aufgerufen, das chinesische Schiff zu boykottieren. Diese Nachrichten habe ich zum Anlass genommen, mir nochmal Lord of War anzuschauen. Denn immernoch aktuell: “While private gunrunners continue to thrive, the Worlds biggest arms suppliers are the U.S., U.K., Russia, France and China.” “They are also the five permanent members of the U.N. Security Council.” Quellen (soweit nicht anders angegeben): Mugabe erwartet Schiffsladung voller Waffen aus China vom 18.4. Mugabes Waffen-Frachter auf dem Weg nach Angola vom 20.4. Mugabe wartet auf das Geisterschiff vom 21.4. Deutsche Förderbank jagt Mugabes Waffenschiff vom 21.4. Meine Fotos von Victoria Falls in Zimbabwe Update: Die Ladung wird wohl zurückgerufen, Spiegelartikel vom 22.4.: Die “An Yue Jiang” mit ihrer Ladung aus Waffen und Munition konnte in keinem afrikanischen Hafen entladen werden, weil der internationale Verband der Transportarbeiter (ITF) überall auf dem Kontinent zu einem Boykott des Schiffes aufgerufen hatte. Heute hatte sich die letzte Hoffnung der Reederei zerschlagen: Als letztes Land weigerte sich auch Angola die Ladung zu löschen. Angolas oberster Hafendirektor Filomeno Mendonca hat den letzten möglichen Schlupfwinkel an Afrikas Küste versperrt. “Das Schiff darf keinen angolanischen Hafen anlaufen,” erklärte er in einem Interview mit Radio Luanda. Menschenrechtsgruppen und Gewerkschaften hatten davor gewarnt, die Waffen nach Simbabwe gelangen zu lassen. Dort mehren sich seit den umstrittenen Wahlen vor mehr als drei Wochen Berichte über blutige Übergriffe gegen die Opposition.

MRTS – MRTG RRDtool Total Statistics

This little guide is not supposed to be an introduction to SNMP, RRDtool or MRTG though I will give a very tiny look into these programs. The true intension of this tutorial is a properly configured MRTS that, of course, goes along with a correct installation of MRTG, RRDtool and SNMP. So most of the time we will have to configure these three programs. Moreover this tutorial is based on a FreeBSD system, i am running 6-STABLE. I presume that you have Apache installed and configured properly for the use with PHP. If not, do so! I won’t explain that here. The following chapter will give a short overview over the programs we need for setting up MRTS. The programm summaries are the ones that can be found on the corresponding official websites along with other detailed information on that specific program. So let’s get started.

  • Overview

    • So what is MRTS anyway?
    • Website: http://apt-get.dk/mrts
    • Description: MRTS is short for “MRTG RRDtool Total Statistics”. It is a PHP script written by Thor Dreier that uses “MRTG and RRDtool to sum up total traffic monthly and yearly”. But why making words, if you can see the full power of MRTS in some examples: http://mrts.domainnet.dk Just click on any device and MRTS will show you the traffic-graphs and some statistics on how much traffic you have made during the actual/last months/year.

    OK, now we know what MRTS does, but…

    • What is MRTG?
    • Website: http://oss.oetiker.ch/mrtg/
    • Description: “The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing graphical images which provide a LIVE visual representation of this traffic. [...] MRTG is based on Perl and C and works under UNIX and Windows NT.” Again, we want to see some results on that, to see its power. So just take a look at http://www.stat.ee.ethz.ch/mrtg and pick a device. I think you’ll be satisfied. MRTG goes along alone very well, so if the examples, you have just seen, is everything you want, just install MRTG and you are free to go. (Note: You must NOT use the mrtg.cfg we will configure below. Just skip the Logformat: rrdtool command for MRTG standalone setup). I, for my part, was not fully satisfied with MRTG, because I wanted my router/server to show me detailed traffic summaries over the last months/year. And that’s where MRTS comes into play, because MRTS sums up this traffic using MRTG and RRDtool.
    • What is RRDtool?
    • Website: http://oss.oetiker.ch/rrdtool/
    • Description: “If you know MRTG, you can think of RRDtool as a reimplementation of MRTGs graphing and logging features. Magnitudes faster and more flexible than you ever thought possible. RRD is the Acronym for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, server load average). It stores the data in a very compact way that will not expand over time, and it presents useful graphs by processing the data to enforce a certain data density. It can be used either via simple wrapper scripts (from shell or Perl) or via frontends that poll network devices and put a friendly user interface on it.” RRDtool allows you to almost log everything and convert it into nice impressive graphs. Take a look at http://oss.oetiker.ch/rrdtool/gallery/index.en.html for some examples.

    As MRTG needs the Simple Network Management Protocol (SNMP) to work properly, we will take a short look on what this does:

    • What is SNMP?
    • Website: http://net-snmp.sourceforge.net/
    • Description: “SNMP is an application-layer protocol that facilitates the exchange of management information between network devices. It is part of the Transmission Control Protocol/Internet Protocol (TCP/IP) protocol suite. SNMP enables network administrators to manage network performance, find and solve network problems, and plan for network growth.” For our plans, we need to install net-SNMP (formerly known as ucd-SNMP) that consists of various tools relating to SNMP.

    So, enough explanations, let’s get to work!

  • Installing and Compiling

    • First thing to do is to check, which of the above mentioned packages you already have installed. No idea? Well, then you should do a simple
      ls /var/db/pkg or pkg_info
      which lists the packages, you have installed using the FreeBSD ports. If you don’t know what the FreeBSD ports are, then you probably won’t have to read on, as some basics really are required in this tutorial ;) Anyway, i’m trying to explain step by step. After you have checked your installed packages, install the packages you still need.


      Net-SNMP: /usr/ports/net-mgmt/net-snmp
      MRTG: /usr/ports/net-mgmt/mrtg
      RRDtool: /usr/ports/net/rrdtool

      Some of these programs depend on various libraries (e.g. zlib, libpng, GD), but that’s the good thing: The port-install-mechanism will automatically check, if you have them or not and it will install them, if needed. Do a

      make && make install && make clean

      in the corresponding port directories to install that specific port.
      Now it could take a while until all ports are compiled.

  • Configuring

    • Alright, as far as I see, we are done compiling :) So let’s get it on, this is the harder part:

    • Configuration of net-SNMP
    • Create a snmpd.conf with

      snmpconf -i -g basic_setup

      This will start a walktrough asking you some questions about your system. The book “Absolute BSD” (“FreeBSD de Luxe” in Germany) explains in detail, how to properly set up net-SNMP. I’m gonna make it short:

      • Type y for configuring “the information returned in the system MIB group”
      • syslocation is a string of the location of your server, e.g. “my room”, syscontact is you.
      • Type y for setting “the value of the sysServices.0 OID”
      • The following questions should be answered with “1″ (yes) or “0″ (no). Commonly it is “0″ for repeater and bridge and “1″ for IP, TCP, SMTP
      • Type y for configuring “the agent’s access control”. Then answer the following three questions (read-write user based access, read-only user based access, read-write community access) with n. Answer the next one (read-only community access) with y. You will be asked for a community name. Invent one or take the default: public (NOT RECOMMENDED!) The network to accept this community from should be the loopback (127.0.0.1) or something like 192.168.100.0/24 for example. 0.0.0.0/0 will give anyone access. Don’t use this! Hit [return] for “no restriction” in the next question. Then you are finished, don’t do another community line. The rest can all be answered with n.
      • Finally send the SNMPdeamon a Hangup Signal for re-reading the configuration, if SNMP was running while configuring: ps faux | grep snmpd tells you the PID to send kill -HUP theSnmpdPid to.

      The snmpd.conf is now stored in /usr/local/share/snmp/. Move it to /usr/local/etc/snmp/snmp.conf (Note: This Setup was very basic and does by far not show the power of net-SNMP. But for our purpose that is all we need right now. You should probably read some literature about it and do a better configuration afterwards. Read http://net-snmp.sourceforge.net/tutorial/tutorial-5/mrtg/index.html for more information on how to set up MRTG to monitor disk-space, CPU-load and so on…)

      OK, next step is to start the services, i.e. snmp and mrtg. You can do this via the start scripts in

      /usr/local/etc/rc.d/

      Speaking of start-scripts, make one for MRTG (mrtg.sh) if there is non in the directory, we’ll need it later. Of course, you only have to do this step, if the installation of MRTG does not have put an autostart script itsself into /usr/local/etc/rc.d/. When I installed it, this was not the case so I had to make my own.

      #!/bin/sh
      /usr/local/bin/mrtg --logging=/var/log/mrtg.log --pid-file=/var/run/mrtg.pid /etc/mrtg.cfg

      Now start snmpd (e.g. ‘/usr/local/etc/rc.d/snmpd.sh start’). Check if the processess are running!
      PS: If you are using one of the lastest FreeBSD Releases (5.x and up) you are advised to start the deamons via /etc/rc.conf at boot-time. Consult some other Information source on how to use the rc-scripts.

    • Configuration of MRTG
    • OK, snmpd is running, let’s configure MRTG. The binaries should be localted in /usr/local/bin. The “\” in the following command means, that this should be one line. Type

      cfgmaker --global 'WorkDir: /usr/home/www/stats' --global 'Options[_]: growright' \
      --output /etc/mrtg.cfg community@router.abc.xyz

      where WorkDir is the directory, where the images and html pages should be placed (Note: Later on we will have no images and htmlpages in that directory, but one php-script (MRTS) and some *.rrd files containing the RRDtool data). It has to be visible to a webbrowser, of course. You can play with the arguments, this one should be the best for the first time, for detailed documentation check the website or your man-pages. output is the directory, where your config file will be placed. Replace community@router.abc.xyz with your specification, i.e. public@localhost. This should test your devices and have an output like this:

      --base: Get Device Info on public@localhost:
      --base: Vendor Id:
      --base: Populating confcache
      --snpo: confcache public@localhost: Descr rl0 --> 1
      --snpo: confcache public@localhost: Descr lp0 --> 2
      --snpo: confcache public@localhost: Descr ed1 --> 3
      --snpo: confcache public@localhost: Descr lo0 --> 4
      --snpo: confcache public@localhost: Descr tun0 --> 5
      --snpo: confcache public@localhost: Ip 127.0.0.1 --> 4
      --snpo: confcache public@localhost: Ip 192.168.100.100 --> 1
      --snpo: confcache public@localhost: Ip 213.23.58.244 --> 5 [It's a dynamic IP, just for your notice ;) ]
      --snpo: confcache public@localhost: Type 6 --> 1
      --snpo: confcache public@localhost: Type 34 --> 2
      --snpo: confcache public@localhost: Type 6 --> 3 (duplicate)
      --snpo: confcache public@localhost: Type 24 --> 4
      --snpo: confcache public@localhost: Type 23 --> 5
      --base: Get Interface Info
      --base: Walking ifIndex
      --base: Walking ifType
      --base: Walking ifSpeed
      --base: Walking ifAdminStatus
      --base: Walking ifOperStatus
      --base: Writing /etc/mrtg.cfg

      If it does not do something similar like this, you did something wrong in configuring snmpd or snmpd is not running. So take a look at the output. What do you want to log? I wanted to log my internet-traffic, so i had to take device number 5 (device 4, i.e., is software-loopback, device 1 is internal traffic in your LAN). Open your newly configured /etc/mrtg.cfg and check it out. It needs some reconfiguration for our needs. First lines without a comment should be

      WorkDir: /usr/home/www/stats/
      Options[_]: growright
      Logformat: rrdtool
      RunAsDaemon: Yes
      Interval: 5
      PathAdd: /usr/local/bin/
      IconDir: http://my.url.com/stats/icons/

      I really suggest to read http://people.ee.ethz.ch/~oetiker/webtools/mrtg/reference.html for more and detailed information, though i am going to explain the commands above.
      You already know the first two lines. The third one is very important. Without it, MRTG would create the images itsself without using RRDtool. But i like RRDtool images better :) Furthermore you would have to do a cronjob for MRTG AND indexmaker, to create your corresponding html-files as well. With the Logformat command MRTG will save all its data in one file called ##device##.rrd where ##device## is i.e. localhost. Thanks to that file, we can use RRDtool to evaluate our graphs. RunAsDaemon is a very nice feature for avoiding a cronjob. After starting MRTG, it is being daemonized and not launched repeatedly (as it would have been with cron). MRTG will be active every 5 minutes. PathAdd is not always needed, but it can’t harm. It’s the path to your RRDtool binary and IconDir is the directory the icons are in, that came with the installation of MRTG (look for the icons in /usr/local/share/mrtg/) After these commands your devices are being listet. Comment those out that you do not want to log. I just wanted to log device #5. Should look something like this:

      ### Interface 5 >> Descr: 'tun0' | Name: '' | Ip: '213.23.58.171' | Eth: '' ###

      Target[localhost_5]: 5:public@localhost:
      SetEnv[localhost_5]: MRTG_INT_IP="213.23.58.171" MRTG_INT_DESCR="tun0"
      MaxBytes[localhost_5]: 750000
      Title[localhost_5]: Traffic Analysis
      PageTop[localhost_5]: <H1>Internet Traffic Analysis</H1>
      <TABLE>
      <TR><TD>System:</TD> <TD>FreeBSD 6-STABLE in Bjou's Home in Karlsruhe City</TD></TR>
      <TR><TD>Max Speed:</TD> <TD>Arcor-DSL 6 MBit</TD></TR>
      </TABLE>

      You are free to alter some values, I deleted some of them within the <TABLE></TABLE> because I didn’t find them very interesting. It will not affect your MRTS appearance anyway, but your MRTG output, if you want to make a standalone MRTG installation or if you want to use an “on-the-fly”-script as mrtg-rrd or 14all.cgi (which I also advise to take a look at, though you don’t need it). Maybe don’t alter anything before really getting started, you will know what you want to alter later, when you see the results (Note again: You won’t actually see the above strings in your MRTS output!). First line is the most important one: 5:public@localhost: 5 is your interface number mentioned above followed by community@router.abc.xyz. Thor Dreier explains on his MRTS website how to get the value for MaxBytes:

      “In “MaxBytes” we have set how many bytes the device maximum can transfer:
      (100Mbit * 1000000bit/Mbit / 8byte/bit = 12500000byte).”
      So as I have a 1.5 MBit bandwidth, we’ll have to set: (6Mbit * 1000000bit/Mbit / 8byte/bit = 750000 byte)

      Be sure to read Thor’s MRTS site properly for some additional information I did not mention here (especially if your are a Debian User).
      What, you are still here? READ IT NOW! ;)
      OK, looks like we configured the mrtg.cfg well, so let’s start MRTG using our script above. You are getting error messages? No problem, this is normal the first time(s) you start MRTG. You maybe want to run MRTG under a certain user (running processes under root is not always the wisest decision) ;) therefore you will need the --user=mrtg_user --group=mrtg_group switches in your mrtg.sh startscript. It could be that there are some problems then, if mrtg_user does not have the rights it needs to access/write certain files. Try yourself, I won’t explain that here.
      Having started MRTG, it should say “Daemonizing MRTG …” as a result. Check your logfile and your processes if it was successful.

    • Configuration of MRTS itsself
    • Now comes the best part, the wonderful MRTS. Download from http://apt-get.dk/mrts/download/

      (same files with different extension) and rename to *.php. Open the file and configure the following:


      /* The directory where the rrd files are located */
      $dir = ‘/usr/home/www/stats’;

      /* List all devices that MRTS should’n display, */
      $exclude = array(’secret’, ‘topsecret’);

      /* RRDtool path – where is the the executable located */
      $rrdcommand = ‘/usr/local/bin/rrdtool’;

      The first path is exactly the MRTG WorkDir, second one explains itsself, last one is the path to your rrdtool executable. (Note:
      rrdtool in the path listed above in not a folder, but the rrdtool binary!)
      Well, that’s it. If your Apache is properly configured, give it a try. But first check, that you do not run your script in “safe mode php”.
      If you server does this as standard, you have to put something like this in your httpd.conf:


      <Directory “/path/to/mrts”>
      php_admin_value safe_mode 0
      <Directory>


      Put the MRTS php script in /usr/home/www/stats/ and surf on it. And….. whoo-hoo, you are done! :)

    Leave a Reply