Aug 192016

So you have faulty disk and these nice guys from HP (sorry, HPE I should say!) asked for adureport. That’s alright, it’s as easy as 1, 2, 3


Configure repository as described here.


apt-get install hpacucli

Generate report

hpacucli ctrl all diag file=/tmp/

Email report back to HP. You can of course view it first should you want it:

vim ADUReport.txt


Using hpacucli

NB. Did you know, you can do all sorts of funky stuff with hpacucli?

Either run commands to get output that can be feed to monitoring scripts:

/usr/sbin/hpacucli ctrl slot=0 physicaldrive all show status
/usr/sbin/hpacucli ctrl slot=0 logicaldrive all show status
/usr/sbin/hpacucli ctrl slot=0 array all show status

or run it interactively:


HP Array Configuration Utility CLI
Detecting Controllers...Done.
Type "help" for a list of supported commands.
Type "exit" to close the console.

=>  ctrl all show config

=>  ctrl all show status

Smart Array P400 in Slot 0
   Controller Status: OK
   Cache Status: OK

=>   set target ctrl slot=0

 "controller slot=0"

=>   show

=>   show config detail

Smart Array P400 in Slot 0
   Bus Interface: PCI
   Slot: 2
   Serial Number: xxxxxxxxxxxxxxxx
   Cache Serial Number: xxxxxxxxxxx
   RAID 6 (ADG) Status: Disableds
   Controller Status: OK
   Chassis Slot:
   Hardware Revision: Rev E
   Firmware Version: 5.20
   Rebuild Priority: Medium
   Expand Priority: Medium
   Surface Scan Delay: 15 sec
   Cache Board Present: True
   Cache Status: OK
   Accelerator Ratio: 100% Read / 0% Write
   Drive Write Cache: Disabled
   Total Cache Size: 256 MB
   Battery Pack Count: 0
   SATA NCQ Supported: True

=> physicaldrive all show status

   physicaldrive 1I:1:1 (port 1I:box 1:bay 1, 450 GB): OK
   physicaldrive 1I:1:2 (port 1I:box 1:bay 2, 450 GB): OK
   physicaldrive 1I:1:3 (port 1I:box 1:bay 3, 450 GB): OK
   physicaldrive 1I:1:4 (port 1I:box 1:bay 4, 450 GB): OK
   physicaldrive 1I:1:5 (port 1I:box 1:bay 5, 450 GB): OK
   physicaldrive 1I:1:6 (port 1I:box 1:bay 6, 450 GB): OK
   physicaldrive 1I:1:7 (port 1I:box 1:bay 7, 450 GB): OK
   physicaldrive 1I:1:8 (port 1I:box 1:bay 8, 450 GB): OK
   physicaldrive 1I:1:9 (port 1I:box 1:bay 9, 450 GB): OK
   physicaldrive 1I:1:10 (port 1I:box 1:bay 10, 450 GB): OK
   physicaldrive 1I:1:11 (port 1I:box 1:bay 11, 450 GB, spare): OK
   physicaldrive 1I:1:12 (port 1I:box 1:bay 12, 450 GB, active spare): OK

=> array all show status

array AOK

=> logicaldrive all show status
   logicaldrive 1 (3.7 TB, 5): OK

If you don’t have battery or it takes long to replace it then you should enable no-battery write cache.

ctrl all show detail
hpacucli ctrl slot=0 modify nbwc=enable
hpacucli ctrl slot=0 modify dwc=enable forced
Jun 162015


Sadly, Zoneminder is not available in Debian 8. Here you can find my recipe for building debian package and installing Zoneminder, currently version 1.28.1 from git. Based on slightly amended instructions for Debian 8 Jessie from



aptitude install -y apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg8 apache2-mpm-prefork libapache2-mod-php5 php5-cli libphp-serialization-perl libavcodec-dev libavformat-dev libswscale-dev libavutil-dev libv4l-dev libtool ffmpeg libnetpbm10-dev libavdevice-dev libmime-lite-perl dh-autoreconf dpatch


cd /usr/src
git clone zoneminder;
cd zoneminder
ln -s distros/debian8 debian
dpkg-checkbuilddeps # and apt install if anything is missing

vim zoneminder/debian/changelog # add new version on top with email address matching your GPG key and then




One level above should hopefully find a deb package matching the architecture of the build host:

ls -l /usr/src/zoneminder*.deb
cd /usr/src
for i in `ls *.deb`;do echo "------------- $i";dpkg -i $i;done
apt-get install -f
dpkg-reconfigure zoneminder


Lets see:

systemctl status zoneminder

 zoneminder.service - ZoneMinder CCTV recording and security system
 Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled)
 Active: active (running) since Tue 2015-06-16 13:28:12 BST; 3min 21s ago
 Main PID: 5602 (
 CGroup: /system.slice/zoneminder.service
 /usr/bin/perl -wT /usr/bin/ startup
 /usr/bin/perl -wT /usr/bin/
 /usr/bin/perl -wT /usr/bin/ -c
 /usr/bin/perl -wT /usr/bin/
 /usr/bin/perl -w /usr/bin/ -c
 Jun 16 13:28:11 sambor.home zmdc[5632]: INF [' -c' started at 15/06/16 13:28:11]
 Jun 16 13:28:11 sambor.home zmfilter[5626]: INF [Scanning for events]
 Jun 16 13:28:11 sambor.home zmdc[5638]: INF ['' started at 15/06/16 13:28:11]
 Jun 16 13:28:11 sambor.home zmdc[5602]: INF ['' starting at 15/06/16 13:28:11, pid = 5638]
 Jun 16 13:28:12 sambor.home zmwatch[5638]: INF [Watchdog starting]
 Jun 16 13:28:12 sambor.home zmwatch[5638]: INF [Watchdog pausing for 30 seconds]
 Jun 16 13:28:12 sambor.home zmdc[5602]: INF [' -c' starting at 15/06/16 13:28:12, pid = 5645]
 Jun 16 13:28:12 sambor.home zmdc[5645]: INF [' -c' started at 15/06/16 13:28:12]
 Jun 16 13:28:12 sambor.home zmupdate[5645]: INF [Checking for updates]
 Jun 16 13:28:12 sambor.home zmupdate[5645]: INF [Got version: '1.28.1']

Well, well, well. Look who’s up and running!


Alright, we can now connect to server IP address and start adding monitors

Start with checking your cameras:

zmu -d /dev/video0 -q -v

It took me a while to experiment with settings and find the most optimal configuration. My camera is connected via BT878 video card and it worked with

Capture Method v4l2
 Device Channel 1
 Device Format NTSC
 Capture Pallet Auto
 Target Colorspace 32bit
 Capture Width 768
 Capture Height 480
 # although Crop Capabilities in debug advertised it as 924 x 576

I use it in Mocord mode.

Last hint, make sure you have plenty of space to store data produced by Zoneminder.
I have changed symlinks /usr/share/zoneminder/{events,images,temp} and pointed them to dedicated zfs filesystem with ample of space:

for i in events images temp;do mkdir /tank/zoneminder/$i;ln -s /tank/zoneminder/$i /usr/share/zoneminder/$i:done
 chown www-data. /tank/zoneminder/*


Is default Zoneminder inclination to log bloody EVERYTHING to blooming EVERYWHERE driving you mad? Well, welcome to the club!

vim /etc/rsyslog.conf

and replace line 62 adding local1.!*

# *.*;auth,authpriv.none -/var/log/syslog
# As per
*.*;local1.!*;auth,authpriv.none -/var/log/syslog

And restart rsyslog

systemctl restart rsyslog