Thursday, November 4, 2010

How To Monitor Mysql using Zenoss

On the Zenoss server ensure your device has the Mysql zenpack

On the mysql server you plan to monitor do the following;

Add a user to Mysql so that zenoss can connect.

mysql -u root -p

grant ALL PRIVILEGES ON *.* TO ‘zenoss’@'yourzenossdomain’ IDENTIFIED BY ‘yourpassword’;

FLUSH PRIVILEGES;

Don’t forget to open port 3306 on the firewall of the Mysql server if necessary.

On the Zenoss server add the mysql user and password to zproperties of the device.

If Mysql version <5> 5

You can test that your monitored server can authenticate from your Zenoss server by

mysql -u zenoss -p -h yourmonitoredserverip


credit to http://www.how-to-linux.com

Friday, October 29, 2010

Downgrade PHP on ubuntu Server

go to /usr/local/sbin

create this script

nano downgrade.sh

enter

#!/bin/bash
# by Ruben Barkow (rubo77) http://www.entikey.z11.de/

# Originally Posted by Bachstelze http://ubuntuforums.org/showthread.php?p=9080474#post9080474
# OK, here's how to do the Apt magic to get PHP packages from the karmic repositories:

echo "Am I root? "
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
echo " NO!

Error: You must be root to run this script.
Enter
sudo su
"
exit 1
fi
echo " OK";


# finish all apt-problems:
apt-get -f install

# remove all your existing PHP packages. You can list them with dpkg -l| grep php
PHPLIST=$(for i in $(dpkg -l | grep php|awk '{ print $2 }' ); do echo $i; done)
echo these pachets will be removed: $PHPLIST
# you need not to purge, if you have upgraded from karmic:
aptitude remove $PHPLIST
# on a fresh install, you need purge:
# aptitude remove --purge $PHPLIST


#Create a file each in /etc/apt/preferences.d like this (call it for example /etc/apt/preferences.d/php5_2);
#
#Package: php5
#Pin: release a=karmic
#Pin-Priority: 991
#
#The big problem is that wildcards don't work, so you will need one such stanza for each PHP package you want to pull from karmic:

echo ''>/etc/apt/preferences.d/php5_2
for i in $PHPLIST ; do echo "Package: $i
Pin: release a=karmic
Pin-Priority: 991
">>/etc/apt/preferences.d/php5_2; done

# duplicate your existing sources.list replacing lucid with karmic and save it in sources.list.d:
#sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list

# better exactly only the needed sources, cause otherwise you can get a cachsize problem:
echo "# needed sources vor php5.2:
deb http://de.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic main restricted

deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic-updates main restricted

deb http://de.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic universe
deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic-updates universe

deb http://de.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

deb http://security.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted
deb http://security.ubuntu.com/ubuntu karmic-security universe
deb-src http://security.ubuntu.com/ubuntu karmic-security universe
deb http://security.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse
" >> /etc/apt/sources.list.d/karmic.list

aptitude update

apache2ctl restart

echo install new from karmic:
aptitude -t karmic install $PHPLIST

# at the end retry the modul libapache2-mod-php5 in case it didn't work the first time:
aptitude -t karmic install libapache2-mod-php5

apache2ctl restart

chmod +x /usr/local/sbin/downgrade.sh
run the script
sh downgrade/sh

wait until it finish
now you done

Tuesday, August 31, 2010

APR-1 Apache upgrade problem

I face a problem when i want to upgrade apache form 2.2.14 to 2.2.16.
When the upgrade is running the running stop at apr-1
than this step save my life.

It wasn't clear to me, but, in the end I uninstalled apr1, and then let the 'apache install' reinstall it. Here's the sequence that worked for me

pkgdb -F;portsclean -CDD;portsnap fetch update
cd /usr/ports/www/apache22
make deinstall clean
portupgrade -f -o devel/apr1 devel/apr
cd /usr/ports/devel/apr1
make deinstall clean
cd /usr/ports/www/apache22
make install clean

Taken from http://forums.freebsd.org/archive/index.php/t-14338.html

Thursday, August 19, 2010

Portupgrade

I learn something new from my sifoo

try to run portupgrade :

portupgrade /var/db/pkg/namepackage

make fetch-recursive-list

Thursday, July 22, 2010

Mysql Replication

Follow this step to create / install a replication DB for mysql

http://www.howtoforge.com/mysql_database_replication

if uo have an error after / fini9sh installation using thie replication try this :

error 1 =

>LOAD DATA FROM MASTER;
Query OK, 0 rows affected, 1 warning (0.12 sec)
>

try to run this :

mysql> GRANT RELOAD on *.* to repl@'%' identified by 'your_password';
OR
mysql> GRANT SUPER on *.* to repl@'%' identified by 'your_password';



Reference : http://www.linuxismybff.com/howto/mysql/mysql-basic-replication-setup/

if you still have this warning error try to run this :

mysql -u root -p
Enter password:
SLAVE STOP;

CHANGE MASTER TO MASTER_HOST='192.168.0.100', MASTER_USER='slave_user', MASTER_PASSWORD='
', MASTER_LOG_FILE='mysql-bin.006', MASTER_LOG_POS=183;

START SLAVE;
quit;