Moxa TC-6110-LX [51/117] Handling an event with mxhtspd moxa hot swap daemon

Moxa TC-6110-LX [51/117] Handling an event with mxhtspd moxa hot swap daemon
TC-6110 Linux User's Manual Managing Communications
3-33
-l [FACILITY_LEVEL]: the facility level is used to specify what type of program is logging the message.
This enables rsyslog to handle messages from different facilities (e.g., FTP, UUCP, cron, etc.) in different
ways.
-v: run in verbose mode
-h: show command help / print command arguments
The following example shows how to use the v option to modify
/etc/init.d/mxhtspd.sh:
start)
echo "Starting mxhtspd daemon..."
sleep 1
mxhtspd -v &
The mxhtspd daemon also provides the capability to monitor partition usage. You can configure the
/etc/mxhtspd/mxhtspd.conf file to monitor a configured mount point like /media/disk1p1. Note that
diskNpM is the M
th
partition of hotswap disk N.
An example of mxhtspd.conf is shown below:
#mount point usage limit(%)
/media/disk2p1 90
/media/disk1p1 90
With the setup above, once more than 90% of partition 1 on either drive 1 or drive 2 is allocated, a
(user-defined) event will be triggered.
Handling an Event with mxhtspd: Moxa Hot-Swap Daemon
mxhtspd is automatically triggered whenever one of the following events occurs:
1. A block storage device module is plugged into a drive slot
2. The X1 button on the spine of a drive module is pressed
3. A drive is removed without being properly unmounted
4. A monitored partition has reached or is over a specified allocation limit; or it does not exist
These events are explained in more detail below.
1. A block storage device is plugged into the drive slot
When drive N with M partitions has been plugged in, the system will automatically mount its partitions on
/media/diskNpM, where M ranges from 1 to M. For example, if disk 1 has two partitions, they would be
mounted on
/media/disk1p1 and /media/disk1p2.
The script action-disk-plugged.sh will be called by mxhtspd with the appropriate drive number. The
action-disk-plugged script will run a scan on the drive, and users may append operations here if they wish.
Use the mount command to return the currently mounted partitions; the code below shows (in red) what
2 mounted drives, each with 2 partitions, will look like when mounted in a standard configuration.
moxa@Moxa:~# mount
rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
/dev/hda1 on / type ext2 (ro,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,relatime,mode=755)
usbfs on /proc/bus/usb type usbfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)

Содержание

Похожие устройства

Скачать