TECHZEN Zenoss User Community ARCHIVE  

Qnap NAS - SNMP monitoring disk status

Subject: Qnap NAS - SNMP monitoring disk status
Author: Odd Grondalen
Posted: 2020-06-10 08:59

Hi.

I'm running a Zenoss.core 6.2.3 server and are trying to monitor (amongst other things) a qnap NAS system.
So far I've tried the TrueNas zenpack and it's able to monitor for instance the interfaces, and disk usage.
But I'm not able to monitor the disk health.

If I do an snmp walk on this oid:
.1.3.6.1.4.1.24681.1.2.11
The values i'm looking for are returned correctly. 

Any good hints om how to get these disk to for instances appear under "components" and show status good, model nr, capacity,status and temperature?


------------------------------
Odd Grondalen
ICT consultant
trysil
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Michael Rogers
Posted: 2020-06-10 18:33

Hi, Odd!

For any given device, its list of components are generated by that device's modeler plugins.  According to the modeler plugin code included in the TrueNas ZenPack, it only provides plugins for pools ("1.3.6.1.4.1.50536.1.1.1") and datasets ("1.3.6.1.4.1.50536.1.2").  

If you have specific OIDs that you can poll, you may be able to create a new device level template and add those OIDs as new data sources.  It won't be as elegant as having those disks listed as discrete components, but it could get you more of what you're looking for.  

To do it correctly would require new modeler plugins, which the original ZenPack author may be interested in adding.  If you're handy with Python, you may even extend the pack by writing them yourself!  The ZenPack SDK has some tutorials to get new ZenPack developers started.

(If you decide to go that route, you might want to talk with the original author, first.  I didn't find any license information in the ZenPack and I can't really advise anyone to go fork some code without knowing how the author feels about that.)

Hope that helps!


------------------------------
Michael J. Rogers
Senior Instructor - Zenoss
Austin TX
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Odd Grondalen
Posted: 2020-06-11 03:12

Thanks for your reply. 
Honestly, I was hoping for an answer like "you can just use zenpack xxx" :-)


I started looking into the development of a zenpack but it seems a bit overkill, but if time allows it I might give it a try. But using the other zenpack as a reference would of course make it easier.
If I end up doing that, I'll be sure to contact the author.

We also have a UPS where the data could be graphed, so in that case, I could easily add the required OID's to a monitoring template and a graph it.
But displaying "good" in a graph doesn't seem like a good idea...

Anyone out there that has working monitoring of a qnap NAS with disk status?

------------------------------
Odd Grondalen
ICT consultant
trysil
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Arthur
Posted: 2020-06-11 07:24

Hi Odd

Maybe using the Nagios Plugin could be a possible solution.

------------------------------
Arthur
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Odd Grondalen
Posted: 2020-06-12 01:53

Can Nagios plugins be used in Zenoss?
How?

I see there's a page here:
http://wiki.zenoss.org/Working_With_Nagios_Plugins
I'll read through that one:-)

Are there any other "nice to know" articles about this? 
Did not know they could be used in Zenoss.. ​

------------------------------
Odd Grondalen
ICT consultant
trysil
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Laurent Hemeryck
Posted: 2020-06-12 03:41

The Nagios plugins won't help you to model the device and discover the disks.

------------------------------
Laurent Hemeryck
Monitoring Engineer
FedNot
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Arthur
Posted: 2020-06-13 11:00

That's correct Laurent, they won't help you to model the devices but acc. to the documentation  it would help you to check the disks and creating an event if one fails. In addition you  could use other return  values to create graphs and then set  threshold. So depending what you would like to achive with it, it could work for you or not.

Nagios plugins can be used with the ZenCommand template. See
https://help.zenoss.com/zsd/RM/administering-resource-manager/basic-monitoring/monitoring-using-zencommand/plugin-format-for-zencommands


------------------------------
Arthur
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Arthur
Posted: 2020-06-13 11:13

@Odd, the  ​wiki matches for Zenoss V4. For V5/6 you have to install the script into the zope container and  commit it to make the change "Semi-Permanent". See  this discussion.

Take a note at Jays comment. This change will be lost at the next upgrade.

PS: I'm using a small script which I run after such an upgrade which installs all my changes in one shot and it works perfect.

------------------------------
Arthur
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Odd Grondalen
Posted: 2020-06-15 13:03

Hi again, sorry for the late reply.
I've been trying my best to develop a zenpack for this, and though I was off to a good start I'm soon realizing I'm over my head...

So I think I'll be focusing my efforts from now on getting the nagios plugin to work instead :-)
I'm able to run the nagios commands from the command line, so hopefully, the rest should be possible to figure out.

Thanks a lot for your input. 



------------------------------
Odd Grondalen
ICT consultant
trysil
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Arthur
Posted: 2020-06-17 06:25

Hi Odd

Some code which could eventually help you.

#Create a backup in ContolCenter

# as root on the zenoss master
mkdir /tmp/nagios

# copy the plugin to /tmp/nagios
cp check_qnap /tmp/nagios

# cd into /tmp/nagios
cd /tmp/nagios

# chmod 755 the plugin
chmod 755 check_qnap

# create a variable for later use
mynew=InstallNagiosPlugin

# start a new zope container with a rw layer
serviced service shell -s $mynew -i zope

# copy the plugin to /usr/lib64/nagios/plugin
# /mnt/pwd is important
cp /mnt/pwd/check_qnap /usr/lib64/nagios/plugins
chmod 755 /usr/lib64/nagios/plugins/check_qnap

# exit the container
exit

# commit the changes
serviced snapshot commit $mynew

# record the snapshot ID

# restart Zenoss. Some do only rstart zope.

# if all is ok you can remove the snapshot
serviced snapshot list
serviced snapshot remove <snapshot_id>

------------------------------
Arthur
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Michael Rogers
Posted: 2020-06-17 12:04

Arthur is absolutely on point, but I wanted to add in my $0.02:

# restart Zenoss. Some do only rstart zope.

If the plugin is to be accessible from zencommand containers, they'll need a restart, too.  At this point in the instructions, they'll still be running on the original Docker image and won't have the filesystem layer with the new Nagios plugin.  After restarting, they'll pull the updated image and the plugin will be available to them.

This also ties back to Arthur's comment that these changes will be lost when you upgrade.  New versions of Zenoss Core come with new Docker images which will replace the image you updated in these instructions.

------------------------------
Michael J. Rogers
Senior Instructor - Zenoss
Austin TX
------------------------------


Subject: RE: Qnap NAS - SNMP monitoring disk status
Author: Arthur
Posted: 2020-06-21 01:16

Hi Michael

Thanks for the helpful comment.

------------------------------
Arthur
------------------------------


< Previous
Zenoss Core 6.3.2 ZenPack install with service and external dependency
  Next
Download zenpack .egg files
>