Sunday, 21 December 2008
Mytharchive: cannot burn a dvd
Anyway, after recording a few programs I wanted to burn a DVD. My first attempt failed because Mytharchive tries writing to /dev/dvd by default. I solved this problem by linking /dev/dvd to my DVD device.
Tried again and Mytharchive refused to enter the burn DVD menu, showing the error below:
Mytharchive: cannot burn a dvd, the last run failed to create a dvd
WTF? A bit harsh on the error flagging, I'd say. So after searching around I found some people with the same problem but none of the helpful people would tell how to clear the error. Here's what you do.
1. Quit mythfrontend
2. Open a command prompt and:
mysql -u root
use mythconverg;
update settings set data='' where value='MythArchiveLastRunStatus';
update settings set data='' where value='MythArchiveLastRunType';
3. Go back to mytharchive and try again. This time it will let you proceed to the DVD burn menus.
Thursday, 11 December 2008
How to avoid overlapping rsync instances
To avoid multiple instances getting in each other's way there's a simple solution using flock. Example without lock (may cause overlapping instances):
*/5 * * * * /usr/bin/rsync --delete -a source_server:/source/path/ /dst/path/Example using flock:
*/5 * * * * flock -xn /tmp/example.lock -c '/usr/bin/rsync --delete -a source_server:/source/path/ /dst/path/'In the second example, if a rsync instance runs for more than 5 minutes, flock will fail and thus not execute a second rsync process.
This can be used for pretty much any shell problem where locking helps. Have a read on the flock man page for other examples.
Wednesday, 25 June 2008
Thursday, 5 June 2008
IIS asp.net v2.0 fake 403 and 404 errors
The website declined to show this webpageNow, there are a few causes to this problem. The most common is when the user forgets to add an index page to the site or, to add the index page to the list of "Enable default content page" under IIS.
Mr. Ian Tinsley found a more sinister cause that has the following symptom: if you browse to an existing .aspx file, ISS will return a 404 error code, even though the file exists. A good way to check if this is your case is to place a static file (htm or gif etc) in your site and try browsing it; if it shows you the static file then you probably have a fake 403/404 scenario.
To make sure, go to Web Service Extensions under IIS and check if ASP.NET v2.x is listed:
The tricky bit is: even if ASP.NET v2.x is not listed above, the v2.x extension still shows on the application properties. So if you don't have it above, you need to run aspnet_regiis.exe:
Running with -ir will help keep your asp.net v1.1 stuff running and still install v2:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -ir
Saturday, 3 May 2008
Sun x4450
Well, long story made short: I've ditched Solaris 10 x86_64 in favour of Red Hat Enterprise 5.1. Why? For one thing the Solaris 10 installation was frustratingly complicated.
Performing an installation via serial console requires you to redirect output from the BNC to the System in the BIOS settings. Then the manual states you should choose grub menu's option "ttb". Of course the manual meant "ttyb". But it is actually a typo AND an error: you must choose ttya or all you'll see after boot is "Sun Solaris 5.10" and nothing else.

Once the serial console installation is finished and the system reboots you have another obstacle. The boot process stops at this error message:
Bad PBR sigGoogling around (Sun's KB was useless) I found someone with the same problem reporting that a GUI installation didn't show that error. Very well, I configured the firewall to allow Sun's network KVM:
Reboot and Select proper Boot device or
Insert Boot Media in selected Boot device and press a key
8890 TCP Remote Console
9000 TCP Remote Console
9001 TCP Remote Console
9002 TCP Remote Console
9003 TCP Remote Console
69 UDP TFTP (for firmware upgrades)
161 UDP SNMP (for monitoring)
As the anonymous poster reported, this did solve the problem. Now to install postgres for x86_64. Hmm. Doesn't run - complains about missing libraries. Probably just need to run crle to set-up the location of the 64bit libraries. Where are they, where are they... WTF? There are no x86_64 libraries installed in my Solaris 10 for x86_64. I check around with `file' and yeah: all bloody system libraries are 32 bits.
I confess I didn't try too hard after this. A day later and we had postgres running on RHEL 5.1. And yes, with a 64bit binary and libraries.
To Sun's credit, the hardware looks a beauty, even though you have to assemble the whole thing by yourself: memory cards, SAS card, Fibre Channel card, hard disks and whatever extras you bought. What a pain in the arse. Compared to the other Dell servers with pre-installed RHEL 5.1 we recently bought the Sun experience is pathetic: the Dells where up on the same day versus 1 week for Sun.
Friday, 18 April 2008
Nagios checks for LSI RAID with MegaCli
Here's what you need:
- perl interpreter in /usr/bin/perl
- nagios' utils.pm in /usr/local/nagios/libexec/
- perl module Time::HiRes (cpan; install Time::HiRes)
- sudo in /usr/bin/
- MegaCli in /opt/MegaRAID/MegaCli/MegaCli64
#!/usr/bin/perl -wT
#
# CHECK DELL/MegaRAID DISK ARRAYS ON LINUX
# $Id: check_dellperc 142 2008-03-17 22:25:46Z thiago $
#
BEGIN {
$ENV{'PATH'} = '/usr/bin';
$ENV{'ENV'} = '';
$ENV{'BASH_ENV'} = '';
$ENV{'IFS'} = ' ' if ( defined($ENV{'IFS'}) ) ;
}
use strict;
use lib "/usr/local/nagios/libexec";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
use Getopt::Long;
use Time::HiRes qw ( tv_interval gettimeofday );
use vars qw($opt_h $help $opt_V $version);
use vars qw($PROGNAME $SUDO $MEGACLI);
$PROGNAME = "check_dellperc";
$SUDO = "/usr/bin/sudo";
$MEGACLI = "/opt/MegaRAID/MegaCli/MegaCli64";
my $t_start = [gettimeofday];
Getopt::Long::Configure('bundling');
GetOptions
("V" => \$opt_V, "version" => \$opt_V,
"h" => \$opt_h, "help" => \$opt_h,
);
if ( $opt_V ) { print_revision($PROGNAME, '$Id: check_dellperc 142 2008-03-17 22:25:46Z thiago $');
exit $ERRORS{'OK'};
} elsif ( $opt_h ) {
print_help();
exit $ERRORS{'OK'};
}
my $TIMEOUT = $utils::TIMEOUT;
my $start_time = time();
# TODO: add timeout option#if ( $opt_t && $opt_t =~ /^([0-9]+)$/ ) {
# $TIMEOUT = $1;
#}
# Check state of Logical Devices
my $status = "PERC OK";
my $perfdata = "";
my $errors = $ERRORS{'OK'};
my $vd = "";
my $vds = "";
open(MROUT, "$SUDO $MEGACLI -LDInfo -Lall -aALL -NoLog|");
if (!<MROUT>) {
print("Can't run $MEGACLI\n");
exit $ERRORS{'UNKNOWN'};
}
while (<MROUT>) {
my $line = $_;
chomp($line);
if ($line =~ /^Virtual Disk: (\d+)/) {
$vd = $1;
next;
}
if ($vd =~ /^[0-9]+$/) {
if ($line =~ /^State: (\w+)/) {
$vds = $1; #TODO: verbose print("State for VD #$vd is $vds\n");
$perfdata = $perfdata." VD$vd=$vds";
if ($vds !~ /^Optimal$/) {
$errors = $ERRORS{'CRITICAL'};
$status = "RAID ERROR";
#TODO: verbose print("Error found: $status. Skipping remaining Virtual Drive tests.\n");
last;
} else {
$vd = ""; $vds = "";
}
}
}
}
close(MROUT);
# Check state of Physical Drives
my $count_type;my $pd = "";
my $pds = "";
open(MROUT, "$SUDO $MEGACLI -PDList -aALL -NoLog|");
if (!<MROUT>) {
print("Can't run $MEGACLI\n");
exit $ERRORS{'UNKNOWN'};
}
while (<MROUT>) {
my $line = $_;
chomp($line);
if ($line =~ /^Device Id: (\d+)/) {
$pd = $1;
next;
}
if ($pd =~ /^[0-9]+$/) {
if ($line =~ /^(Media Error|Other Error|Predictive Failure) Count: (\w+)/) {
$count_type = $1;
$pds = $2; #TODO: verbose print("$count_type count for device id #$pd is $pds\n");
$perfdata = $perfdata." PD$pd=$count_type;$pds";
if ($pds != 0) {
if ($errors == $ERRORS{'OK'}) {
$status = "DISK ERROR";
$errors = $ERRORS{'WARNING'};
}
}
}
}
}
close(MROUT);
# Got here OK
#
my $t_end = [gettimeofday];
print "$status| time=" . (tv_interval $t_start, $t_end) . "$perfdata\n";
exit $errors;
sub print_usage
{
print "Usage: $PROGNAME\n";
}
sub print_help
{
print_revision($PROGNAME, '$Revision: 142 $ ');
print "Copyright (C) 2007 Westfield Ltd\n\n";
print "Check Dell/MegaRaid Disk Array plugin for Nagios\n\n";
print_usage();
print <<USAGE
-V, --version
Print program version information
-h, --help
This help screen
Example:
$PROGNAME
USAGE
;
}
After installing the script above and changing the paths to match your system, edit your sudoers file (sudo /usr/sbin/visudo) and comment the following line:
# Defaults requiretty
If you are doing NRPE checks, the line above will prevent the script from running sudo because there is no TTY associated with it. There is probably a way around it that doesn't involve disabling this security feature - if you find out please tell me.
While in the sudoers file, also add the following two lines:
nagios ALL=(ALL) NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog
nagios ALL=(ALL) NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL –NoLog
If you run NRPE with a user different than "nagios", change the lines above to match it.
That is it, basically. Before adding it to your NRPE checks, give it a try:
PERC OK| time=0.189185 VD0=Optimal VD1=Optimal PD0=Media Error;0 PD0=Other Error;0 PD0=Predictive Failure;0 PD1=Media Error;0 PD1=Other Error;0 PD1=Predictive Failure;0 PD2=Media Error;0 PD2=Other Error;0 PD2=Predictive Failure;0 PD3=Media Error;0 PD3=Other Error;0 PD3=Predictive Failure;0 PD4=Media Error;0 PD4=Other Error;0 PD4=Predictive Failure;0 PD5=Media Error;0 PD5=Other Error;0 PD5=Predictive Failure;0
It should return a status of zero (unless, of course, your RAID is b0rken):
$ echo $?
0
Monday, 14 April 2008
It is not a toy
Thursday, 31 January 2008
Teamsite 6.7.1 SP1 won't start
[crit] file vhost.c, line 190, assertion "rv == APR_SUCCESS" failed Abort - core dumped /app/teamsite/iw-home/iw-webd/bin/iw.webd start: iwwebd could not be started
In my case, adding "dns" to the "hosts:" line on /etc/nsswitch.conf solved the problem:
hosts: files dns
A little bee tells me that you can also edit /iw-webd/conf/iwwebd.conf.template and change "_default_" on the VirtualHost entry to "*":
<VirtualHost _default_:__IWWEBD_HTTPS_PORT__>
to
<VirtualHost *:__IWWEBD_HTTPS_PORT__>
I didn't try it but that's also the recommendation from an Interwoven's KB article (support account needed).
TCP wrappers: refused connect from ...
- Get the service running on the new box
- Point the DNS entry (or IP address of the server on clients) to the new server
- Stop the service on the old box
- Enable the redirection using inetd
http stream tcp nowait nobody /usr/bin/tcpd /usr/bin/netcat new-server 80
You then leave the old server running until no more clients connect to it. I do that by inspecting the syslog entries and looking for the netcat redirections. Last time, however, I was seeing these:
Jan 30 14:20:04 old-box netcat[16769]: [ID 947420 mail.warning] refused connect from 189.201.77.65
And sure enough, I started to get complaints that some clients were no longer able to connect to the service. I had left /etc/hosts.allow empty on purpose since there was no need to restrict the service to specific hosts.
After some digging through the tcp wrappers readme, I suspected that the version of tcpd on this SunOS 5.8 (Solaris 8) had been compiled with -DPARANOID. If defined, PARANOID will cause tcpd to reject hosts whose IP address don't resolve to a name (using reverse DNS).
I downloaded the tcp_wrappers source, recompiled without -DPARANOID and installed the newly compiled binary. The refused connection entries were gone from the log and the clients confirmed they were able to reach the server once again.
Wednesday, 9 January 2008
MSMQ error:0xc00e0027
I had to re-create my queues too, since they were wiped-out when I removed the component.
Tuesday, 8 January 2008
VMWare Workstation on Debian AMD64
However the application would not open any VMs, spitting this error:
/usr/lib/vmware/bin/vmware-vmx: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directoryTurns out some of the VMWare binaries need 32bit libraries, even on the 64bit version. This post on vmware's knowledge base gave a solution for Red Hat distros. On Debian the solution is analogous: you just need to install the package ia32-libs.
You will need to re-install VMWare so that it regenerates the vmmon kernel module. The vmware-any-any patch is not needed.
Monday, 7 January 2008
Broadcom 4311 on Linux
Because of the efforts of the ndiswrapper and bcm43xx developers I managed to use the wi-fi card until I started using the AMD64 binaries for Debian Etch.
If you are buying a notebook and plan to use Linux in it, stay away from the Broadcom wireless cards or any other cards that require loading a firmware at run-time.
I got tired of struggling and I'm now waiting for my Intel 2915ABG mini-pci card to arrive in the mail. Hardware is too cheap nowadays to justify wasting my time getting a vendor to work.
Monday, 26 November 2007
Checking your round-robin DNS with nagios
$ ./check_dns -H example.com.au -a 1.2.3.4If your host name has more than one IP address associated with it - no problem -, just add it to the command line. For example:
DNS OK: 0.157 seconds response time. example.com.au returns 1.2.3.4|time=0.157327s;;;0.000000
./check_dns -H example.com.au -a 1.2.3.4,9.8.7.6However, if your host name is using a round-robin DNS configuration you can't predict the response reliably. Try google.com.au, for instance.
DNS OK: 0.157 seconds response time. example.com.au returns 1.2.3.4,9.8.7.6|time=0.157327s;;;0.000000
$ dig google.com.au
;; ANSWER SECTION:
google.com.au. 230 IN A 72.14.235.104
google.com.au. 230 IN A 72.14.207.104
google.com.au. 230 IN A 72.14.203.104
Then check_dns will only work 1/3 of the time:
./check_dns -H google.com.au -a 72.14.235.104,72.14.207.104,72.14.203.104The other 2/3 you will see:
DNS OK: 0.035 seconds response time. google.com.au returns 72.14.235.104,72.14.207.104,72.14.203.104|time=0.035388s;;;0.000000
$ ./check_dns -H google.com.au -a 72.14.235.104,72.14.207.104,72.14.203.104I thought that really sucked because it stopped me from using this very nice feature of check_dns. So I patched check_dns.c in Nagios Plugins 1.4.10 to include the command line option "-o". When you specify this option, check_dns will sort the DNS response so you can still use -a.
DNS CRITICAL - expected '72.14.235.104,72.14.207.104,72.14.203.104' but got '72.14.203.104,72.14.235.104,72.14.207.104'
$ ./check_dns -H google.com.au -o -a 72.14.203.104,72.14.207.104,72.14.235.104I've sent the patch to the Nagios developers list - hopefully it will get incorporated into future releases. If not, you can download the patch here and the patched source here.
DNS OK: 0.112 seconds response time. google.com.au returns 72.14.203.104,72.14.207.104,72.14.235.104|time=0.111538s;;;0.000000
Sunday, 25 November 2007
Wednesday, 21 November 2007
"Bad user" on Solaris 10 crontab
! bad user (wondapp) Tue Nov 13 03:23:00 2007
I checked /etc/cron.allow (which didn't exist) and the user's shell in /etc/passwd but the problem turned out to be in /etc/shadow. The user was listed as:wondapp:*LK*:::::::
This was because a password was never set for it. I just edited it to read:
wondapp:NP:::::::
Which still doesn't make a valid password but doesn't lock-out the account either. Cron jobs for wondapp work now.
Monday, 12 November 2007
Nagios check_http SSL check
I've altered the source code so that it prints the expiry date in human readable format.
The changes were made to file plugins_sslutils.c. You can download a patch for version 1.4.10 here. Or just download the changed file; it might work for other versions too.
Friday, 12 October 2007
Wednesday, 26 September 2007
Mongrel on Solaris 10, no C compiler
/opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:It took me a while to figure-out what was wrong because `gem install mongrel' shows a false success message:
in `require__': no such file to load -- http11 (LoadError)
Successfully installed mongrel, version 1.0.1
Searching around, some threads pointed to a problem with rbconfig.rb, but this was not my problem; there was a library missing:
# ls -alThis box doesn't have make, a C compiler or other build tools so, obviously, the installation wasn't able to create http11.so. I just wish it had failed instead of giving me false hope.
/opt/coolstack/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/http11.so
/opt/coolstack/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/http11.so: No such file or directory
I got around it by building it on another machine with the same architecture (sparc, in my case) and compiling tools:
- Copy to your build host the directory /opt/coolstack/lib/ruby/gems/1.8/gems/mongrel-1.0.1/ext/http11
- To the same destination, copy /opt/coolstack/lib/ruby/1.8/sparc-solaris2.10/*.h and /opt/coolstack/lib/libruby.so
- On the build host, under the http11 directory, run `make'.
- You should now have a http11.so on the build host. Copy it to the original machine under /opt/coolstack/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib
This guy has a neat guide to installing Mongrel on a shared host. It may also help you. G'luck.
Friday, 7 September 2007
Foundry: the unhelpful company
This is what you get from Foundry if you, like me, try to quickly study their equipment in order to do some network planning:
Thank you for registering for the Foundry KP. Unfortunately we are unable to complete your registration at this time. A valid support contract is required to access this valuable tool and our records indicate that your contract has expired. If this is a mistake please notify us as soon as possible to have the issue corrected.That translates to: give us more money or else we don't really care about you - we're just saying that because it sounds nice.
We value you as a customer and as such we will notify your local account team and they will be contacting you shortly regarding obtaining a new support contract for your systems.
In time: my company does own Foundry appliances. Even if I knew where to get all the information they are requesting me, you still have to wait up to 48 hours for an account. In this day and age it is absolutely pathetic.
[UPDATE 10h53]: even if a company is unhelpful I'm glad to see there are helpful people within it. David White, systems engineering manager, was kind enough to send me the manual I needed. Thanks.
Wednesday, 29 August 2007
CruiseControl as a windows service
To enable it just edit the existing wrapper.conf in your CruiseControl install directory (C:\Program Files\CruiseControl\wrapper.conf) and add the following lines just below the similar ones:
wrapper.app.parameter.6=
wrapper.app.parameter.7=8080
wrapper.app.parameter.8=
wrapper.app.parameter.9=1099

