munin-node mysql setup
Wed, 03/28/2012 - 13:33 — sandip-
munin-node installed via epel repository.
Install perl-Cache-Cache:
# yum install munin-node perl-Cache-Cache
[mysql*]
env.mysqluser munin
env.mysqlpassword {PASS}
mysql> create user munin@localhost identified by '{PASS}';
mysql> GRANT PROCESS, SUPER ON *.* TO 'munin'@'localh ost';
mysql> GRANT SELECT ON `mysql`.* TO 'munin'@'localh ost';
mysql> flush privileges
munin-node-configure --suggest 2>/dev/null |grep mysql
munin-node-configure --shell | grep mysql | sh
# cd /etc/munin/plugins
# munin-run mysql_connections
- sandip's blog
- Login or register to post comments
- Read more
How to install oracle java 7 in ubuntu 12.04
Tue, 03/27/2012 - 09:31 — david23Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.
Plesk courier-imap imapd on port 143 fails
Thu, 02/16/2012 - 20:53 — sandipAfter Plesk upgrade to 9.5.4, imapd on port 143 did not come up.
On checking the maillog, it was complaining about:
imapd: Invalid -maxprocsarg option.
imapd-ssl: Invalid -maxprocsarg option.
I noticed /etc/courier-imap/imapd had both the below lines commented:
#MAXDAEMONS=40
#MAXPERIP=4
Once I uncommented those values, I was able to get the imap listener up upon a `service courier-imap restart`.
Django postgresql connect_timeout via environment variable
Mon, 02/06/2012 - 23:03 — sandipRecently, I've had to move a postgresql database onto a separate server and split it out from the django application server.
On doing so, we saw intermittent "OperationalError: could not connect to server: Connection timed out".
This was quite obvious that the "connect_timeout" had to be increased to resolve the issue due to the latency introduced by the network. However, psycopg2 database adapter was being used which did not support the "connect_timeout" option to be passed via django.
We were able to work around the issue setting the environmental variable "PGCONNECT_TIMEOUT" so libpq would pick up the connection parameter.
Put the below in "django.wsgi":
os.environ['PGCONNECT_TIM EOUT'] = '30'
- sandip's blog
- Login or register to post comments
- Read more
munin-node and postgresql plugins setup
Sun, 02/05/2012 - 19:37 — sandipWhile setting up munin to monitor postgresql, I was getting "[DBD::Pg not found, and cannot do psql yet]" when running `munin-node-configure --suggest | grep postgres`.
I confirmed that the rpm package "perl-DBI-1.52-2.el5" was indeed installed.
However, when I ran a test against the module, it failed with:
# perl -MDBD::Pg -e 1
Can't load '/usr/lib64/perl5/vendor_ perl/5.8.8/x86_64-linux-thread -multi/auto/DBD/Pg/Pg.so' for module DBD::Pg: libpq.so.4: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64- linux-thread-multi/DynaLoader. pm line 230.
at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.
On checking the library, it returned with "libpq.so.4 => not found":
# ldd /usr/lib64/perl5/vendor_perl/5 .8.8/x86_64-linux-thread-multi /auto/DBD/Pg/Pg.so
linux-vdso.so.1 => (0x00007fffb60bb000)
libpq.so.4 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007fa36d2c2000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa36d845000)
Indeed libpq.so.4 was missing since postgresql90-libs was installed which only includes "libpq.so.5".
To get libpq.so.4, "compat-postgresql-libs" package needed to be installed.
Once installed the perl module test passed and I was able to get the munin plugins linked using:
# munin-node-configure --shell | grep postgres | sh
Configuring Bind RNDC
Tue, 12/27/2011 - 22:00 — sandipRNDC is a useful mechanism for administering DNS servers. If it is not configured, BIND complains about it.
Determine the locations where RNDC expects to find the config files.
# rndc status
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
Create the rndc config file:
# rndc-confgen > /etc/rndc.conf
Thy rndc conf file should also have the contents that need to go to "/etc/named.conf". See sample below:
# Use with the following in named.conf, adjusting the allow list as needed:
# key "rndc-key" {
# algorithm hmac-md5;
# secret "aitNuyDz9NkSZ0MbxeQKcQ== ";
# };
#
# controls {
# inet 127.0.0.1 port 953
# allow { 127.0.0.1; } keys { "rndc-key"; };
# };
Once the key and control section has been added to named.conf, restart named and test again with:
# rndc status
- sandip's blog
- Login or register to post comments
- Read more
nginx server status
Wed, 12/14/2011 - 12:53 — sandipThe stub_status module provides the ability to get some stats from nginx...
active connections -- number of all open connections including connections to backends
server accepts handled requests -- nginx accepted connections, handled connections (no one was closed just it was accepted), and handles requests (requests per connection = handles requests / handled connections)
reading -- nginx reads request header
writing -- nginx reads request body, processes request, or writes response to a client
waiting -- keep-alive connections, actually it is (active - reading + writing)
openvz tmpfs and dcachesize
Mon, 12/12/2011 - 16:21 — sandipWhen using tmpfs inside OpenVZ containers, make sure to monitor and increase dcachesize (directory and inode entries) appropriately.
tmpfs mounts can be used to speed up applications doing lots of read/writes to temporary diskspace such a php sessions and mysql tmp directory.
Mount using "/etc/fstab":
tmpfs /dev/shm &nbs p; tmpfs noexec,nosuid,nodev   ; 0 0
tmpfs /var/lib/php/session &nbs p; tmpfs mode=770,gid=48,size=500M,noex ec,nosuid,nodev,noatime & nbsp; 0 0
Note: default folder permission of "/var/lib/php/session" is 770 and set to the apache Group ID.
Active Directory Integration with Centrify DirectControl Express on Ubuntu 11.10 (Oneiric)
Fri, 12/02/2011 - 07:50 — david23Centrify Express is a comprehensive suite of free Active Directory-based integration solutions for authentication, single sign-on, remote access, file-sharing, monitoring The #1 Choice for Active Directory Integration and cloud security for cross-platform systems. It is the quickest and most proven solution for integrating UNIX, Linux and Mac systems with Windows, and delivers more functionality and more to upgrade to when compared to other free offerings.
Flush deferred messages in sendmail queue
Fri, 11/18/2011 - 18:46 — sandipWhenever sendmail has to deliver mails to other hosts which cannot be reached at that time, the messages are kept in the queue. Although the other hosts could be reached again and you want to tell sendmail to flush the mail queue, the command
sendmail -q -v
does not really try to reconnect to these hosts and still assumes that the connection timed out. The reason is that the hoststatus is cached, per default for a period of 30 minutes. Using
sendmail -OTimeout.hoststatus=0m -q -v
you can re-run the mail queue and force sendmail to reconnect to the hosts.