Pages

Making KVM Image File Sparse with virt-sparsify

No comments:
Sparse files use disk space more efficiently. Only metadata information is written to disk instead of the empty space that constitutes the block, using less disk space. Sparse term corresponds to thin-provisioned image in the VMware jargon. To sparsify a vm guest image first you shut the guest down. In my KVM Host there is a non-sparse kvm image file which is identified like this:

# ls -lsh
61G -rw-r--r-- 1 qemu qemu 60G Jun 22 08:15 SRVTEST01.img

As seen from the output of the ls command SRVTEST01.img guest image occupies all of the file. To make it sparse:

Sending Jboss Server Logs to Logstash Using Filebeat with Multiline Support

No comments:
In addition to sending system logs to logstash, it is possible to add a prospector section to the filebeat.yml for jboss server logs. Sometimes jboss server.log has single events made up from several lines of messages. In such cases Filebeat should be configured for a multiline prospector.

Filebeat takes lines do not start with a date pattern (look at pattern in the multiline section "^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}" and negate section is set to true) and combines them with the previous line that starts with a date pattern.

server.log file excerpt where DatePattern: '.'yyyy-MM-dd-HH and ConversionPattern: %d %-5p [%c] %m%n

2014-06-10 00:30:22,452 ERROR [MainDeployer] Could not initialise deployment: file:/Development/jboss-4.2.3.GA/server/default/deploy/jbossws.sar/
java.lang.NoClassDefFoundError: javax/ejb/Stateless
at org.jboss.ejb3.EJB3Util.isStateless(EJB3Util.java:42)
at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:219)
at org.jboss.ejb3.EJB3Deployer.accepts(EJB3Deployer.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Logstash filter:



Pronunciations of the Bash Special Marks

No comments:
Although there are many choices for the pronunciation of the bash special marks, I like to pronounce them as follows:

  • . dot
  • , comma
  • : colon
  • ; semi-colon
  • ! bang
  • " double quote
  • ' tick
  • ` back-tick

An Experiment with Filebeat and ELK Stack

No comments:
ELK Stack is one of the best distributed systems to centralize lots of servers' logs. Filebeat is a log shipper that keeps track of the given logs and pushes them to the Logstash. Then logstash outputs these logs to elasticsearch. I am not going to explain how to install ELK Stack but experiment about sending multiple log types (document_type) using filebeat log shipper to logstash server.

Linux Foundation Zephyr Project

No comments:
On the February 17, 2016, The Linux Foundation has launched a project named Zephyr, which is a new player on the Internet of Things field, to encourage an open source, Real-Time Operating System for Internet-of-things (IoT) devices. The Project supports multiple system architectures and is available through the Apache 2.0 license. Just because it is an open source project, the community can improve it to support new hardwares, tools, sensors and device drivers.

The Project is modular. Many of IoT devices need a hardware that addresses the very smallest memory footprint. Linux has already proven to be very good at running with limited resources. Zephyr kernel can be run on 8kB of memory. One disable or enable as many modules as needed.

It will be also secure. Security is very important to all IoT devices. The Linux Foundation is working out on a group whose jobs are to the task of maintaining and improving the project security in particular.

At first Zephyr will Support:

  • Bluetooth
  • Bluetooth Low Energy
  • IEEE 802.15.4
  • 6Lowpan
  • CoAP
  • IPv4
  • IPv6
  • NFC
  • Arduino 101
  • Arduino Due
  • Intel Galileo' Gen 2
  • NXP FRDM-K64F Freedom board


For now founding members of its ecosystem are
  • Intel
  • NXP Semiconductors N.V.
  • Synopsys Inc.



Parsing HTML Output of the Nagios Service Availability Report

No comments:
Nagios has a Service Availability Report feature which is usable from Reports section of its web interface. But this feature is not designed as a web service architecture like a RESTful system. So in order to get these reports from an application interface we must make an Http request and parse the results. I just want to give an example of a python script does this kind of automation.

Nagios version used in this example is 3.5.0. Since Nagios serves with https and requires basic authentication, we have to use a ssl context and an authentication header. Python version is 2.7. Beautifulsoup4 library is used for parsing Http output.

PowerShell Script for Switching Between Multiple Windows

No comments:
Windows PowerShell has strong capabilities. I have a separate computer with a big lcd screen in which I am watching regularly some web based monitoring applications. So I need those application windows switch between on a timely basis. Then I wrote this simple powershell script to achieve this. You can change it according to your needs.