Page 1 of 1

problem executing zmfilter.pl

Posted: Tue Aug 22, 2006 7:04 am
by yakermalo
Hello, yesterday I noticed, that my filter purgewhenfull doesn't works.
I have a problem executing zmfilter.pll that returns me the next information

DBD::mysql::db prepare_cached warning: at ./zmfilter.pl line 512.
Can't prepare 'select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.Def aultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time ,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.V ideoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Mo nitors as M on M.Id = E.MonitorId where not isnull(E.EndTime) and ( 73 >= 67% ) order by E.StartTime asc limit 0, 1000': at /usr/lib/perl5/site_perl/5.8.7/Zone Minder/Debug.pm line 321
ZoneMinder::Debug::Fatal('Can\'t prepare \'select E.Id,E.MonitorId,M.Nam e as MonitorNam...') called at ./zmfilter.pl line 512
main::checkFilter('HASH(0x8727368)') called at ./zmfilter.pl line 181


Could you say me, where is the problem here, i think that could be something about perl modules.

REGARDS

Posted: Tue Aug 22, 2006 1:38 pm
by zoneminder
It doesn't actually say what the error is unfortunately. Can you confirm that the space in the folloiwng section
E inner join Mo nitors as M
between the 'o' and 'n' is from your posting and not the error as there should not be one there.

Posted: Wed Aug 23, 2006 11:29 am
by yakermalo
No, the espace between o and n is not a real space i'have copied and pasted, it's only for this cause.

So you don't know whast the possible cause? could be the perl modules? i think that it had been compiled specially for the machine that runs ZM.........

Posted: Wed Aug 23, 2006 3:30 pm
by zoneminder
I would try a couple of things. One try executing the sql statement that is output in the error directly in the mysql command line client to check that the syntax is ok. Then just create a simple perl script with a few simple sql statements in to check that the perl database modules work properly.

Something like

Code: Select all

#!/usr/bin/perl -w 

use ZoneMinder;

my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );

my $sql = "select * from Monitors";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
while( my $monitor = $sth->fetchrow_hashref() )
{
     print( $monitor->{Name}."\n" );
}
though this is just from memory and not tested :?

Posted: Thu Aug 24, 2006 10:35 am
by yakermalo
thanks, about the information, the problem was the percent symbol.......... :x

now we have a segmentation fault with ZMaudit, we are investigating about the cause of


Thanks a lot

the problem was fixed

Posted: Fri Aug 25, 2006 8:32 am
by yakermalo
Hi again, the problem, was fixed updating perl modules, there was a conflict with the libraries.

ZM is running well

THANKS a Lot :) :)