Linux Kernel crash simulation using Kdump

There are several reasons for a Linux Kernel Crash which may include hangs, hardware and software errors. We usually consider a “Kernel hangs” and a “Kernel crash” as just a ‘crash’. In fact, these are totally two different issues; a “hang” occurs due to a time-consuming operation whilst a “crash” occurs instantaneously leading to a reboot. However, during the crash process prior to the reboot, the kernel will register “oops” messages.


In this article, I will lay emphasis on the installation of the tools for analyzing Linux Kernel crash. I will elaborate more on Linux Kernel errors in a future article. Right now, we will look at the installation of Kdump – Kernel dump, a Linux kernel dumping mechanism which uses a ‘kexec mechanism‘ to enable us to collect a ‘dump’ of the Linux kernel called “vmcore” (virtual memory core). Whatever event occurred during the time of the crash is registered in the “vmcore” for future analysis.


tux-logo

“Kdump uses kexec to quickly boot to a dump-capture kernel whenever a dump of the system kernel’s memory needs to be taken (for example, when the system panics). The system kernel’s memory image is preserved across the reboot and is accessible to the dump-capture kernel.”Kernel.org

Follow the steps below:

1. On both CentOS 6/7, you will need to install the kexec package using the command yum install kexec-tools

2.vim /boot/grub/grub.conf and for the kernel you are actually running edit the parameter crashkernel = auto and replace it with crashkernel= 128M (I tested it on a virtual machine with 1024MB)

3. Start the Kdump service using the command service kdump start

4. Save this parameter and verify it using the command cat /proc/cmdline. Here is a screenshot of how it should look

Screenshot from 2015-10-29 23:57:42

5. You would notice that the Kdump have the following configuration files using the command rpm -qc kexec-tools

  • /etc/kdump.conf
  • /etc/rc.d/init.d/kdump
  • /etc/sysconfig/kdump
  • /etc/udev/rules.d/98-kexec.rules

6. You can also choose the location to save your vmcore. By default, it will be saved in /var/crash/. However, if your /var directory is assigned to a different partition with low disk space, you can choose exactly where you want to generate your vmcore by modifying the parameter path /var/crash in the /etc/kdump.conf file.

7. After modification, you will need to restart the kdump service using the command service kdump restart.

8. Now the last step is to crash the machine thus creating a vmcore. Use the command echo c > /proc/sysrq-trigger. You would notice that this will take some time and the server will reboot by itself. A crash simulation has been done.

9. You will notice now after the reboot that a vmcore file has been created in the /var/crash directory.

Screenshot from 2015-10-30 00:15:18

10. The size of the vmcore depends on the consequence of the crash. In this simulation its just 19M. It also depends on the kernel activity during the time of the crash.

Tips:

  • You can also specify crashkernel = auto on a 64-bit machine. However, you can calculate it as follows:
  • If your RAM is greater than 0 GB  and less than 2 GB use 128 MB
  • If your RAM is greater than 2 GB and less than 6 GB use 256 MB
  • If your RAM is greater than 6 GB and less than 8 GB use 512 MB and so on
  • You can also test with less than 128 MB, it may work but the reliability and consistency is cautioned
  • If the kdump service does not start after a fresh installation, you might need to reboot your machine.
  • Since you have allocated a portion of the memory to the kdump, you might need to reboot your machine again and test it with a free -m



Debug your Internet bugs and vulnerabilities with ICSI Netalyzr

Can your Network be easily compromised? Is your Internet vulnerable? You might want to perform some tests on the Quality of Service your Internet Service Provider – ISP is providing you. It can also be more dangerous if your ISP is also your router vendor! One of the fast and reliable tools which I would propose is the ICSI Netalyzr tool which tests your internet connections for signs of trouble and provides you detailed report vulnerabilities, latency, and several tests. The test can be performed by almost anyone with just a simple click.

“ICSI Netalyzr is a service maintained by the Networking Group at the International Computer Science Institute, an affiliate with the University of California, Berkeley and funded by the National Science Foundation. The service got some publicity and found importance after late 2007 when Comcast was sued for throttling Internet traffic which Comcast later admitted being true.” – freewareGenius

Debug your Internet bugs and vulnerabilities with ICSI Netalyzr 1

The report consists of:

  • A summary of the Noteworthy Events
  • Addresses-based Tests
  • Reachability Tests
  • Network Access Link Properties
  • HTTP and DNS tests
  • IPV6 tests and Network Security Protocols
  • Host Properties

I made several tests myself and notice that many routers are vulnerable to attacks. One of the tests I made from a Netgear router DG series intentionally downgraded with an old firmware from the official website of Netgear was found to be vulnerable. Click here on this link to access to the Netalyzr tool. I would, however, recommend you to use DD-WRT or OpenWRT for best QoS.

Example - A Netgear router vulnerable to CVE-2012-5958 and CVE-2012-5959
Example – A Netgear router vulnerable to CVE-2012-5958 and CVE-2012-5959

You could also check for DNS resolution, Latency issues and Measurement of your Network buffering capacity. You would need to authorize your browser to access a JAVA plugin to be able to perform the test.

You can also perform your test using the Android App as well as on the Netalyzer command line client.


Seven steps to compile Python3.5.0 from source

After a minimal install of Centos7, you would notice that your version of Python would be maybe 2.7.5 which may not be compatible with other applications you are actually using. To be updated to the latest version, one of the possibilities is to compile your own Python from Source.

python


Here are the steps that you can follow to compile your own Python. At the time, I am writing this article the latest version is Python-3.5.0. You can refer to this link for future versions.

1. Download the prerequisites. I would also recommend an update before downloading the prerequisites.

yum update -y && yum install yum-utils make wget

2. To be able to compile your Python, you will need to download some requirements which will facilitate the compilation tasks


yum-builddep python

3.Download the Python package

wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz

4.Untar your Python Package

tar xvzf Python-3.5.0.tgz

5. Get into the Package and fire the following commands

./configure
make

6. If the make process is successful, you can now start the installation with the following command

make install

7.Python-2.7 is usually the default version. You will need to specify your OS to run with the new version.


alias python='/usr/local/bin/python-3.5'

We now have the python-3.5 installed and ready for use.


Linux server Monitoring with Nodequery

One of the best ways to which I think bloggers can monitor traffic on their website is by using Nodequery. Though it is well adapted for huge businesses, I am sure you would like to adventure on this Public API. NodeQuery is currently in public beta and completely free of charge.






Linux server Monitoring with Nodequery 2
Photo Credits to Nodequery.com

To install NodeQuery, you will need to register on the official website. You will be prompted to install the Agent on your machine by downloading it from Github using the command https://raw.github.com/nodequery/nq-agent/master/nq-install.sh

After installation, you need to launch the bash script and immediately after less than 3 minutes your server is being monitored.






For the free version, you have the possibilities to have a full overview of your system, Network Usage, Network latency, Average Load, Ram and Swap Usage, Disk Usage and the Top Processes.

Well, there are several more features to explore.

Cool isn’t it?


The WTF Star!

If you are thinking about the acronym “WTF” as usual in a chat conversation, then you are WRONG!.. 🙂 Located in the exoplanetary system, the WTF star – “Where’s the Flux” also known as KIC 8462852 or simply Tabby’s star is a strange star as a potential evidence of an ancient alien megastructure situated above the milky way between the Cygnus and Lyra constellations.


Screenshot from 2015-10-25 17:43:22
A screenshot is taken from my Stellarium indicating the location of Cygnus and Lyra

Thanks to the Kepler Project, Kepler, a space telescope is searching for exoplanets orbiting other stars in our galaxy. “NASA wants to find out if there is life beyond our solar system so Kepler is looking for planets like earth incise that could be potentially habitable”  – Natalie Batalha, the research astronomer at NASA Ames Research center.



kepler_0
Kepler Space Telescope – Photo credits to NASA – nasa.gov

Have astronomers found alien life in space? This is indeed the most challenging mission to mankind after the discoveries made by the Kepler Project. “We are clueless as to what could cast the shadow bigger than Jupiter… Is it a comet? Is it an asteroid? Is it a media? and one by one we ruled out all the logical possibilities. That last possibility is that it is artificial. It could be a Dyson Sphere. A Dyson sphere is built by a civilization that can play with stars that envelop the entire star with a shell absorbing all the starlight “Dr. Michio Kaku, Theoretical Physicist.



Indeed, a good job of the Kepler Space exploration team. Of course, if this is going to be a remarkable claim, a remarkable proof of the century is waiting for us ahead.