Linux Admin Steps Into Management

Linux Admin Steps Into Management -

Postfix queue management – list, debug and clean

Postfix mail server

 

Pstfix mail server and acomulate a queue of stuck emails, 
we monitor them via Nagios and sometime get alerts similar to this one,
there are some methods to take care of this queue:

 

msg_q = 17 warn=10 crit=20
WARNING: mailq is 17 (threshold w = 10)

log into the mail server and use the list command to see the mail queue:

mailq

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
AAE603481BD 3471 Thu Oct 18 14:44:30  user@domain.com
(connect to outside.com[xxx.xxx.xxx.xxx]: Connection timed out)
user2@outside.com


the Q-id number is the id for the mail , you can read the mail to understnad what it is about and why its stuck with:

postcat -q AAE603481BD

you can delete it with:

postsuper -d AAE603481BD 

 

useful bash loop to delete all mails from do-not-reply@domain.com:

for i in $(mailq | grep -B1 'do-not-reply@domain.com'| grep '^[A-Z,0-9]'| awk '{print $1}')
do 
postsuper -d $i
done

 

 

Technorati Tags: , ,

Finally a Linux jmx query tool that works out of the box!

I've tried many many jmx query tools from the command line, 
windows has the jconsole tool which is a part of the Java binaries pack, and works fine, 
but it is not a command line tool – it has a nice GUI. 

this command line jar works like a charm, 
displays all the beans it finds, and allows you to invoke them , 

take a look at :

http://crawler.archive.org/cmdline-jmxclient/

only the cmdline-jmxclient-0.10.3.jar files is available for some reason, 
searches in google didnt find the newer file at all. 

than you run it with :

java -jar cmdline-jmxclient.jar – SERVER:PORT

to get a listing of all the available beens.

more samples are available on the link above. 

works like a charm!

 

Technorati Tags: , ,

Jumpy KDE on a new T430

The KDE screen kept hanging every few seconds , and it drove me crazy, 
another error I've been seeing is in the messages log:

 

Jul  5 12:34:05 desktop kernel: [ 5807.441851] [drm:i915_hangcheck_ring_idle] *ERROR* Hangcheck timer elapsed… blt ring idle [waiting on 1688990, at 1688990], missed IRQ?
 
which kept repeating all the time.
 
I found a working solution at: 
 
the solution that worked for me is:

On Kernel 2.8.38: /sys/module/i915/parameters/semaphores is set to 0
On Kernel 2.8.39: /sys/module/i915/parameters/semaphores is set to 1

if i do the following:

sudo -i
echo 1 > /sys/module/i915/parameters/semaphores

The Bug is also gone on 2.8.38 …..

If i set semaphores on 2.8.39 to 0 as it is default on 2.8.38, the bug also appears.

 

also there is a comment there talkeing about setting it up in boot through grub (I didnt test this yet though):

 

you can put this option in /etc/default/grub to make the change permanent
replace following line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

by
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.semaphores=1"

 

now my KDE runs just fine :)

 

fix for the autoboot suggestion:

it didnt work, a working solution was to edit the /boot/grub/menu.lst file and add i915.semaphores=1  to the end of the kernel line.

Technorati Tags: , , , ,

Exporting MediaWiki sites to Google sites

In the last post I’ve talked about moving files from SharePoint to Google Site,

what about a Mediawiki site?
how to export it and upload it?
I’ve already covered the uploading files to Google sites via the Google sites API,
you can use java or python to write a script to mass upload all your files and htmls to your new google site,
but first you need to export everything out of the Mediawiki site.

here is a working method to export your site, these are the steps:

  1. install python
  2. download the mw2html script
  3. export the mediawiki site

Technorati Tags: , , , ,

SharePoint to Google sites – how to move your files

Many organisations now move to use the Google office suite for their day-to-day office needs,
this includes the Google sites service which allows you to easily create internal portals for the different
organisation’s departments.

This move allows for a department to share an internal web site that has easy access from home as well with the regular office google account,
it also allows for better collaboration with other branches of the same company located far away – as it saves the need for an office VPN, or the need to connect to a server that is located in a branch in another country,
instead – everybody just connect to Google.

But what do we do if our files are already on the office internal SharePoint?

apparently – the migration processes from SharePoint to Google sites is not as hard ,
here are two working options.

Continue reading

Technorati Tags: , ,

Adding JMX support to your java app

what is JMX?

JMX is a technology that lets you add management interfaces for Java applications

the jmx interface on your java application will let you monitor and publish graphs for:

  • heap memory
  • threads and their stack trace
  • CPU
  • classes
  • memory pools
and it will also expose the java Mbeans tree which you can browse
with the jconsole app included with any java distribution:
you can either browse and read these attributes,
and in some cases edit them and change the application status.

Technorati Tags: , ,