Tag: mysql

bash debug – log all executed commands

Screenshot of a Bash 3.1 session demonstrating...
Screenshot of a Bash 3.1 session demonstrating its particularities. Shows exporting a variable, alias, type, Bash’s kill, environment variables PS1, BASH_VERSION and SHELLOPTS, redirecting standard output and standard error and history expansion. A POSIX session is launched from a normal session. Finally, the POSIX session kills itself (since just “exit” would be too boring). (Photo credit: Wikipedia)

Whenever I am writing a script in perl or bash, I always wish that there
was some way to have all the commands logged or output to screen. I know
there is “set -x” option to have debugging enabled, but sometimes that
seems to be too much information and I dont really need all that. So, here
is something I found recently for bash to log all the executed commands.

trap "echo $BASH_COMMAND" DEBUG

This will echo/print all the commands on the stdout.

 

Enhanced by Zemanta

Monitor your system with sysusage.

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.

By default it will monitor all you need to know on your server activity, it
is written in Perl and should works on all Unix like plateforms. It doesn’t
require a Database system like MySQL or PostgreSQL but lie on rrdtool. In
addition you can embeded your own plugins written in any programing language.

Since release 5.0 SysUsage can be run from a centralized place where
collected statistics will be stored and where graphics will be rendered.
Unless other monitoring tools with lot of administration work, SysUsage is
design to have the lesspossible things to configure and a high level of admin
system knowledge. Each server can also be self monitored and you just have to
connect your browser to the web interface to know his health level.

SysUsage is design with simplicity in mind. I want all relevant statistics
from my servers within an intuitive web interface and without spending too
much time to configure it, if you know Nagios, you know what I mean. You will
especially like SysUsage for that.

And now for the installation:

sudo yum install sysusage sysusage-httpd

Once you have installed, you would need to enable the crontab to collect the data. And the sysusage-httpd is for the apache server configure to enable you to access http://localhost/sysusage

And you are done. It pretty good to see the overall system usage wrt to CPU, Disk and network.

Enhanced by Zemanta

phpmyadmin access problem and change server from URL

I was having issues with one of the phpmyadmin setups. The first server defined in the config file was not accessible and the theme that I was using was not allowing me to change the server from the first page. This resulted in a state where I was not able to access phpmyadmin in any way. I could not connect to any of the servers. And thus had to hack my way in to phpmyadmin to find out how to connect to other servers from URL. And here is my finding:

http://server/phpmyadmin/index.php?server=1

In the above, replace server with your server address/IP. and also the number in the end with the server index in you phpmyadmin config file.

Enhanced by Zemanta