Zoneminder 1.37 no image – capturing but not analyzing

Zoneminder version 1.37.28. The installation had been running for years without problem but somehwere in the 1.37 version problems started to occur. Some cameras did not give visible streams in Zoneminder from time to time. Checking the cameras video directly, they where ok, so the problem was in Zoneminder. Some cameras was “capturing” but analyzing 0 fps.

In the log there was lines like:

Restarting capture daemon for 6 CAMERA NAME, no image since startup. Startup time was 1671521356 – now 1671521366 > 5

And mostly interesting:

You have set the max video packets in the queue to 100. The queue is full. Either Analysis is not keeping up or your camera’s keyframe interval 50 is larger than this setting.

The reason for this is that the buffer setting for Maximum Image Buffer size (frames) is too low compared to the key frame interval setting in the camera. The higher key frame interval (which means lower bandwidth) means Image Buffer Size must be higher, consuming more RAM. So what you save in bandwidth, you will pay in RAM. Key frame interval is how often the camera sends a full image and between them just the difference. More seldom (higher key frame interval) means lower bandwidth but you need a bigger buffer in the server.

I set my cameras to deliver 5 fps with a key frame interval of 5 as they are on a remote location (not where the server is) and all video is streamed over the Internet to the server.

I changed the options for each camera, Console -> click on source -> Buffers and change Image Buffer Size (frames) (in my case set it to 3) and Maximum Image Buffer Size (frames) (in my case I could actually decrease it from 100 to just 55 because I reduced the fps and decreased the key frame interval in the camera).

Observe how memory is used after this. You need to balance the buffer sizes the cameras fps and key frame interval

Still it did not completely solve the problem. Only after changing Options -> System -> WATCH_MAX_DELAY from 5 to 45 and restart Zoneminder, the system started to show images for all feeds. It seems like 5 seconds for the capture to start was to little so it keept restarting the capture processes.

/tmp

As a part of the investigation I had also changed /tmp into tmpfs according to some post I found online, so I did that also but it did not solve the problem. However, it improved performance so I let it be. Add the following line to /etc/fstab and reboot:

tmpfs /tmp tmpfs rw,nosuid,nodev

Disable unused cameras

Another important thing when it comes to Zoneminder performance is to disable unused cameras. You can leave the camera in the Zoneminder configuration for later use but if it is going to be offline for a longer period, it is a good idea to disable it because a camera that is offline will put unecessary load on the Zoneminder server.

Go to Console -> click on source -> Source and set Capturing to None

Remember to put it back when the camera is online again 😉

Nagios check_vnc without authentication

If you need to monitor a VNC service without logging in, the following check_command can be used.

Edit your nagios configuration file and add:

# VNC
define command{
command_name check_vnc
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -w 5 -c 8 -
e "RFB"
}

Then on the service you want to monitor use:

define service{
use generic-service ; Name of service template to use host_name
host_name MYHOSTNAME
service_description VNC
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups MYCONTACTGROUPS
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_vnc!5910
}

If you need another port than the standard one, just replace “5900”

WP Booking Calendar – style width and height of calendar

In WP Booking Calendar, the calendar when displayed in a widget has a fixed size of 284px using inline css which makes it impossible to override in an external or internal css style.

However it is possible to override this by additional options in the shortcode. This is from the comments in the source code:

[booking type=56 form_type='standard' nummonths=4 options='{calendar months_num_in_row=2 width=568px cell_height=30px}']

In the options the width of the table can be given, also in % like 100% for example if you want the calendar to fill the surroinding container.

WordPress error 500 – Uncaught Error: Call to undefined function trailingslashit() in wp-includes/class-wp-textdomain-registry.php:103

When updating the plugins in a WordPress site prior to updating it from WordPress 6.0 to 6.1.1 the site halted with error 500. Investigating the logs I found “Uncaught Error: Call to undefined function trailingslashit() in wp-includes/class-wp-textdomain-registry.php:103

Solution