Get status of your servers with perl script.

2014-07-14 1 min read Perl

Monitoring the servers could be well – “not difficult” but boring and monotonous. And since this is something that you should ideally do on daily basis, so why not have a script for the same.

You can’t possibly copy your ssh-keys to all the servers that you are monitoring, better if you can, then you need to do ssh to server with password. So, here is link to my github repo for monitoring servers with perl script. Preety straight forward script and you can schedule this in cron to get a daily mail.

Continue reading

Monitor your system with sysusage.

2013-12-02 2 min read Fedora

First some information on sysusage:

Description :
SysUsage continuously monitor your systems informations and generate
periodical graph reports using rrdtool or javascript jqplot library.
All reports are shown throught a web interface.

SysUsage grabs all system activities using Sar and system commands allowing
you to keep tracks of your computer or server activity during his life.
It is a great help for performance analysis and resources management. The
threshold notification can alarm you when the system capabilities are
reached by sending SMTP messages or throught Nagios reports.

Continue reading

create text tables from delimited files.

2013-07-12 1 min read Bash Fedora

To create simple text tables to paste in emails or to use in any other document where you want to show a table, here is something that you can use. There is a perl module which provides “tablify“. And here is how to use it:

sudo yum install perl-Text-RecordParser

This will install a command “tablify” that you can use in number of ways. Here is a simple example to use it. You can read the man pages to see how you can use it.

Continue reading

some interesting alias

2011-09-27 1 min read Linux

For this time, I will just give you a link to to bashrc file.

http://hayne.net/MacDev/Bash/aliases.bash

Head over there and see some very interesting aliase’s.

Enhanced by Zemanta

bash regular expressions

2011-02-06 1 min read Bash

Here are some quick links on bash regular expressions, pretty good links to bookmark, if you use, regular expressions in bash regularly. I especially like the tldp link at number 3.

http://www.linuxjournal.com/content/bash-regular-expressions
http://www.ibm.com/developerworks/library/l-bash.html
http://tldp.org/LDP/abs/html/parameter-substitution.html#VARMATCH
http://wellington.pm.org/archive/200005/codegen/index9.htm

Enhanced by Zemanta

fork a new process in perl

2011-01-27 1 min read Uncategorized

I was doing something today and found that I require to fork a new process in perl. Now I had never done this earlier, so I did not know how to do this.

First some background :

I was doing some program very similar to http server, where the script accepts some input through a socket and then processes the same. In doing so I was seeing that the script was taking some time in processing the input and thus was not processing the second request until the first one was completed. Simple solution, fork the process.

Continue reading

perl is faster than bash in some cases.

2011-01-11 3 min read Bash Fedora Linux Perl

Some days back, I had to generate some data to be uploaded to a database. As usual I assumed that bash should be faster and hence wrote the script to create the files in bash. But I found that even after 5 hours I was only 10% done with the data generation. Now that would mean that it would take around 50 hours to complete the data generation. Something did not look correct to me and I asked one of my colleague. He suggested I do a strace.

Continue reading
Older posts