Folder Watch Wizard

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Folder Watch Wizard

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Folder Watch Wizard

Post by rkennedy »

Once you are SSH'd on to the machine, what is output of ls?
Former Nagios Employee
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Folder Watch Wizard

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Folder Watch Wizard

Post 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++.
Former Nagios Employee
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Folder Watch Wizard

Post 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?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Folder Watch Wizard

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Folder Watch Wizard

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Folder Watch Wizard

Post by rkennedy »

We can continue it here, no problem, it's all related.

What issue are you seeing currently now?
Former Nagios Employee
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Folder Watch Wizard

Post 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.
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Folder Watch Wizard

Post 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.
/Luke
Locked