Page 2 of 3

Re: Folder Watch Wizard

Posted: Thu Mar 24, 2016 4:01 am
by Bone8Head
rkennedy wrote:This sounds like a configuration issue on the Bitvise SSH side. You may need to create a shell access type for the nagios user on the Windows side.

As I asked in my previous response, Is using NSClient++ an option to check this folder, rather then checking by ssh?
Ok, I resolved the First problem on the Bitvise SSH Server (I Opened the Shell Access Type).
On Nagios now when I try to SSH in to the Server, it work properly.

Code: Select all

[root@nagiosfe /]# ssh [email protected]
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\xxx>
But when I do the Folder Watch Wizard on Nagios XI, the problem is still the same:

Code: Select all

UNKNOWN ERROR - execution of ssh 10.210.1.20 ls -lA Nagios -R resulted in an error 65280 -
The Service Code is the following (Nagios is a shared folder):

Code: Select all

check_file_size_age!-C 'ssh $HOSTADDRESS$ ls -lA Nagios' -F '[^\0]+' -r! -a 300,600
I tried to edit the code with the Following:

Code: Select all

check_file_size_age!-C 'ssh Nagios_test@$HOSTADDRESS$ ls -lA Nagios' -F '[^\0]+' -r! -a 300,600
But the error is still the same.

Any advice?

Re: Folder Watch Wizard

Posted: Thu Mar 24, 2016 10:31 am
by rkennedy
Once you are SSH'd on to the machine, what is output of ls?

Re: Folder Watch Wizard

Posted: Thu Mar 24, 2016 11:29 am
by Bone8Head
rkennedy wrote:Once you are SSH'd on to the machine, what is output of ls?

Code: Select all

C:\Users\xxx>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.

Re: Folder Watch Wizard

Posted: Thu Mar 24, 2016 3:25 pm
by rkennedy
It looks like your SSH session is looking for windows commands, and not linux. You'll need to alter your folder check accordingly, my guess is by using some kind of form of the dir command.

As I previously mentioned, this wizard is intended for Linux. The better use for what your doing may be using NSClient++.

Re: Folder Watch Wizard

Posted: Fri Mar 25, 2016 3:57 am
by Bone8Head
rkennedy wrote:It looks like your SSH session is looking for windows commands, and not linux. You'll need to alter your folder check accordingly, my guess is by using some kind of form of the dir command.

As I previously mentioned, this wizard is intended for Linux. The better use for what your doing may be using NSClient++.
How Can I use NSClient++ like this Folder Watch Wizard?
There is a Plugin that can watch into a Folder and tell me if some files in the folder are there for more like than 5 minutes?

Re: Folder Watch Wizard

Posted: Fri Mar 25, 2016 11:50 am
by tgriep
Here are a some examples for using NSClient to watch for files in a folder, etc...
http://sites.box293.com/nagios/guides/c ... es-folders
Here is another link to the document for installing NSClient on a windows host if you already have not installed it.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Folder Watch Wizard

Posted: Tue Mar 29, 2016 4:50 am
by Bone8Head
tgriep wrote:Here are a some examples for using NSClient to watch for files in a folder, etc...
http://sites.box293.com/nagios/guides/c ... es-folders
Here is another link to the document for installing NSClient on a windows host if you already have not installed it.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Ok, now I'm trying to let this NRPE Plugin Work, but still have some problems...
Should I post the problems here or open a new Thread?

Re: Folder Watch Wizard

Posted: Tue Mar 29, 2016 12:30 pm
by rkennedy
We can continue it here, no problem, it's all related.

What issue are you seeing currently now?

Re: Folder Watch Wizard

Posted: Wed Mar 30, 2016 3:09 am
by Bone8Head
rkennedy wrote:We can continue it here, no problem, it's all related.

What issue are you seeing currently now?
I'm using the Check For Files Older Than Two Hours and is working (with check_nrpe).
I have a question: it is possible to EDIT the OUTPUT string?
By default are:

Code: Select all

Output when files matching criteria are found:
{3 Files Found}, found files: 3 > critical|'found files'=3;0;1

Output when NO files matching criteria are found:
{0 Files Found}|'found files'=0;0;1
I want to edit the 3 Files found, etc. It's impossible?
Thank you.

Re: Folder Watch Wizard

Posted: Wed Mar 30, 2016 2:57 pm
by lgroschen
So you used something similar to this command on the page tgreip posted:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H localhost -t 30 -c CHeckFiles -a path='/tmp' pattern=*.* filter=written < -2h' 'master-syntax={%total% Files Found}' MaxCrit=1
To change the last part you can see where the output {3 Files Found} matches where the curly brackets are above here 'master-syntax={%total% Files Found}'.

To change this you can do anything really, remove the brackets and just have %total% if needed. Let us know if you need more help with this.