Jump to content

dlandon

Community Developer
  • Content Count

    4374
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by dlandon

  1. Apparently there is an issue. It has come up again. Can you let me know how you entered the information into the UD dialog to mount the remote smb share?
  2. Unassigned Devices Plugin Unassigned Devices (UD) includes a lot of functionality and has become a bit complex. Please be aware of the following before you start using UD. Hover your mouse over an any active area on the UD page and a tool tip will show you what clicking that area does. UD has a destructive mode that allows deleting disk partitions and formatting disks. If Destructive Mode is not turned on in the UD Settings, you WILL NOT be able to format a disk. Go the the Settings page and scroll to the bottom to see the UD settings. To format a disk: Destructive mode must be enabled. Disk must have all partitions removed. Unmount the disk, click on the '+' icon next to the serial number, and click on all red-X to delete partitions. If the disk has been precelared and shows a grayed 'Format' button, click on the '+ icon next to the disk serial number, then click on the red-X to delete the preclear status file. There are different operations in various active areas (especially the disk serial number) based on whether or not the disk drive is mounted. If the disk is not mounted, click on the '+ icon by the serial number, click on the partition name, then you can type a new mount point name. Press Enter for the name change to be applied. This will now become the mount point and the share name when the disk is shared. In order to share any UD device, sharing needs to be enabled in the UD Settings and the switch turned on to share the particular device. Disks formatted with xfs or ext4 will be mounted with 'discard'. This enables TRIM on SSD devices. DIsks formated XFS or BTRFS will be partitioned compatible with the array disks and can be installed in the array without a re-format. An encrypted array disk can be mounted in UD with the following restrictions: The array disk passphrase has to be defined. You cannot enter the passphrase for the disk in UD. An array encrypted disk cannot be created with UD. The disk can only be mounted if the current array passphrase is the same as the UD encrypted disk. Note: There has to be at least one encrypted disk in the array. Because of security issues with samba, the mounting of remote SMB shares with CIFS has become more complicated. The default protocol is now SMB3 and not SMB1; the default security is now ntlmv2 and not ntlm. UD will try to mount SMB shares with SMB3, then SMB2, and then SMB1 to try to get the mount to use the most secure protocol it supports and the ntlmv2 protocol. If you have any issues with mounting remote SMB shares, set the in Settings->Unassigned Devices "Force all remote shares to SMB v1" to "Yes". Note: UD disks add to the total disks allowed by the Unraid license you have purchased except for a Pro license. See here for details. This plugin is a continuation of the Unassigned Devices plugin originally written by gfjardim. I have updated the plugin for Unraid 6, fixed some issues, and added new features. Unassigned Devices allows you to mount and share disk drives that are not managed as part of the array. Some users are mounting a drive specifically for Dockers and/or VMs rather than having them on a cache or array drive. You can also mount a UNC share on another system (SMB or NFS) and have it show in the Unraid shares when browsing the Unraid shares with Windows. This is called SMB Mount. The UNC path is mounted locally and shared as a \\Tower share. Access to Unassigned Devices shares defaults to Public with everyone having read/write access. User access can be enabled in the Unassigned Devices Settings. Access can be enabled by user for read/write, read only, or no access to Unassigned Devices shares. When a USB device is plugged in or mounted an event is initiated to run a user defined script. This is usefull for backing up files from the server initiated by plugging in the USB device or copying pictures from a camera to the array. Scripts are created unique for each device. You can also setup one script to run whenever any device is plugged in or mounted. Installing the plugin You can install the plugin from the Community Applications plugin or by pasting the following link in the Install Plugin tab on unARAID plugins page. https://github.com/dlandon/unassigned.devices/raw/master/unassigned.devices.plg Mount Points and Shares There seems to ba a lot of confusion over a mount point vs. a share. The mount point is where the device is mounted locally on Unraid. A share makes the mount point available in Windows at '\\Tower' as a browseable folder. When devices and SMB Mounts are mounted, they are mounted at /mnt/disks/. They are not a part of the Unraid array and are not mounted at /mnt/disk/ which is for Unraid disk drives. As an example, you have a device named 'MyDisk'. When it is mounted, it is accessed locally at /mnt/disks/MyDisk. If you want to use 'MyDrive' in a Docker you would refer to it by '/mnt/disks/MyDrive'. It is not automatically shared at '\\Tower\MyDrive'. To share 'MyDrive', you would turn on the 'Share' switch for the drive and 'MyDrive' would be shared at '\\Tower\MyDrive'. The share 'MyDrive' is not accessed at /mnt/user/MyDrive' because it is not an Unraid user share. Mount points and shares are two separate things. Partitions and Formatting If you turn on the destructive mode in the Unassigned Devices Settings, you will be able to delete partitions and format disks. It is defaulted off as a safety measure. Scripts Here is an example script that will back up a Pictures share to a USB drive when plugged in. The USB drive is unmounted once the script completes so you just plug in the drive, wait for it to be completed, and then unplug the drive. The beeps in the script will make speaker sounds if you have a speaker to let you know when the drive is plugged in, when the backup has started, and when the backup has finished and the drive unmounted. The nice thing about this script is that all you have to do is plugin the drive and wait for it to finish. You will also be notified when it is done if you have turned on Unraid notifications. Set the drive to auto mount. Set the script to run in the background. If you mount and unmount the drive from the Unassigned Devices gui, the drive will mount and unmount but the script will not run because it has detected the 'OWNER' as 'user' and will skip the backup. #!/bin/bash PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin ## Available variables: # AVAIL : available space # USED : used space # SIZE : partition size # SERIAL : disk serial number # ACTION : if mounting, ADD; if unmounting, UNMOUNT; if unmounted, REMOVE; if error, ERROR_MOUNT, ERROR_UNMOUNT # MOUNTPOINT : where the partition is mounted # FSTYPE : partition filesystem # LABEL : partition label # DEVICE : partition device, e.g /dev/sda1 # OWNER : "udev" if executed by UDEV, otherwise "user" # PROG_NAME : program name of this script # LOGFILE : log file for this script case $ACTION in 'ADD' ) # # Beep that the device is plugged in. # beep -l 200 -f 600 -n -l 200 -f 800 sleep 2 if [ -d $MOUNTPOINT ] then if [ $OWNER = "udev" ] then beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 logger Started -t$PROG_NAME echo "Started: `date`" > $LOGFILE logger Pictures share -t$PROG_NAME rsync -a -v /mnt/user/Pictures $MOUNTPOINT/ 2>&1 >> $LOGFILE logger Syncing -t$PROG_NAME sync beep -l 100 -f 2000 -n -l 150 -f 3000 beep -l 100 -f 2000 -n -l 150 -f 3000 beep -r 5 -l 100 -f 2000 logger Unmounting PicturesBackup -t$PROG_NAME /usr/local/sbin/rc.unassigned umount $DEVICE echo "Completed: `date`" >> $LOGFILE logger Pictures Backup drive can be removed -t$PROG_NAME /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Pictures Backup completed" -i "normal" fi else logger Pictures Backup Drive Not Mounted -t$PROG_NAME fi ;; 'REMOVE' ) # # Beep that the device is unmounted. # beep -l 200 -f 800 -n -l 200 -f 600 ;; 'ERROR_MOUNT' ) /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Could not mount Pictures Backup" -i "normal" ;; 'ERROR_UNMOUNT' ) /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Could not unmount Pictures Backup" -i "normal" ;; esac Here is a nice UD script for importing photos from a camera/memory card into the array: Photo Script Thanks to ljm42. Cron Task A better way of running cron scripts is the 'User Scripts' plugin. You can set up a script to run at a particular time to perform disk operations. It is best to leave the device mounted so the script can access the drive. This is a simple way to set up a cron task to run a script to copy files to a backup. This method is a little cumbersome, but does work well. You will need to set up your drive to auto mount and it has to be left mounted. You can use the default script or the following one if you want beeps when the drive is mounted and unmounted. Set the drive to auto mount. he drive has to stay mounted for the script to work. Set the script to run in the background. #!/bin/bash PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin ## Available variables: # AVAIL : available space # USED : used space # SIZE : partition size # SERIAL : disk serial number # ACTION : if mounting, ADD; if unmounting, UNMOUNT; if unmounted, REMOVE; if error, ERROR_MOUNT, ERROR_UNMOUNT # MOUNTPOINT : where the partition is mounted # FSTYPE : partition filesystem # LABEL : partition label # DEVICE : partition device, e.g /dev/sda1 # OWNER : "udev" if executed by UDEV, otherwise "user" # PROG_NAME : program name of this script # LOGFILE : log file for this script case $ACTION in 'ADD' ) # # Beep that the device is plugged in. # beep -l 200 -f 600 -n -l 200 -f 800 ;; 'REMOVE' ) # # Beep that the device is unmounted. # beep -l 200 -f 800 -n -l 200 -f 600 ;; esac Now set up a cron file in the /flash/config/plugins/dynamix/ directory. Name the file 'custom.cron' (or a name of your own choosing.cron) with the following contents. This will set up a cron task to run at 4:30 AM every day. It runs a script in the /boot/custom/ directory called DailyBackup. # Custom cron scripts: 30 4 * * * /boot/custom/DailyBackup &> /dev/null Sample Daily Backup script #!/bin/bash # # Perform daily backup. # MOUNTPOINT=/mnt/disks/DailyBackup PROG_NAME=DailyBackup logger Started -t$PROG_NAME if [ -d $MOUNTPOINT ] then logger Pictures share -t$PROG_NAME rsync -a -v /mnt/user/Pictures $MOUNTPOINT/ 2>&1 logger Completed -t$PROG_NAME /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Daily Backup completed" -i "normal" else logger Daily Backup Drive Not Mounted -t$PROG_NAME fi After you have copied your cron file to the dynamix directory you will have to load the cron file manually one time to get it started. Unraid will manage the cron file after that and insert it into the crontab for you. Use the following command to load the cron file the first time. /usr/local/sbin/update_cron Pooling Disks You can create multiple pools with UD, with some limitations, details here. Click on the 'Help' button on the main menu bar of Unraid to get some additional help. If you hover your mouse over an active area on the gui, you will see tool tips that will help you understand the operation of the active area. Verify you have the latest version installed and check the syslog for information if you are having any issues. Many questions can be answered by reading this post and checking the syslog.
  3. Provide me diagnostics so I can find this issue and fix it. Just installing an older version of UD is not a permanent solution.
  4. While your idea may be cool, it's not very practical. This doesn't happen enough for the investment in time to implement. Yes. For very little gain.
  5. This pugin will only work with Unraid V6.4 and later versions. This is a plugin that will create a per share .Recycle.Bin folder on each smb share for files deleted on that share. Built into samba is a module called "vfs recycle" that handles the deletion of files. This plugin manages the vfs recycle settings using smb-shares.conf and starts and stops vfs recycle. Basically samba is restarted with the smb-shares.conf file configured for vfs recycle. The reason the folder name of .Recycle.Bin was chosen is so the recycle bin is a hidden folder. This is the normal way a recycle bin works. The way vfs recycle works when a file is deleted is to move the file pointers (directory information) to the .Recycle.Bin folder on the same share where the file is located. Each share will have its own .Recycle.Bin folder where the files deleted from that share are located. The .Recycle.Bin folder is created when a file on that share is deleted. A .Recycle.Bin folder per share is created and contains all deleted files for that share. This deleted file organization can be modified in the WebUI. You can set parameters to organize deleted files by user or machine and then the file structure after that. The deleted files can then be recovered as necessary by browsing to //Tower/share/.Recycle.Bin. You can also optionally set up an empty trash event (Hourly, Daily, or Weekly) that will delete files older than a configurable number of days. Deleted files are dated when they are deleted and not by their original date. You can click on a "Remove Aged Files" button on the WebUI and deleted files will be removed based on the aged days setting. You can make the .Recycle.Bin folder visible in the shares by setting 'Hide "dot" files' to no in the smb settings. You can then browse the .Recycle.Bin folders. If the folder is not visible, you can browse to it by using //Tower/share/.Recycle.Bin. I recommend setting up the weekly cron and set the age days to something that makes sense for you (default is 7 days). That will keep the .Recycle.Bin folder from getting out of hand. Note: Shares will not show up when browsing the Recycle Bin from the WebUI unless there is a .Recycle.Bin folder on that share. Click on the 'Help' button on the upper right of the menu bar and you will get explanations of the settings. The preferred way to install the plugin is using Community Applications or you can cut and paste this link into the "Install Plugin" line to install the plugin: https://github.com/dlandon/recycle.bin/raw/master/recycle.bin.plg Note: Be sure to remove any older plugin (prior to V6.3) before installing this new version. Note: If you remove the plugin, the .Recycle.Bin share folders will not be emptied. If you want to permanently remove the plugin, you need to empty the trash before removing the plugin. Excluding Shares Enter the share names to exclude from the recycle bin. You can treat these names as wild cards. Any share that has the text that is in the excluded share will be removed, unless single quoted. If the share name is single quoted, the share must match exactly to be excluded. Example: Shares: Joe Files Sam Files My Files Setting exclude to 'Files' (without quotes) will exclude all three shares. To exclude 'My Files' only set the exclude to 'My Files' (without quotes). Note: You should exclude the appdata and system shares because there is no reason to have a recycle bin on those shares and it may create more samba activity than the recycle bin can handle if there is a lot of samba delete activity on those shares. Credits: This plugin is based on the previous work of Influencer done back in the V5 days.
  6. You can also browse the recycle bin through the plugin webui and click on the file you want to restore and it will be downloaded. You can then put it back where you want.
  7. I won't do 'custom' changes for one person. I do changes that will benefit the Unraid community. I am not paid for any of this work and won't spend my time on someone's custom needs. I know what he is doing and can see how mounting shares on a domain would be useful. If I recall, Windows servers use domains.
  8. Try this on a domain share with no credentials.
  9. Browse to the //tower/share/.Recycle.Bin folder and copy out what you want.
  10. I have made a change to UD. You now specify user@domain for a SMB share on a domain. I have no way of testing a domain share, so I'm unable to check that, but the mount command is correct. If the share doesn't have credentials, I think you'd put @domain for the user.
  11. I like the idea of the domain being a part of the user field - user@domain. I'll have a look when I can get some time.
  12. Show me how you enter this to the user? I might be able to extract the domain from the user if it you let me know the syntax for the domain & user. This has come up before, but I don't remember the outcome.
  13. dlandon

    [support] dlandon - Zoneminder 1.32

    I don't think so. Ask on the Zoneminder forum.
  14. This is an update of the Zoneminder Docker initially created by aptalca to the latest version of Zoneminder. You can do an in place update of this Docker and your current configuration will be kept and the database updated. Note: This Docker has settings pre-configured so all you have to do is install your cameras and make your particular adjustments. Changes can be made as necessary for special needs after installation. If you need help with Zoneminder click here for the documentation and here for the forum. Search for Zoneminder in CA and install it. The Zoneminder WebUI can be accessed by left clicking on the Zoneminder Docker and selecting WebUI. The URL shown in the browser address bar is how you access Zoneminder. Any changes made to the port or networking setup can change this URL. A self signed ssl certificate is generated when the Docker starts if it does not exist and it is stored at appdata/Zoneminder/keys. This certificate is used for https access to Zoneminder and for the zmNinja Event Notification Server. You can supply your own certificate and replace the auto generated certificate if you'd like. Only secure access is allowed. An update is performed on every startup of the Zoneminder Docker to keep patches and updates applied to Linux. Zoneminder minor updates are applied automatically. Zoneminder major updates are not applied so I can test and verify them before being applied to the Docker. Major updates normally require changes to the Docker to work properly. PTZ Control Scripts: If you have a PTZ camera that has a custom script, put it in the '/appdata/Zoneminder/control/' folder and whenever the Zoneminder docker is started, it will copy the script to the '/usr/share/perl5/ZoneMinder/Control' folder in the docker image. Change Databases: You can change to an external database by overwriting the default zm.config database settings. Change the following settings for your particular needs and put them in the file "99-mysql.conf' in the /appdata/Zoneminder/conf/ folder. Your settings will be installed when the docker is started. # ZoneMinder database hostname or ip address ZM_DB_HOST=localhost # ZoneMinder database name ZM_DB_NAME=zm # ZoneMinder database user ZM_DB_USER=zmuser # ZoneMinder database password ZM_DB_PASS=zmpass Set up eMail Notifications: Follow the guide here. The ssmtp configuration files are at appdata/Zoneminder/ssmtp/. Note: Be sure to set up a filter for emails. These changes are kept if Zoneminder is updated or removed and re-installed. Set up zmNinja Event Norifications: The zmNinja Event Notification Server is included in the Docker. The zmNinja Notification Server pushes events to your iOS and Android devices. Enable the 'Event Server' on your iOS or Andriod device and the server will automatically connect. Be sure to forward port 9000 on your router to the Zoneminder Docker. The server is configured to run with security with the self signed certificate generated on installation of Zoneminder. The zmNinja event server is not enabled by default. Enable it in Options->System->OPT_USE_EVENTNOTIFICATION. You can configure the zmnotificationserver.pl to run with or without security. Modify the 'appdata/Zoneminder/zmeventnotification.ini' file to turn off ssl and configure other parameters like the port to listen on for events. If you change the port, you'll need to modify the port in the docker configuration. Restart the Docker after you've made changes to the zmeventnotification.ini file. There is a 'hook' feature of zmeventnotification where processing after an event can be hooked for custom processing. An appdata/Zoneminder/hook folder is created where you can copy the scripts and configuration you need for custom event processing. The appdata/Zoneminder/hook/models is where you install the configuration files for the model of post processing you are using. When the docker is started, the files and folders for the hook processing are copied into the image. The following files/folders from the appdata/Zoneminder/hook folder are copied into the image: appdata/Zoneminder/hook/detect* files to /usr/bin/ appdata/Zoneminder/hook/objectconfig.ini file to /etc/zm/ appdata/Zoneminder/hook/models folder to /var/lib/zmeventnotification/models appdata/Zoneminder/hook/known_faces folder to /var/lib/zmeventnotification/known_faces The hook files require additional python modules. These can be installed with a user script. Create a file at appdata/Zoneminder called 'userscript.sh' with the following contents. #!/bin/sh # Python modules needed for hook processing apt-get -y install python-pip cmake apt-get -y install libsm6 libxext6 libxrender1 libfontconfig1 pip install numpy opencv-python imutils configparser Shapely future python setup.py install # Install for face recognition pip install face_recognition Enable the user script (see below) and this will run the 'userscript.sh' and install the modules for the hook files. Here is a guide on the notification server. Here is a guide on the hook processing. crontab Zoneminder has the ability to change states so you can have different operation of your cameras based on the time of day and/or day of the week. To set up cron events, create a file called 'cron; and place it in the appdata/Zoneminnder/ folder. The 'cron' file contents should be the crontab entries you want created. When the Zoneminder Docker is started it will put your 'cron' file entries into the root crontab. Example 'cron' file: # Daytime camera operation 0 8 * * * /usr/bin/zmpkg.pl Daytime # Nightime camera operation 0 20 * * * /usr/bin/zmpkg.pl Nighttime Note: The default purge 'Filter' is set for 50% of the disk where the Zoneminder data is stored. On Unraid this is not a good way to manage the growth of the events. I recommend setting up a purge filter based on the age of the events. This is the way to set up a filter to purge events by age: This filter purges events older than 30 days. You can set the 'days ago' to a value that makes sense for you. User Script You can enable a custom user script. Edit the docker template xml and add a variable: ADVANCED_SCRIPT with a value of 1. This will enable your script. Put your script in the appdata/Zoneminder/ folder and name it userscript.sh. The script will be executed each time the Docker is started before Zoneminder is started. Be sure to chmod +x userscript.sh so the script is executable. Version 1.32.x update release notes: Be sure to set the display css settings. The zmNinja event server is not enabled by default. Enable it in Options->System->OPT_USE_EVENTNOTIFICATION. You can make changes to the zmeventnotification.ini file in the appdata/config/ folder. Restart the docker after making changes. You cannot change the zm.conf file in this version. You can override the zm.conf settings by creating a '.conf' file and placing it in the apdata/config/conf/ folder. The default zm.conf file is stored in the appdata/config/conf folder as well as a README on changing the default settings. For example, if you want to specify your own mysql database, copy the settings from the zm.default for the database settings and place them in a new file named '99-mysql.conf' in the appdata/config/conf folder. These settings will be used to overwrite the zm.conf default settings. Restart the docker after making your changes. You will have to redo any filter settings. The config/skins directory has been removed. The skins are not persistent across versions.
  15. That's not how UD works. As @trurl said, your setup is not ideal and you need to find another way.
  16. They have the same id. UD can't handle that.
  17. That doesn't make sense. Show me a screen shot.
  18. dlandon

    [support] dlandon - Zoneminder 1.32

    I made the changes to the first post based on your feedback. I have no time to test this at the moment.
  19. That code is only executed when the disk is mounted or unmounted, so I don't think that is it. I don't see anything that could spin up a drive.
  20. That is the command to tell it to sleep after 30 minutes. The problem is the disk spins up with that command. It really shouldn't spin up if it is given a sleep command. I'm not sure what I can do at this point.
  21. I'm going to try one more thing. See if this command spins up the drive: /usr/sbin/hdparm -S180 /dev/sdX
  22. dlandon

    [support] dlandon - Zoneminder 1.32

    It looks like you have an issue with the proxy.
  23. Be sure you are on rc5. There were disk spin up issues on earlier rcs.