Skip to main content
Solved

How to monitor disk status on a Qnap NAS

  • May 7, 2025
  • 52 replies
  • 440 views

Show first post

52 replies

Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 21, 2025
I'm making progress thanks to you: from the Centreon server, the nmap command tells me that port 5666 is not open on my remote CentOS

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 21, 2025
on the server to be monitored, the nrpe daemon is active
 

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 21, 2025

for the question asked, telnet cannot reach the host

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 21, 2025

That's it, port 5666 is listening. Phew (and thanks!). My last issue is syntax-related, I think. The service tells me that the "test.txt" file is not present on my server to be monitored (/mnt/save_bali/test.txt). Attached is the result of the command from Centreon and from the interface.

 

 


Forum|alt.badge.img+17
  • Centreon Lord Commander
  • May 21, 2025

hmm you are not running a command, your first parameter is the plugin folder (on the screenshot), that’s why you get an error message, this is saying you execute a folder, not a command…

 

next, I think you want to use the “is file” not the “is not file”

this are the default values for the service template, do not remove the command

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 22, 2025
Hello Christophe,By modifying as follows, the command still doesn't execute.

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 22, 2025
I'm making progress in my research. I've created the following command:

 

and the result of the execution:

 


Forum|alt.badge.img+17
  • Centreon Lord Commander
  • May 22, 2025

you can stay on the shell to debug now with this command

nrpe needs some command line option to work, and also some config on the host you want to monitor

that error is usually because there are some ssl config to do in the nrpe.cfg of the host

 

at this point I have no idea how you installed the nrpe daemon on the centos host. if you installed it following the centreon documentation the nrpe.cfg sould be correctly configured

I think mostly that step 2 in this procedure : Linux NRPE4 | Centreon Documentation, the first line with “sed” for the “dont blame nrpe” settings (if you google your error message most of the error I can see since 10 years ago are for that parameter)

 

after that, it’s outside what I can do to help you, I have no idea how to configure ssl on nrpe, all I know is you can disable the ssl on the command check with “-n” for “no ssl”


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 22, 2025
I have a serious doubt:Is the IP address of POLLER_IP_ADDRESS the same as my Centreon server?sed -i 's/allowed_hosts=127.0.0.1,::1/allowed_hosts=POLLER_IP_ADDRESS/' /etc/nagios/nrpe.cfg

Forum|alt.badge.img+17
  • Centreon Lord Commander
  • May 22, 2025

REPLACE…

 

the default ip address allowed is 127.0.0.1, that “sed” command replace the content of the file from 127.0.0.1 to the ip of your poller/central you need to input


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 23, 2025
Hello Christophe,In the same vein, you can discover partitions and monitor space usage with the rule "OS-Linux-NRPE4-Disk-Name".I tried, but the result is "execute command failed".Here is a screenshot of the settings.
Should I indicate the values?

Forum|alt.badge.img+17
  • Centreon Lord Commander
  • May 23, 2025

“execute command failed” is almost always a configuration issue/missing installation steps, not a parameter issue

you need to generate a command, copy it from the ui (from the detail panel) and run it in the shell to see what is the error you get


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 23, 2025

in desperation, I turn to the "chek_by_ssh" plugin.

but the problem probably comes from the syntax because the result received is "0" (whether or not the test.txt file is there).

Additionally, I copied the public key so that SSH commands no longer require a password, but the password is still requested from console mode.

Best regards,


Forum|alt.badge.img+17
  • Centreon Lord Commander
  • May 23, 2025

remember that the ssh key is in the user “centreon-engine” not “root”, you shoud do a “su - centreon-engine”  to be in the same “environnement” to run the check command

the check by ssh will run a command on the remote host, as said in a post above

you want to run something, like “ls yourfile”, ls will return 0 if the file exists and 2 if the file is not present

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • May 23, 2025

Indeed, the behavior of the "centreon-engine" user is different. Thanks for the tip. I'm having trouble getting the result to show me an alert if the iSCSI link isn't mounted. Should I create a command from "configuration/commands/checks" with the "check_by_ssh" command line, or should I go directly through a "service by hosts" using the "OS-Linux-Is-Not-File-Generic-NRPE4" template?

Best regards,


Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 12, 2025
Hello Christophe,I'd like to come back to my question: in console mode with the user "centreon-engine" to test the presence of a specific folder on my remote server, I'm trying to use this command line:
But it seems there's a syntax error.Do you have any ideas, please?Best regards

Forum|alt.badge.img+17
  • Centreon Lord Commander
  • June 12, 2025

you use “plugin=...” it says in the error to use “--plugin=...” 

the first paramter after the .pl command


Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 16, 2025
Hello Christophe,Indeed, there was a syntax error.Using the "OS-Linux-Cmd-Return-SSH" template, what options can I specify to check for the presence of a folder named \mnt\save_bali?
Thank you for your help.

Forum|alt.badge.img+17
  • Centreon Lord Commander
  • June 16, 2025

you could try a simple ls command

 

exec command: ls

exec command option: /mnt/save_bali

 

by default ls return 0 (ok) if the folder/file exist, and 2 (not ok) if the file/folder is not present

 

so in the Manage Return macro, you can put that (based on the --help of the command): 

%(code) == 0,OK,File xxx exist#%(code) == 2,CRITICAL,File xxx not exist#,UNKNOWN,Command problem

 

 

try the command with a fake folder and an existing to see if it workd


Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 16, 2025
The SSH keys were exchanged, but still, I have this error message:

 


Forum|alt.badge.img+17
  • Centreon Lord Commander
  • June 16, 2025

I can’t help you more on this subject, I have no idea why your setup is not working. I have no idea why the user on the poller “centreon-engine” is not connecting on the remote host, you can see you have a parameter “ssh-username”


Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 16, 2025
Is this where the variables should be indicated?

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 16, 2025
I'm making progress thanks to your guidance.This problem remains:
With "centreon-engine" I have this result:
but by editing from the Centreon interface:
the variables "ssh-username" and "ssh-priv-key" do not appear:

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 16, 2025
Hooray,It works by copying the command.
Thank you for your patience.

Forum|alt.badge.img+5
  • Author
  • Steward **
  • June 17, 2025
Hello Christophe,Last question regarding my problem:- I ran a "no iscsi link" test. The returned command is indeed "2," but it still appears as UNKNOWN and not "CRITICAL" as I expected.
 
- Is there a solution to specify the variable corresponding to the IP address of my monitored device?Thanks for your help.Eric