Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check QNAP Disk Popular

Rating
16 votes
Favoured:
5
Current Version
1.0.4.1
Last Release Date
2018-09-28
Compatible With
  • Nagios 3.x
  • Nagios 4.x
Owner
License
GPL
Hits
101286
Files:
FileDescription
check_qnapdisk_1.0.tar.gzplugin check_qnapdisk
check_qnapdisk.1.0.1.tar.gzplugin check_qnapdisk
check_qnapdisk.1.0.2.tar.gzplugin check_qnapdisk
check_qnapdisk_1_0_2.zipplugin check_qnapdisk
check_qnapdisk_1_0_4_1.tar.gzplugin check_qnapdisk
check_qnapdisk_1_0_4_5.tar.gzcheck_qnapdisk_1_0_4_5.tar.gz
Nagios CSP

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!
This plugin checks all disk slots on your QNAP NAS host with snmp and will output OK, WARNING or CRITICAL if the resulting number is over the specified thresholds. Enable on your QNAP NAS the snmpd (see the QNAP adminguide too).
This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
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
################################################################
Reviews (10)
byjustLM, April 28, 2020
In some monitoring machines works fine.
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.
Owner's reply

Hi justLM, thank's for your vote, please try the new version.

on my QNAP TS-853A 8-bay I just went to control panel and enabled SNMP.

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!
Adding the QNAP TS-1279U-RP to the list of compatible devices.
Get the following error when a drive has failed

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
byidscomm, December 17, 2015
Hey guys,

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!
Owner's reply

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
}

byelia, September 23, 2014
Works well also on TS-869 PRO
bydit_w, April 1, 2014
1 of 1 people found this review helpful
This is the most informative plugin for checking qnap that I have found and also the most flexible (allows to set snmp port for example)
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!
byDocAndreas, September 23, 2013
1 of 2 people found this review helpful
This plugin worked immediately after downloading.
All (4) our qnap systems are now monitored.
Your work saved me a lot of time.

Thanks Jörg !
bynavi, September 13, 2013
2 of 2 people found this review helpful
To get rid of "(Service check did not exit properly)" you need to change var type from:

my $PROGNAME
my $VERSION
my $np

to:

our $PROGNAME
our $VERSION
our $np
byronator, August 20, 2013
2 of 2 people found this review helpful
This plugin is written in perl and when I executed it on the CLI, it worked like a charm!
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.