Hardware RAID monitoring daemon sample
This is a sample of the daemon program for monitoring the hardware RAID status.
This is a sample program that monitors the status of hardware RAID using CoGetRaidStatus and CoGetRaidProgress.
* The following information is for building and installing from source.
install
Please refer to the following contents when you install separately. You need to install the library in advance.
- After starting the console and moving to the cohwraidmond directory, execute the "make" command to create the object file and executable file.
$ cd ./(cohwraidmond directory)
$ make
→ ./cohwraidmond, ./cohwraidmond.o
- When "make install" is executed, files are extracted to a directory. (Requires root privileges.)
The RAID status is acquired in the specified monitoring cycle, and the RAID status information is output to syslog when the status changes. (The minimum monitoring cycle is 10 seconds (default setting: 1800 seconds). For details, refer to the source code of the sample program.)
$ make install
- Running "make service_start" (or "systemctl start cohwraidmond") will start the daemon.
It is also set to run automatically at startup when you run "make service_start" ("systemctl enable --now cohwraidmond").
$ make service_start
* This daemon is set as "cohwraidmond".
* When "SIG_USR1" is sent to the process, the RAID status is acquired and updated regardless of the monitoring cycle setting. It also outputs the RAID status to syslog. At this time, the timer count of the monitoring cycle is not cleared.
$ kill -USR1 `pgrep cohwraidmond`
uninstall
To uninstall, execute "make service_stop" to stop the daemon, and then use "make uninstall" to delete the extracted files in each directory.(Requires root privileges.)
$ make service_stop
$ make uninstall
* Use systemd to manage this daemon.
* When changing the settings, manually edit the settings file appropriately and restart the daemon.
* For details of this sample daemon, refer to the program source and the contents of each script file.
Others
cohwraidmond.conf
- The default value is a temporary value. Please change and use as appropriate.
- The contents of the configuration file are read as environment variables when the daemon is started, and are treated as execution options for "cohwraidmond". For more information, see the contents of "cohwraidmond.service" and the execution options for "cohwraidmond".
■ cohwraidmond.config
# cohwraidmond config
# target device (/dev/sd[a-z]), polling interval[sec.]
# --interval/-i option
# (min. 10[sec.] - max. depends on int size on the system(positive integer))
interval_timer="1800"
# target device /dev/sd[a-z] (Only one device allowed)
raid_dev="/dev/sda"