Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check QNAP Disk Popular
- Nagios 3.x
- Nagios 4.x
File | Description |
---|---|
check_qnapdisk_1.0.tar.gz | plugin check_qnapdisk |
check_qnapdisk.1.0.1.tar.gz | plugin check_qnapdisk |
check_qnapdisk.1.0.2.tar.gz | plugin check_qnapdisk |
check_qnapdisk_1_0_2.zip | plugin check_qnapdisk |
check_qnapdisk_1_0_4_1.tar.gz | plugin check_qnapdisk |
check_qnapdisk_1_0_4_5.tar.gz | check_qnapdisk_1_0_4_5.tar.gz |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).
'This plugin checks all disk slots on your QNAP NAS host with snmp
and will output OK, UNKNOWN, WARNING or CRITICAL if the resulting
number is over the specified thresholds. Enable on your QNAP NAS
the snmpd (see the QNAP adminguide too).
Usage: check_qnapdisk [-h] [-V] -H hostname [-t timeout] [-r retries]
[-C community] [-p port] [-w warning] [-c critical] [-T C | F ] [-g temp_warning]
[-l temp_critical] [-v verbose] [-d debug] [-M mode]
-?, --usage
Print usage information
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See https://www.monitoring-plugins.org/doc/extra-opts.html
for usage and examples.
-w, --warning=INTEGER,[INTEGER] Maximum number of allowable result,
outside of which a warning will be generated. If omitted, no warning is generated.
-c, --critical=INTEGER,[INTEGER] Maximum number of the generated result,
outside of which a critical will be generated.
-T, --temperature=STRING, Specify to use Celsius (default) or Fahrenheit.
-g, --temp_warning=INTEGER,[INTEGER] Specify the warning maximum degrees.
-l, --temp_critical=INTEGER,[INTEGER] Specify the critical maximum degrees.
-p, --port=INTEGER, Specify the snmp port on the command line, default 161.
-r, --retries=INTEGER, Specify the number of retries the command line, default 2.
-C, --community=STRING, Specify the snmp v2 community name, default public.
-M, --mode=STRING, reads the values from snmp table from mode,
availaible modes are disk, vol[+], cpu[+], fan[+], mem[+], all default: disk.
-H, --host=STRING, Specify the host on the command line.
-d, --debug , enable debug
-t, --timeout=INTEGER
Seconds before plugin times out (default: 15)
-v, --verbose
Show details for command-line debugging (can repeat up to 3 times)
THRESHOLDs for -w and -c are specified 'min:max' or 'min:' or ':max' (or 'max').
If specified '@min:max', a warning status will be generated if the count
*is* inside the specified range.
example : check_qnapdisk -H 'ip-address or
[DNS|host]name' -t 5 -r 2 -C public -p 161 -w 2: -c 1: -T C -g 25 -l 35 -v -M disk
The plugin has been tested with TS-659 Pro, TS-212, TS-464 and TS-664.
The plugin works with QNAP-OS-Versions 5.x, 4.2.x, 4.3.x .
################################################################
# Changelog
################################################################
# Version 1.0.4.5
# 2024.01.25
# changed volumestatus "Checking..." to WARNING
################################################################
# Version 1.0.4.4
# 2023.03.02
# Adaptation to version QTS 5.0.x
################################################################
# Version 1.0.4.3
# 2021.12.14
# rewrite mode switch
# as bugfixes
################################################################
# Version 1.0.4.2
# 2020.01.25
# added mode memory
# some bugfixes
################################################################
# Version 1.0.4.1
# 2018.09.28
# change from cpu-temp to sys-temp
################################################################
# Version 1.0.4
# 2016.03.19
# works with Monitoring::Plugin and Nagios::Plugin
# added warnig if SmartInfoStatus not 'GOOD'
# some new environment features
################################################################
# Version 1.0.3
# 2014.09.30
# version skipped
################################################################
# Version 1.0.2
# 2014.06.10
# added smart info to plugin output
# thanks to
# http://exchange.nagios.org/directory/Reviews/dit_w/1#/
################################################################
# Version 1.0.1
# 2014.02.19
# change some vars from my to our
# thanks to
# http://exchange.nagios.org/directory/Reviews/navi/1
################################################################
# Version 1.0
# 2013.01.19
################################################################
But in a OMD-LAbs machine (nagios-engine) it doesn't work.
Even if I install "perl -MCPAN -e 'install Monitoring::Plugin'" or 'Nagios::Plugin' I receive this error:
root@monitoring:~# /omd/sites/mysite/lib/monitoring-plugins/check_qnapdisk -H my host address -w 4: -c 4: -T C -g 40 -l 45 -v -t 60
Can't locate Nagios/Plugin.pm in @INC (you may need to install the Nagios::Plugin module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /omd/sites/mysite/lib/monitoring-plugins/check_qnapdisk line 24.
BEGIN failed--compilation aborted at /omd/sites/mysite/lib/monitoring-plugins/check_qnapdisk line 24.
Has anyone the same problem?
Thank you.
G.
Hi justLM, thank's for your vote, please try the new version.
Heads up: As http://search.cpan.org/dist/Nagios-Plugin/lib/Nagios/Plugin.pm indicates, you need to search-and-replace "Nagios::Plugin" with "Monitoring::Plugin" in the perl script now.
You also need to perl -MCPAN -e 'install Monitoring::Plugin' instead of "Nagios::Plugin' :D
thanks!
Argument "--" isn't numeric in numeric lt (2, Disk1:ready, Disk2:ready, max. Temperature:37C
=================
Disk 1 Status: ready, SmartInfo: GOOD, Typ: WD20EARS-00MVWB0, Size: 1.82 TB, Temp: 37 C/98 F
Disk 2 Status: ready, SmartInfo: --, Typ: ST2000DM001-9YN1, Size: 1.82 TB, Temp: -- C/-- F
I am new with Nagios and I finally got it up and running Thank God! lol Now, how do we install these types of plugin? I am interested in installing a few including this one since I have a QNAP 4-bays but I don't know what and how to do this! : (
Thanks a lot!
Hi idscomm,
a good way is, see about the documentation of nagios, but a short help you see below:
# you have to define a check command like this:
# 'check_qnapdisk' command definition
define command{
command_name check_qnapdisk
command_line „your_path_to_check_script“/check_qnapdisk -H $HOSTADDRESS$ -C -t 8 -v -w $ARG1$ -c $ARG2$ -T $ARG3$ -g $ARG4$ -l $ARG5$
}
# you have to define a service
# service qnapdisk
define service{
use generic-service ; Name of service template to use
host_name TS-459
service_description QNAPDISK
check_command check_qnapdisk!4:!3:!C!:41!:45 ; your check parameters
notifications_enabled 1
normal_check_interval 1 ; Check the service every 5 minutes under normal conditions
}
Only thing I'm missing is SMART status checking. That's because, as I have found out recently, disk can return status ready when SMART reports fail. The disk is finished but without checking SMART we know of this only when it fails totally and drops out of array.
The OID for this is .1.3.6.1.4.1.24681.1.2.11.1.7.x
I hope the autor will add that functionality.
Thanks!
All (4) our qnap systems are now monitored.
Your work saved me a lot of time.
Thanks Jörg !
my $PROGNAME
my $VERSION
my $np
to:
our $PROGNAME
our $VERSION
our $np
But when I tried to run (the same query) through nagios, I got an error: (Service check did not exit properly)
The problem was with the nagios system account; I had to allow it, to use sudo. After modifying /etc/sudoers and nagios-commands.cfg it did the job.
Since there was no hint to do that, I have to substract 1 point for the style marks.
Tested with Nagios Core 3.2.0 on an Ubuntu 10.04 with a QNAP TS-809U.
Thank you for your achievement.