Powering on VMware virtual fails “a general system error occurred: unknown error”

Tried to power on a virtual in vsphere and received a generic error: a general system error occurred: unknown error.
Turns out a log file had grown too large in the ‘/’ folder.
Thanks to this post, I was able to figure it out quickly. Here’s some more information on this topic.

Posted in Uncategorized | Leave a comment

Installing DBD

Trying to install DBD::mysql from CPAN and the install failed,
here are the steps I follow:

cpan> install DBI

Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
/usr/bin/make install — OK

cpan> install DBD::mysql

Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 83.
Make had some problems, maybe interrupted? Won’t install

cpan> quit
# cd /root/.cpan/build/DBD-mysql-4.022/
# perl Makefile.PL
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 83.
# yum install mysql
# perl Makefile.PL

Writing Makefile for DBD::mysql
Writing MYMETA.yml and MYMETA.json
# make

error: mysql.h: No such file or directory

dbdimp.c:5144: warning: assignment makes integer from pointer without a cast
make: *** [dbdimp.o] Error 1

The solution is to install mysql-devel
# yum install mysql-devel

Then DBD-mysql-4.022 was able to make && make install.

Posted in Uncategorized | 1 Comment

installing php errors

On CentOS 5.8 while installing php 5.4.6:
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing
yum install libc-client-devel
http://cpanelforums.net/php-recompilation-errors/

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
yum install libmcrypt-devel

configure: error: Cannot find libtidy
yum install libtidy libtidy-devel

Posted in Uncategorized | Leave a comment

SOLVED: passwd: Authentication token manipulation error

I was migrating a server and rather than add all the users one by one, just copied over /etc/passwd and /etc/group. I totally forgot to get /etc/shadow and when I tried to change a user’s password, I got the error:
passwd: Authentication token manipulation error

To quickly correct this, I was able to run:
/usr/sbin/pwconv
and the /etc/shadow file was created correctly, now I can change user passwords as usual.

Posted in Uncategorized | Leave a comment

Trouble starting MySQL on CentOS: Can’t find file: ‘./mysql/plugin.frm’ (errno: 13)

While trying to set up a new MySQL slave on Centos 5, i copied over the /var/lib/mysql directory and made necessary updates but Mysql would not start, in /var/log/mysql.log there was this

120910 13:40:00 mysqld_safe mysqld from pid file /var/lib/mysql/omni1.omniweb.com.pid ended
120910 13:42:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120910 13:42:08 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
120910 13:42:08 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
120910 13:42:08 [ERROR] Falcon: can't open file "/var/lib/mysql/falcon_master.fts": Permission denied (13)
120910 13:42:08 [ERROR] Plugin 'Falcon' init function returned error.
120910 13:42:08 [ERROR] Plugin 'Falcon' registration as a STORAGE ENGINE failed.
120910 13:42:08 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

This particular error /usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) led me to a lot of posts about apparmor, i shut off iptables but the winner was SELINUX.
setenforce 0
then mysql started right up!
shut it off for good,

Posted in Uncategorized | Leave a comment

Automated MegaRaid monitoring on ESXi 5

I have a couple of MegaRaid controllers (Intel RS2BL040 & LSI 9260-4i)
I’m not thrilled with the monitoring software so I wrote this script to email me in the event of a raid problem:
There are a couple other pieces but this is the meat of it;
Runs from crontab every 5 minutes, named “process.pl”

#!/usr/bin/perl

use strict;
use warnings;

use MIME::Lite::TT;

# Process the current log file in

my $logs_dir = '/home/megaraid/logs/';

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);

$year += 1900;
$mon = sprintf('%.2d',$mon+1);
$mday = sprintf('%.2d',$mday);
$hour = sprintf('%.2d',$hour);

while ( $min % 5 ) {
$min--;
}
$min = sprintf('%.2d',$min);

#print "year: $year Month: $mon Day $mday hour $hour : $min \n";

my $filename = $year.$mon.$mday.$hour.$min.'.txt';

print "Getting filename $filename \n";

my $text_file = '/home/megaraid/logs/'.$filename;

my @cmd = ( 'scp root@192.168.0.175:/tmp/megaraid/'.$filename.' /home/megaraid/logs/' );

system( @cmd );

unless ( -f '/home/megaraid/logs/'.$filename ) { die ( $filename . " could not be retrieved, exiting now.\n\n" ); }

print "Successfully retrieved, now processing $text_file \n...\n";

my $capture;
my $counter = 0;
my %alerts;
my $line;
my %params;
my %options;
$options{INCLUDE_PATH} = '/home/megaraid';
$options{anything} = 'nothing';

open ( TXT, $text_file ) || die "Couldn't open Text file $text_file!\n";

while ($line = ) {

if ( $line =~ m/Device Present/gi ) { #We want the next 5 lines, start capture

$counter++;

}

if ( $counter > 0 && $counter < 11 ) { $capture .= $line; $counter++; if ( $line =~ m/Degraded\s*:\s(\d+)\s/ && $1 > 0 ) {
print "Degraded: $1 \n";
$alerts{'degraded'} = $1;
}

if ( $line =~ m/Offline\s*:\s(\d+)\s/ && $1 > 0 ) {
print "Offline: $1 \n";
$alerts{'offline'} = $1;
}

if ( $line =~ m/Critical Disks\s*:\s(\d+)\s/ && $1 > 0 ) {
print "Critical: $1 \n";
$alerts{'critical'} = $1;
}

if ( $line =~ m/Failed Disks\s*:\s(\d+)\s/ && $1 > 0 ) {
print "Failed: $1 \n";
$alerts{'failed'} = $1;
}

} # End of 10 rows we need to look at (physical drive status)

}

close( TXT );

print $capture . "\n";

my $alert_file = '/home/megaraid/status.txt';
my $alert_text = "";

if ( (scalar keys %alerts) > 0 ){

print "ALERTS! \n Check alert file and possibly send email if new alert status.\n";
foreach my $alert ( keys %alerts ) {

my $val = $alerts{ $alert };
print "$alert => $val\n";

$alert_text = "$alert $val\n";
open ( ALERT, "$alert_file" );

$counter = 0;

while ($line = ) {
if ( $line eq $alert_text ) {
print "found match $line $alert_text \n";
$counter++;
}
}

close ( ALERT );

if ( $counter == 0 ) {

print "THIS IS A NEW ALERT, send email $alert_text \n";
open ( ALERT, ">>$alert_file" );
print ALERT $alert_text;
close ( ALERT );

$params{'first_name'} = "Bob";
$params{'alert_text'} = $alert_text;

my $msg = MIME::Lite::TT->new(
From => 'ESXI@omniweb.com',
To => 'ESXI@omniweb.com,my_cell_number',
Subject => 'RAID Alert',
Template => 'email.txt.tt',
TmplOptions => \%options,
TmplParams => \%params,
);

$msg->send;

}

}

} else {

# check if there were previous alerts, notify when cleared
open ( ALERT, "$alert_file" );

$counter = 0;
while ($line = ) {
if ( $line ne "Good" ) {
print "Status was $line now Good\n";
$alert_text .= "Status was $line now Good\n";
$counter++;
}
}
close ( ALERT );
if ( $counter > 0 ){
open ( ALERT, ">$alert_file" );
print ALERT "Good";
close ( ALERT );
print "Email $alert_text \n";

$params{alert_text} = $alert_text;
my $msg = MIME::Lite::TT->new(
From => 'ESXI@omniweb.com',
To => 'ESXI@omniweb.com,my_cell_number',
Subject => 'RAID Good',
Template => 'email.txt.tt',
TmplOptions => \%options,
TmplParams => \%params,
);

$msg->send;

}
}

exit();

Leave a comment if you want details on how to get the rest of it working. Or if there is a better way to do it, please let me know!

Posted in Uncategorized | 2 Comments

SOLVED: Trouble installing SGMLS on Centos 5

cpan> install SGMLS

Package comes with a Makefile and without a Makefile.PL.
We’ll try to build it with that Makefile then.

CPAN.pm: Going to build D/DM/DMEGG/SGMLSpm-1.03ii.tar.gz

cd DOC; make all
make[1]: Entering directory `/root/.cpan/build/SGMLSpm/DOC’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/root/.cpan/build/SGMLSpm/DOC’
/usr/bin/make — OK
Running make test
make: *** No rule to make target `test’. Stop.
/usr/bin/make test — NOT OK
Running make install
make test had returned bad status, won’t install without force

here i found the clues to fix this:

cd /usr/local/lib/perl5/site_perl/5.8.8
mkdir SGMLS
cd SGMLS/
ln -s /usr/local/lib/perl5/SGMLS/Output.pm
ln -s /usr/local/lib/perl5/SGMLS/Refs.pm
ln -s /usr/local/lib/perl5/SGMLS.pm ../

cpan> install SGMLS
SGMLS is up to date.

Posted in Uncategorized | Leave a comment

phpMyAdmin Error #2000 Cannot log in to the MySQL Server

after some upgrades, phpMyAdmin will no longer log in;
#2000 Cannot log in to the MySQL Server

to fix this I had to update the passwords to the longer version
UPDATE user set Password = PASSWORD(‘my_password’) where User=’root’ and Host=’127.0.0.1′;

and make sure to have “old_passwords=1” in my.cnf

restart mysql: /etc/init.d/mysqld restart

Posted in Uncategorized | 2 Comments

configure: error: … Error, SSL/TLS libraries were missing or unusable

http://www.webmasterworld.com/apache/4434505.htm

env LDFLAGS=”-ldl” ./configure –with-ssl=/usr/local/ssl –enable-ssl –enable-modules=”all” –enable-mods-shared=”most”

Posted in Uncategorized | Leave a comment

Resolved 3ware UNSUPP DCB

Replaced a drive in a 3ware raid and on 3dm2 i saw the message “UNSUPP DCB”
This can happen with drives that were used in another RAID.
To fx this i selected the drive (on maintenance page) remove drive, rescan controller, problem solved.

UPDATE: Out of 2 drives that produced this error on insertion, only one was fixed with the above method. The other continues to return the same error, I will need to take it out and wipe the partition table or something…

Posted in Uncategorized | 19 Comments