diff --git a/Changes b/Changes index d157c73..a44e70c 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,10 @@ address to the built-in HTTP server. [#14] - Added the ability to specify an optional host address for the built-in HTTP server to bind to. [#19] +- Added a new option in the 'disk' graph called 'accept_invalid_disk' that + permits continue working even if some of the device names defined are invalid + or non-existent. This is specially useful to monitor external disks that + aren't permanently connected to the system. - Updated the 'monitorix.service' file. [#20] (thanks to Christopher Meng, rpm AT cicku.me) - Fixed a bug that prevented seeing the Core temperatures in the 'lmsens' graph. diff --git a/lib/disk.pm b/lib/disk.pm index b0ef741..aa10c19 100644 --- a/lib/disk.pm +++ b/lib/disk.pm @@ -43,8 +43,11 @@ sub disk_init { $d =~ s/\"$//; $d =~ s/^(.+?) .*$/$1/; next if -e $d; - logger("ERROR: $myself: invalid or inexistent device name '$d'."); - return; + logger("$myself: ERROR: invalid or inexistent device name '$d'."); + if(lc($disk->{accept_invalid_disk}) ne "y") { + logger("$myself: 'accept_invalid_disk' option is not set."); + return; + } } } } diff --git a/man/man5/monitorix.conf.5 b/man/man5/monitorix.conf.5 index 850e8b8..576d7d9 100644 --- a/man/man5/monitorix.conf.5 +++ b/man/man5/monitorix.conf.5 @@ -680,6 +680,15 @@ If you see good results as above, you can add it to the group 0 like this: .P The maximum number of disk device names allowed per group is 8. .RE +.P +.BI accept_invalid_disk +.RS +During the init stage this graph verifies that every defined device name does exist in the system. If not, then the graph disables itself. +.P +This option changes this behavior and permits to continue working even if the device names defined doesn't exist. Keep in mind that you will continue seeing error messages in the logfile. +.P +Default value: \fIn\fP +.RE .SS Filesystem usage and I/O activity (fs.rrd) This graph is able to monitor an unlimited number of filesystems. .P