Anyone using the qnap_health community plugin?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
rj-admin2
Posts: 34
Joined: Thu Apr 11, 2024 1:16 am

Anyone using the qnap_health community plugin?

Post by rj-admin2 »

I'm trying to use the community plug "qnap_health" to monitor our QNAP NAS devices via SNMP. The issue I'm having is that although I can successfully run the script from our Nagios XI server CLI, I don't seem to be able to get the script to run within Nagios XI. I keep getting the error "Unknown Part!" displayed. I have also run the service check using Nagios' Run Check Command. It runs perfectly fine there too.

Anyone have any ideas?

TIA.
rj-admin2
Posts: 34
Joined: Thu Apr 11, 2024 1:16 am

Re: Anyone using the qnap_health community plugin?

Post by rj-admin2 »

Sorry should have mentioned, I've setup the command within Nagios XI as follows:

$USER1$/qnap_health -H $HOSTADDRESS$ -V 3 -P 161 -l authPriv -u 'snmp-user' -a MD5 -A 'MD5Pass' -x DES -X 'DESPass' -p $ARG1$ -w $ARG2$ -c $ARG3$

Like I mentioned previously, If I run the above command from the Nagios server CLI and manually supply the arguments, the script works and returns what I would expect to see. When the arguments are supplied as part of the service definition/setup within Nagios, the error occurs. It's almost like $ARG1$ doesn't get passed to the script.

TIA.
swolf

Re: Anyone using the qnap_health community plugin?

Post by swolf »

Hi @rj-admin2, thanks for reaching out.

Part of me wonders if there are formatting issues in the command - maybe you have an unterminated quote in $ARG1$ or one of your other macros? Is it possible that a quote was replaced by something that looks like a shell quote but isn't (like one of the unicode directional quotes)?

You have a couple of things you can do to troubleshoot - one would be going into the CCM for this service and testing the command directly. When editing the service, the "Run Check Command" button will show you the full terminal command that runs, which should make it clear if any of the ARG macros (or other macros) were mistyped.

The other thing you could do is temporarily backup your qnap_health script, and replace it with a debugging script. I'm thinking something like

Code: Select all

#!/bin/bash
echo $@
exit 0
If for some reason the Run Check Command button didn't match your behavior, you could look at the output of this script and see if anything was amiss when Nagios Core runs the command.

Hopefully one of these approaches is fruitful - please let me know how it turns out, if you get stuck, or if you have any other concerns
-Sebastian
rj-admin2
Posts: 34
Joined: Thu Apr 11, 2024 1:16 am

Re: Anyone using the qnap_health community plugin?

Post by rj-admin2 »

Hi,

Many thanks for the reply.

I have managed to get the script working fully for 2 of the QNAPS devices and partially working for another 2 QNAPS. It seems the script may not be as generic as I thought it would be. The 2 partially working QNAPS are not displaying Disk Usage stats.


TIA.
Post Reply