Nagios Monitoring for QNAP

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
Brick
New here
Posts: 2
Joined: Wed Sep 18, 2013 9:38 pm

Nagios Monitoring for QNAP

Post by Brick »

I am writing a Nagios plugin to monitor our TS-809U

There are some existing ones out there but some do not work on this model and I am hoping to combine them all together into one plugin.

I am using SNMP to gather the information, memory, cpu, fans etc are all fairly streight forward but I'm having some issues with the Drive Space.

There are SNMP checks for-

Code: Select all

HOST-RESOURCES-MIB::hrDeviceDescr.1552 = STRING: SCSI disk (/dev/sda)
HOST-RESOURCES-MIB::hrDeviceDescr.1553 = STRING: SCSI disk (/dev/sdb)
HOST-RESOURCES-MIB::hrDeviceDescr.1554 = STRING: SCSI disk (/dev/sdc)
HOST-RESOURCES-MIB::hrDeviceDescr.1555 = STRING: SCSI disk (/dev/sdd)
HOST-RESOURCES-MIB::hrDeviceDescr.1568 = STRING: RAID disk (/dev/md0)
And their maximum capacities-

Code: Select all

HOST-RESOURCES-MIB::hrDiskStorageCapacity.1552 = INTEGER: 488386584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.1553 = INTEGER: 488386584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.1554 = INTEGER: 488386584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.1555 = INTEGER: 488386584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.1568 = INTEGER: 1460452800 KBytes
But there doesnt appear to be any checks to show how much of this is in use- despite the information being shown in the GUI... am I missing something?

The only usage level I can find is this-

Code: Select all

HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: /sys
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: /tmp
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /mnt/ext
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: /mnt/HDA_ROOT
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /share/MD0_DATA
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /.eaccelerator.tmp

HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 8192
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 79348
HOST-RESOURCES-MIB::hrStorageSize.5 = INTEGER: 130421
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 359384007
HOST-RESOURCES-MIB::hrStorageSize.7 = INTEGER: 8192

HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 23
HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.4 = INTEGER: 11200
HOST-RESOURCES-MIB::hrStorageUsed.5 = INTEGER: 4388
HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 225674788
HOST-RESOURCES-MIB::hrStorageUsed.7 = INTEGER: 0
This is showing the sizes of folders on the NAS with their max size and size in use... What I don't want to happen is for me to setup a script that checks the /share/ folder and then discover that its possible for data to grow outside of this folder and for my check to return a false result. Is all of the data stored on the device always put in this /share/ folder?

Any thoughts or ideas or other OID's I could use? Any idea what those other folders do?
Brick
New here
Posts: 2
Joined: Wed Sep 18, 2013 9:38 pm

Re: Nagios Monitoring for QNAP

Post by Brick »

Also- does anyone out there have a NAS that currently has a failed drive or other error?

I'd like to see what the snmp data looks like when its reporting drive failures...
HelmutR
Starting out
Posts: 15
Joined: Tue Oct 08, 2013 1:58 am

Re: Nagios Monitoring for QNAP

Post by HelmutR »

If you want to give it a try:

http://www.charlieroot.de/downloads/check_snmp_qnap.pl

Should work with all models supporting SNMP.

Sample output:

[helmut@BSDHelmut ~]$ sudo /usr/local/libexec/nagios/custom/check_snmp_qnap.pl -H qnap569pro -a
OK - All monitored parameters within limits
[helmut@BSDHelmut ~]$ sudo /usr/local/libexec/nagios/custom/check_snmp_qnap.pl -H qnap569pro -ct 30,35
CRITICAL - CPU TEMP - CPU Temperature is CRITICAL: CPU 1 (44°C >= 35°C)
[helmut@BSDHelmut ~]$ sudo /usr/local/libexec/nagios/custom/check_snmp_qnap.pl -H qnap569pro -a -VVV
OK - CPU Temperature is OK: CPU 1 (44°C), CPU Usage is OK: CPU 1 (1%) - CPU 2 (3%) - CPU 3 (1%) - CPU 4 (3%) - CPU total (2%), Disk Volume Health is OK: Volume 1 (Ready), Disk Volume Usage is OK: Volume 1 (97.78% of 14.43TB left), Disk Smart Status is OK: Disk 1 is GOOD - Disk 2 is GOOD - Disk 3 is GOOD - Disk 4 is GOOD - Disk 5 is GOOD, Disk Temperature is OK: Disk 1 (34°C) - Disk 2 (34°C) - Disk 3 (35°C) - Disk 4 (35°C) - Disk 5 (34°C), Memory Usage is OK: Memory 1 (58.13% of 985.30MB left), System Fan Speed is OK: Fan 1 (556 RPM), System Temperature is OK: Sensor 1 (38°C), System: QNAP Turbo NAS TS-569 Pro, Volumes: [RAID5 Disk Volume: Drive 1 2 3 4 5], Disks: Disk 1 is ST4000VN000-1H41 - Disk 2 is ST4000VN000-1H41 - Disk 3 is ST4000VN000-1H41 - Disk 4 is ST4000VN000-1H41 - Disk 5 is ST4000VN000-1H41, Firmware: 4.0.2, Software: 4.0.2
[helmut@BSDHelmut ~]$
dulcifium
Been there, done that
Posts: 720
Joined: Fri Oct 23, 2009 6:52 pm

Re: Nagios Monitoring for QNAP

Post by dulcifium »

Was a QPKG ever finished?
QNAP TS-639 Pro (3.8.1 Build 20121205) | 6 x 3 TB (Toshiba DT01ACA300 firmware MX6OABB0) | 12 TB RAID-6
Both shared over single port GbE and wifi router to Linux, Android, Windows, macOS and NVIDIA Shield
Dr.Rask
First post
Posts: 1
Joined: Fri Dec 14, 2018 8:01 pm

Re: Nagios Monitoring for QNAP

Post by Dr.Rask »

Hi HelmutR

The script is really good, although we had to modify it for it to sort the keys the right way.

We noticed that when we physical removed "Disk 3" from the Qnap enclosure (TS-1253BU-RP) Then the script output said "Disk 6 N/A"

We did modify the
foreach my $index (sort keys % lines to foreach my $index (sort { $a <=> $b } keys %

after that the script works with the sorting issue and the right Disk got the status N/A

Thanks alot again HelmutR
User avatar
Toxic17
Ask me anything
Posts: 6477
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: Nagios Monitoring for QNAP

Post by Toxic17 »

I ended up using NemsLinux since it is based on Nagios Core but has tons more options and features. Runs on Rasberry Pi, Pine64 or ODROID SBC's more info here: https://nemslinux.com/
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
User avatar
Toxic17
Ask me anything
Posts: 6477
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: Nagios Monitoring for QNAP

Post by Toxic17 »

NemsLinux has now been ported to a Virtual Appliance build in three formats.

OVA, VHD and QCOW2 builds.

More over here: https://nemslinux.com/download/nagios-v ... liance.php

I have not installed any of this on my NAS as yet but the OVA/vhd should work without any issues. the QCOW2 may work but the file extension needs to be renamed.
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
ApPzLaNd
New here
Posts: 5
Joined: Sun Aug 09, 2009 5:05 pm

Re: Nagios Monitoring for QNAP

Post by ApPzLaNd »

Hello all,

thanks for pointing out NEMSLinux even if the post was a few years ago....
I imported it and it runs fine on QNAP TS-453A with V5.xx
All ready put together and tops equipped. I've been doing Nagios for years, but this distro completely passed me by. Surely for the masses a very big help not to run everything themselves in a VM or as Docker on the QNAP.
For this NEMS gets a PUSH from me 8)
Greetings
Post Reply

Return to “Miscellaneous”