Categories
Knowledge Support Support exacqVision Server Categories Products

Archiving continually says “Disconnected” on Linux systems 12.04 and Older

When connecting an NVR running Ubuntu 12.04 or older to a newer S-series you may have issues with it connecting and displaying the “Disconnected” message on the archiving page; even thou everything is correct and systems running Ubuntu 14.04 or newer DO NOT have this issue.

When you search the logs, you will see a message stating it failed to connect.

There is a combination of configuration defaults that prevent an Ubuntu 12.04 server (or older) establishing an SMB connection to an Ubuntu 18.04+ (S-Series) server.

Samba changed their “allow ntlm” default from yes to no in version 4.5.0 The version of Samba available for Ubuntu 16.04 is ​4.3.11 (still allows ntlm, no connection issue), and Ubuntu 18.04 is ​4.7.6 (does not allow ntlm by default, so can’t connect).

The workaround used at the customer is to re-allow ntlm on the S-Series by adding ntlm auth = yes to the /etc/samba/smb.conf on the S-Series server and restarting smbd service.

You will need to either be right on the S-series or SSH in to it.

Run the following command in terminal from the S-series

sudo nano /etc/samba/smb.conf

Add the following in to it right above domains….. ntlm auth = yes

Make sure you save it when finished.

Next, restart the SMB service…

From terminal type the following sudo /etc/init.d/samba restart

Now, go back in to the Exacq Client>Archiving and disable archiving and re-enable it and it should connect.

Trac#22991

Categories
Knowledge Support Support exacqVision Server Categories Products

Setting up Archiving on Third Party Linux Devices

Preparing a Third-Party Storage System

Archiving must be done to a network resource that supports the hosting of SMB shares. By default, S-Series storage systems built by Exacq come with Samba installed. The following steps will need to be performed on a third-party Ubuntu system used in place of an ExacqVision S-Series system.

  1. If you are using a software-only install on your own device running off-the-shelf Ubuntu Linux, you will first need to install/update Samba with the following commands in Terminal:

    &nbsp;&nbsp;&nbsp;&nbsp;sudo apt-get update</br> &nbsp;&nbsp;&nbsp;&nbsp;sudo apt-get install samba

<br>

  1. Samba uses its own credentials, separate from those of the OS user. This Samba user account must also exist as an OS user account. If you do not already have an OS user account you wish to use, create an OS user account with command below. If you do already have an OS user you wish to use for this, you may skip to Step 3.

    &nbsp;&nbsp;&nbsp;&nbsp;sudo useradd username
  • Now set this user’s OS password with the following:

    &nbsp;&nbsp;&nbsp;&nbsp;sudo passwd username
  • After entering the command, you will be prompted to enter a password, then re-enter the password to confirm. Remember, in Linux, passwords do not appear as you type.

<br>

  1. You will need to create a username and set the user password for Samba. The ‘-a‘ parameter in the command below creates the Samba user account.

    &nbsp;&nbsp;&nbsp;&nbsp;sudo smbpasswd -a username
  • After entering the command above, you will be prompted to enter a password, then re-enter the password to confirm. Remember, in Linux, passwords do not appear as you type.

<br>

  1. Next, create the directory to be shared. This is where your archived video will be placed.

    &nbsp;&nbsp;&nbsp;&nbsp;sudo mkdir /home/username/foldername
  • Using the command above, if you wanted to place a folder called VideoArchive in your admin home directory, the command would be sudo mkdir /home/admin/VideoArchive.

<br>

  1. Change the permissions to the directory you just created to allow files to be written to it.

    &nbsp;&nbsp;&nbsp;&nbsp;sudo chown admin /home/username/foldername

<br>

  1. Next, enter the following command to edit the Samba configuration.

    &nbsp;&nbsp;&nbsp;&nbsp;sudo nano /etc/samba/smb.conf
  • Scroll to the end of the file and add the following lines:

    [&lt;foldername&gt;]
    path = /home/&lt;username&gt;/&lt;foldername&gt;
    valid users = &lt;username&gt;
    read only = no
  • You will replace ‘&lt;foldername&gt;‘ with that of the directory you created in Step 4 and replace ‘&lt;username&gt;‘ with the user created in Step 3.

    Press CTRL-X to exit the nano editor. It will ask if you want to overwrite the existing file, enter y and press Enter to return to the Terminal prompt.

<br>

  1. Restart Samba:

    &nbsp;&nbsp;&nbsp;&nbsp;sudo service smbd restart

<br>

Preparing a Third-Party Client System

From the perspective of the SMB server, your recording ExacqVision NVR, where the ExacqVision Server software resides, acts as the SMB client. Therefore, if your recording NVR is also a third-party Ubuntu system, rather than one built-by Exacq, you will need to perform the following steps.

  1. Open a Terminal window and enter each of the following commands:

    sudo apt-get update
    sudo apt-get install smbclient

<br>

  1. Restart the client.

<br>

Connecting to an Archive

  1. In the ExacqVision Client navigate to the Archive Settings page.

Press the New button, then enter the Address of the share and the username and password you created earlier. The address will be the share path, i.e. – \\StorageIPaddress\foldername

Press the Apply button to connect to the share, then configure your Task Schedule.

NOTE: Archiving is a 1:1 relationship. Only one NVR may archive to a share. For multiple NVRs you will need multiple SMB archive targets.

<br>

Categories
Knowledge Support Support exacqVision Client exacqVision Server Categories Products

Frequent Restarts on Linux Systems Archiving over Slow Network

Linux-based exacqVision servers could reboot frequently in certain conditions:

  1. Linux operating system
  2. Active hardware monitoring
  3. Archiving over a slow network (WAN or other network with limited resources)

This issue was fixed in version 6.3.33.65575, and it is available in public release 6.4.

To work around this issue in affected versions, complete the following steps to configure an archiving SMB share:

  1. In exacqVision Client, delete the currently enabled archive task. DO NOT disable the archive target.
  2. Open the /etc/fstab file on the server for editing.
  3. Locate the line with mount paths for the archive target.
  4. Add a flag to the comma-separated section of the line specifying other flags (normally, this should immediately follow rw). The flag added depends on the Linux kernel version used:

    Linux kernel 3.0-3.1 (archiving performance will be impacted)

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,forcedirectio 0 0

    Linux kernel 3.2-3.7 (archiving performance will NOT be impacted if oplocks are supported on the archive target)

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,strictcache 0 0

    Linux kernel 3.8 and later

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,cache=strict 0 0
  5. Save the changes to the /etc/fstab file.
  6. Via shell terminal, execute umount [share path]. For example:

    sudo umount /mnt/10.16.2.4.disk1
  7. Via shell terminal, execute sudo mount -a.
  8. Verify that step 5 was implemented correctly by executing cat /proc/mounts in the shell terminal and locating the line corresponding to the share (such as “directio” if you used the forcedirectio option for kernel 3.0-3.1).
  9. In exacqVision Client, re-create the archive task.
Categories
Knowledge Support Support exacqVision Server Categories Products

Archiving Stalls on Linux-based exacqVision Systems

Archiving from a Linux-based exacqVision system over a wide-area network (WAN) can stall in a Writing Files status for over an hour. If you believe a system is affected, verify the following conditions and symptoms:

  1. Linux kernel version 3.0 or later. Previous versions are not believed to be affected. (To determine the kernel version, run uname -r in the shell of the server.)
  2. The archive connection to the target is over a WAN in which disconnects are possible.
  3. The archive task status has not been updated in more than one hour. (In exacqVision 6.6 and later, the Status section on the Archiving page displays a State of “Failed — Target File Write Stalled.”)
  4. The currently archived file is not increasing in size. (To determine this, click on the details on the Archive page, note the Last Copied Content value, and navigate to the path of that content on the archive target. Verify whether the .workingps file is increasing in size periodically.)

<br>

This issue can be minimized by enabling strict caching mode and changing the cifs_max_pending cifs module parameter to 2 for Linux kernel 3.2 and later. To do this, complete the following steps:

  1. Open the /etc/fstab file on the server for editing.
  2. Locate the line with mount paths for the archive target.
  3. Add a flag to the comma-separated section of the line specifying other flags (normally, this should immediately follow rw). The flag added depends on the Linux kernel version used:

    Linux kernel 3.2-3.7 (archiving performance will NOT be impacted if oplocks are supported on the archive target):

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,strictcache 0 0

    Linux kernel 3.8 and later:

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,cache=strict 0 0
  4. Save the changes to the /etc/fstab file.
  5. Via shell terminal, execute umount [share path]. For example:

    sudo umount /mnt/10.16.2.4.disk1
  6. Via shell terminal, execute sudo mount -a.
  7. Disable all archive targets (do not delete them).
  8. Stop using any other cifs mounts on the system.
  9. Unmount all cifs mounts using umount [path].
  10. Create a file named /etc/modprobe.d/cifs.conf with a line options cifs cifs_max_pending=2 (this persists the value across restarts).
  11. Unload the cifs module using sudo rmmod cifs.
  12. Reload cifs with a new parameter: sudo modprobe cifs cifs_max_pending=2.
  13. Verify the new value using cat /sys/module/cifs/parameters/cifs_max_pending.
  14. Enable the archive targets.
  15. Remount all other cifs shares.

<br>

If this procedure does not resolve the stalling issue, disable cifs client-side caching (this will impact archiving performance). You can try this in one of two ways:

  1. Open the /etc/fstab file on the server for editing.
  2. Locate the line with mount paths for the archive target.
  3. Add a flag to the comma-separated section of the line specifying other flags (normally, this should immediately follow rw). The flag added depends on the Linux kernel version used:

    Linux kernel 3.2-3.7 (archiving performance will NOT be impacted if oplocks are supported on the archive target):

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,forcedirectio 0 0

    Linux kernel 3.8 and later:

    //10.16.2.4/disk1 /mnt/10.16.2.4.disk1 cifs _netdev,username=admin,password=admin256,rw,cache=none 0 0

<br>

Alternatively, you can enable strict caching mode on kernel 3.2 and later and also disable oplocks on the archive target. (NOTE: Strict caching mode is enabled automatically in exacqVision Server 6.6 and later.)

<br>

If you are using an exacqVision S-Series server (or other Samba-based server), oplocks can be disabled globally for all shares, or per share by adding the following lines to the appropriate section of the /etc/samba/smb.conf file:

oplocks=no
level2 oplocks=no

<br>

NOTE: If your environment’s configuration cannot tolerate the performance implications of disabled SMB caching (see above), you can use NFS protocol for archiving instead of SMB. Be aware that there is no username and password protection with the NFS option. Use this Knowledge Base article to configure NFS archiving.

Categories
Knowledge Support Support exacqVision Client exacqVision Server Categories Products

Using NFS Protocol for Archiving

Archiving using NFS protocol instead of SMB protocol is possible starting with exacqVision Server 6.9.11 and exacqVision Client 6.9.14. However, the following steps might be required to enable NFS archiving functionality.

NOTE: Existing archive target configurations cannot be changed to use NFS. In those cases, a new archive target configuration must be created.

Linux

  1. Install the nfs-common package with sudo apt-get install nfs-common
  2. Restart evServer daemon with sudo service edvrserver restart
  3. Use 6.7.x.x exacqVision Client to configure the NFS share. The share name MUST immediately follow the archive target IP/Hostname. This means that the NFS share name might have to be exported at the root / of the NFS server.

Windows

Windows XP:

NFS client is not supported.

Windows 7 Embedded / Enterprise / Windows 7 Professional:

  1. Use the legacy control panel. Open Start Menu and start typing “control” to find and click it.
  2. Control Panel => Programs and Features => Turn Windows features on or off.
  3. Check “Services for NFS” and click OK (includes both admin tools and Client for NFS).
  4. Verify that “Client for NFS” is now listed in Services control panel. Make sure it’s set to automatic start and start it.
    (Refer to ​https://graspingtech.com/mount-nfs-share-windows-10/)
  5. Restart exacqVision Server service.
  6. Using the exacqVision Client, go to the Archiving panel, click New button, and verify that NFS is now available in dropdown alongside SMB.

Windows Server 2008 R2 and 2012:

  1. Enable Services For NFS through the Server Manager’s Add Roles wizard.
  2. Using Service Manager, change the Client for NFS service’s Startup Type to Automatic.
  3. Execute the following command: nfsadmin client start.
  4. Restart the exacqVision Server service.
  5. Configure the NFS archive target using exacqVision Client and specify the NFS share type.

Windows Server 2016:

  1. Use the legacy control panel. Open Start Menu and start typing “control” to find and click it.
  2. Control Panel => Programs and Features => Turn Windows features on or off.
  3. Server Manager will appear and Add Roles and Features Wizard will appear.
  4. On “Before You Begin” panel click Next.
  5. On “Installation Type” panel select “role-based or feature-based installation” and click Next.
  6. On “Server Selection” panel select local server and click Next.
  7. On “Server Roles” panel just click Next to retain current settings.
  8. On “Features” panel check “Client for NFS” and click Next.
  9. Confirm and allow it to install.
  10. Verify that “Client for NFS” is now listed in Services control panel. Make sure it’s set to automatic start and start it.
    (Refer to ​https://www.server-world.info/en/note?os=Windows_Server_2016&p=nfs&f=3)
  11. Restart exacqVision Server service.
  12. Using the exacqVision Client, go to the Archiving panel, click New button, and verify that NFS is now available in dropdown alongside SMB.

Edge

  1. Axis devices do not support NFS.
  2. No manual steps are needed for other Edge devices. Simply use an updated version of exacqVision Server and Client.

S-Series

  1. Install the nfs-kernel-server package with sudo apt-get install nfs-kernel-server
  2. Restart exacqVision Server service.
  3. Using the exacqVision Client, go to the Archiving panel, click New button, and verify that NFS is now available in dropdown alongside SMB.
Categories
Knowledge Support Support exacqVision Server

Video Not Recording to iSCSI  with Status “Recording Not Possible”

Description

Video is not recording to customers iSCSI targets after a reboot.  Drive was reporting a status of “Recording Not Possible” on exacqVision Server 21.03.10.  Servers running exacqVision Server version 20.06 or older were showing a status of healthy, but were not recording.

Identification

Use the following to properly identify the issue before applying the fix.

  • Update to exacqVision Server version 21.03 or later. 
  • Check the drives status on the storage page.
  • If the status is “Recording Not Possible”
    • Enable debug level logging
    • Restart the exacqVision Server service
    • Monitor for log entries similar to those listed below, specifically Store Fails and GRV Fails
    • Check Extended Storage or Enterprise Storage for conflicting entries like those displayed below.
    • Once positively identified follow the steps outlined in the resolution section

Log files (debug level enabled)

Before Fix

After Fix

Enterprise Storage page was showing the Type as Local (iSCSI) on the servers which were not recording.   Servers which were recording report the volume type as Local. Note: The server showing the Status of “Recording Not Possible” was running newer exacqVision Server software 21.03.10 vs 20.06 or older for the others.

Another indication was that the iSCSI targets populated both the Targets and Partitions Section of  the Storage page,  Extended tab.  Whereas the servers which were recording normally populated only the iSCSI Targets.section

Resolution

  • rename archivepi.xml
  • rename psfpi.xml
  • restart exacqVision Server Service
  • Verify that storage targets are only listed in the Partition section of the Storage page (Configuration > Storage > Extended Tab)
  • Verify that the volume now has a type of Local on the Enterprise Storage page (Configuration > Enterprise > Storage)
Categories
Knowledge Support Support exacqVision Server Categories Products

System watchdogs while archiving when SMB network share connection is lost

Affected platforms

exacqVision 7.1.23 to 7.2.0 running on Ubuntu Linux

<br>

Symptom

If the recorder is archiving and cannot reach an SMB archive target, the recorder will become unresponsive and watchdog reset.

<br>

Workaround

Downgrade to a version prior to 7.1.23

<br>

Resolution

Upgrade server to 7.2.1 or newer to address proper timeout detection and erroneous watchdog behavior. However, LDAP, e-mail notifications, drive/RAID monitoring and other operations involving external executable utilities will cease to function until the archive connection is restored. Refer to https://crm.exacq.com/kb/?crc=1151 for more details on how to subsequently resolve the archiving connection issue.

Categories
Knowledge Support Support exacqVision Server

Direct Search Working Yet Status Displays “Invalid username or password”

Description

The Status of the Direct Search section on the Archiving page shows “Invalid username or password”  However the target can be accessed through a file explorer and direct search can find video only present on the archive target and play it back.

While only cosmetic this issue can cause unnecessary concern and confusion and has been present since at least exacqVision Server Version 19.03

Resolution

Fixed in exacqVision Server release 21.06

Related Link

#19578

Categories
Documentation Integrations Categories Products exacqVision Integrations

AWS S3 Integration Guide (Amazon Web Services Archiving)

AWS-S3-Integration-Guide.pdf
Categories
Knowledge Support Support exacqVision Server Categories Products

SMB server signing and encryption for Archiving

exacqVision’s default method for archiving recorded data uses the SMB protocol. Using an exacqVision S-Series storage system makes configuring archiving simple. Users may also archive to SMB shares configured on their own third-party systems, but installing and configuring Samba or SMB Shares on non-Exacq built systems is outside the scope of Exacq Support.

There have been several iterations of SMB since the protocol was first introduced. Devices wishing to communicate via SMB must first perform a negotiation to determine which version they will use. The version and dialect of SMB chosen will determine what features are used.

<br><br>

Versions

Discussing versions quickly becomes a tangled web, which we will try to unravel here.

When capturing the network traffic between two devices, using applications such as Wireshark, the protocol will be listed as SMB2, which supports many dialects including 2.1, 3.0, 3.1, which can cause some confusion as many people will refer dialects as versions. We will be using the term dialect for these here.

Introduced in 2015, dialect 3.1.1 is the latest release of SMB at the moment. While SMB is the protocol used, SMB is implemented on Linux systems using an application named Samba. Samba provides support for SMB as well as other protocols, thus it has it’s own version numbering separate from SMB. Samba has supported SMB dialect 3.1.1 since Samba 4.3.

How to check the version of Samba installed on your S-series or other Linux system:

  1. Open a Terminal window, by pressing CTRL+ALT+T
  2. Type samba --version, and press Enter.

<br><br>

Server Signing

Server signing is a security method used by SMB. When signing is enabled, every SMB message includes a signature key and a hash of the entire message is included in the message header.

How does signing help protect data? In addition to verifying the identities of the sending and receiving devices, the nature of hashing means that if an attacker changes the message between the NVR and the archive share, the hash will no longer match.

<br><br>

Encryption

SMB version 2.0 provides encryption, but used HMAC-SHA256 encryption. SMB 3.0 updated the encryption used to AES-CMAC and AES-CCM. SMB 3.1.1 then updated to support AES-128-GCM and AES-128-CCM as well as other security enhancements.

SMB DialectEncryption Method
2.0HMAC-SHA256
3.0AES-CMAC and AES-CCM
3.1.1AES-128-GCM and AES-128-CCM

<br><br>

Manual Enforcement

As mentioned above, when two devices attempt to communicate using SMB they first negotiate the connection to determine the version and dialect they will use.

The client first advertises to the server which versions and dialects it supports. The server replies with the highest version and dialect it supports so they can agree. In the case of exacqVision’s Archiving, the client is the recording NVR system and the server is the S-Series system.

IMPORTANT: Because the protocol automatically selects the highest version both devices support, and because SMB signing and encryption are mature technologies, there is usually no need to manually configure settings. It is recommended only in situations where specific network requirements must be enforced to function properly.

<br>

To manually configure SMB:

  1. On the S-Series server, open a Terminal window by pressing CTRL+ALT+T
  2. Use sudo permissions to edit /etc/samba/smb.conf
  3. Locate the [global] settings section.
  4. Beneath the [global] tag, add the following lines:
    server signing = mandatory
    server min protocol = SMB3_11
    server max protocol = SMB3_11
  5. Save your changes, then exit the file.
  6. Restart Samba by entering
    sudo /etc/init.d/samba restart

The entries given for Step 4 above enforce server signing as well as SMB dialect 3.1.1. Attempts to connect with anything else would fail. A list of possible options for these three entries is given below.

server signing = [default, auto, mandatory, disabled]

server min protocol = [SMB2, SMB2_02, SMB2_10, SMB3, SMB3_00, SMB3_02, SMB3_11]

server max protocol = [SMB2, SMB2_02, SMB2_10, SMB3, SMB3_00, SMB3_02, SMB3_11]

Note: ‘server min protocol’ should be the same or lower than ‘server max protocol’. If these are different values the client and server must support a dialect in between these values. If these are the same value, they must support that specific dialect.

IMPORTANT: Without editing the configuration at all, the default behavior when these fields are excluded from the smb.conf file are the same as entering the following:
server signing = auto
server min protocol = SMB2_02
server max protocol = SMB3

<br>