Monitor Functions

Support and queries relating to all previous versions of ZoneMinder
Locked
rodj59
Posts: 18
Joined: Sat Apr 15, 2006 9:57 am

Monitor Functions

Post by rodj59 »

An old problem I had in changing the Function of a Monitor to something other than None (eg. Mocord, Modect etc.) is still occurring in latest release. The problem seems to be that the output of the call to foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function )
line 516 in zm_html_view_monitor.php is producing names with trailiing backslashes eg Mocord\ , Modect\ etc.

Changing this to a simple array constant seems to fix the problem but why is it occurring in the first place ? The contents of the DB don't have trailing backslashes.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Which version of php and mysql do you have?
Phil
rodj59
Posts: 18
Joined: Sat Apr 15, 2006 9:57 am

Monitor Functions

Post by rodj59 »

I believe it is version 5.024a. I have the same problem with an older version too. I compiled the 5.024 from sources.

Seems the php function preg_match_all() in getEnumValues() is given strings containing backslashes before the quotes. You can fix it by stripping the backslashes out of $enum_values. I don't know why they are there however. Might be something to do with php configuration?
rodj59
Posts: 18
Joined: Sat Apr 15, 2006 9:57 am

Monitor Functions

Post by rodj59 »

Haven't had time to test it but looks like magic_quotes_runtime=On in php.ini is the problem. Unless you can override this setting at runtime eg. init_set(magic_quotes_runtime,0) without affecting other applications perhaps changing getEnumValues() is desirable.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Yes, that may be it. Magic quotes are nearly always off nowadays so there's not many systems where this might happen, I think you must be the first!

Although I think you can override it with ini_set I think it's probably easier just to put

Code: Select all

php_value magic_quotes_gpc "Off"
in .htaccess in your zm dir. You will need to check that your apache is set up to allow htaccess files to override this setting as well of course.
Phil
rodj59
Posts: 18
Joined: Sat Apr 15, 2006 9:57 am

Monitor Functions

Post by rodj59 »

Sounds good. I gave up on this system the first time I looked at it & that was all that was wrong. Limitations with Motion led to my having another go.
Don't suppose anyone can tell me where to get the X10 components from?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Do you mean the perl module or the actual hardware? If the latter, where are you based?
Phil
rodj59
Posts: 18
Joined: Sat Apr 15, 2006 9:57 am

Monitor Functions

Post by rodj59 »

I'm after the X10::ActiveHome I think. Whatever is needed to get ZM to build with X10 enabled.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

You do not need to rebuild ZM for X10 support. You will need to install the perl module and switch on X10 in the options, then restart. Installing the perl module is covered in the README amongst other places but in summary, do

Code: Select all

perl -MCPAN -eshell
install X10:ActiveHome
quit
Phil
rodj59
Posts: 18
Joined: Sat Apr 15, 2006 9:57 am

Monitor Functions

Post by rodj59 »

Thanks, but this method of accessing cpan doesn't usually work for me.
--------------------------------------------------
eg.
Trying with "/usr/bin/lynx -source" to get
http://cpan.mirrors.ilisys.com.au/modul ... st.data.gz
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Warning: Cannot install X10:ActiveHome, don't know what it is.
Try the command

i /X10:ActiveHome/

to find objects with matching identifiers.
----------------------------------------------------

I think the url is http://search.cpan.org/src/ROBF/X10-0.0 ... iveHome.pm ?

Never mind, got it: but what about version 10-0.05 ?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think I have missed out a colon :oops:

Try X10::ActiveHome instead.
Phil
Locked