Hello,
I'm trying to monitor number of files in some folder using script check_files (default script with installation nsclient++, author of script is werner.fuerst@assmann.at 2010-12-21), but without success. Can somebody help me how should I configure NSC.ini properly in order to recognise command from nagios? And also maybe I'm using wrong script, so If somebody have a good one, pls notice that or send me.
This is what I put in nsc.ini:
[Wrapped Scripts]
check_files=check_files.vbs
Command that I tried from Nagios directly from folder libexec:
./check_nrpe -H 192.168.99.107 -t 30 -c check_files -a path='E:\\TEST' pattern=*.* 'warning=count>5' 'critical=count>10' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
I got this:
0
Usage: check_files /path:<value> [/namefilter:<value>] [/age:<value>] [/selage:<value>] [/searchdepth:<value>] [/seldat:<value>] [/size:<value>] [/warning:<value>] [/critical:<value>] [/expectmatch:<value>] [/weekdays:<value>] [/alias:<value>]
/path Path
[/namefilter] Filename Filter
[/age] Age
[/selage] newer, older, hour, ignore
[/searchdepth] depth of subdirs to search
[/seldat] modified or created
[/size] size
[/warning] warning threshold
[/critical] critical threshold
[/expectmatch] expect at least x matches
[/weekdays] 1,2,3,... 1-Sun 2-Mon 3-Tue...
[/alias] Alias
Nsclient++ 0.3.9.327 - check_files script
Re: Nsclient++ 0.3.9.327 - check_files script
There is a difference in the check_files.vbs plugin found here:
https://exchange.nagios.org/directory/P ... nt/details
And the native check_files command for NSClient++:
https://docs.nsclient.org/reference/win ... heck_files
You seem to be confused about which one you're hitting. In your command example, you're clearly hitting the check_files.vbs script yet seem to be passing native NSClient++ check_files command arguments. Which one would you like to use?
If you would like to use check_files.vbs, I would suggest passing arguments (via -a) that are accepted by that script. Additionally, altering your wrapping to actually accept arguments as demonstrated in this documentation:
https://docs.nsclient.org/howto/external_scripts/
If you would like to use the native NSClient++ check_files command, I would suggest not aliasing it to check_files.vbs in your NSC.ini file.
https://exchange.nagios.org/directory/P ... nt/details
And the native check_files command for NSClient++:
https://docs.nsclient.org/reference/win ... heck_files
You seem to be confused about which one you're hitting. In your command example, you're clearly hitting the check_files.vbs script yet seem to be passing native NSClient++ check_files command arguments. Which one would you like to use?
If you would like to use check_files.vbs, I would suggest passing arguments (via -a) that are accepted by that script. Additionally, altering your wrapping to actually accept arguments as demonstrated in this documentation:
https://docs.nsclient.org/howto/external_scripts/
If you would like to use the native NSClient++ check_files command, I would suggest not aliasing it to check_files.vbs in your NSC.ini file.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nsclient++ 0.3.9.327 - check_files script
I agree with mcapra
I think with the syntax you have you should remove this line form the config
and restart nsclient
I think with the syntax you have you should remove this line form the config
Code: Select all
check_files=check_files.vbs
Re: Nsclient++ 0.3.9.327 - check_files script
I'm pritty confused about this, you right. Just now, thanks to you, I find out there are two ways for same check. But, when I remove this line from nsc.ini (check_files=check_files.vbs) I got this:
UNKNOWN: No handler for that command
But also in nsci.ini in secton [External Alias] I can see this line:
alias_file_size=CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10
And I tried this command but I only got message "Parsing failed:"
./check_nrpe -H 192.168.99.107 -t 30 -c CheckFiles -a path='E:\\TEST' 'MaxWarn=count>5' 'MaxCrit=count>10' syntax='${status}: ${problem_count}/${count} files'
Parsing failed:
I only want to count all files in folder and there is no files, then would be green service with OK state.
Any idea, pls
UNKNOWN: No handler for that command
But also in nsci.ini in secton [External Alias] I can see this line:
alias_file_size=CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10
And I tried this command but I only got message "Parsing failed:"
./check_nrpe -H 192.168.99.107 -t 30 -c CheckFiles -a path='E:\\TEST' 'MaxWarn=count>5' 'MaxCrit=count>10' syntax='${status}: ${problem_count}/${count} files'
Parsing failed:
I only want to count all files in folder and there is no files, then would be green service with OK state.
Any idea, pls
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nsclient++ 0.3.9.327 - check_files script
Can you attach your whole nsc.ini ? (obfuscate any sensitive data)
Re: Nsclient++ 0.3.9.327 - check_files script
Yes, file is attached. Thanks
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nsclient++ 0.3.9.327 - check_files script
Is there any possibility to upgrade your version of nsclient to a newer version, as this version is so old the documentation has been completely removed from their servers
Re: Nsclient++ 0.3.9.327 - check_files script
Everything is fine now, after installation a new version of nsclient NSCP-0.5.2.3.
Thank you very much for help!
Thank you very much for help!
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nsclient++ 0.3.9.327 - check_files script
Great! Glad to hear it!bvladan wrote:Everything is fine now, after installation a new version of nsclient NSCP-0.5.2.3.
Thank you very much for help!
Locking thread