Hi,
Has someone setup a service check to check a directory if a new file has been created? Does Nagios have this capability.
Thanks in advanced.
Search Directory
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Search Directory
A quick look in the Exchange found this option
http://exchange.nagios.org/directory/Pl ... sh/details
http://exchange.nagios.org/directory/Pl ... sh/details
Re: Search Directory
Thank you for the quick response.
Does anyone know how to set this up? Or point me to a documenation?
Does anyone know how to set this up? Or point me to a documenation?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Search Directory
Edit check_newfiles.config and place the directory you want to check in the CHECKDIR variable.
Upload both check_newfiles.config and check_newfiles.sh to the nagios plugin directory.
You can do this through the web GUI at Admin -> Manage Plugins
Add a command at Configure -> Core Config Manager -> Commands -> Add New
Command = check_newfiles
Command line* = $USER1$/check_newfiles.sh -f $ARG1$
Command type = check command
Now you can add a service and use check_newfiles for the check command.
$ARG1$ = check_newfiles.config
Upload both check_newfiles.config and check_newfiles.sh to the nagios plugin directory.
You can do this through the web GUI at Admin -> Manage Plugins
Add a command at Configure -> Core Config Manager -> Commands -> Add New
Command = check_newfiles
Command line* = $USER1$/check_newfiles.sh -f $ARG1$
Command type = check command
Now you can add a service and use check_newfiles for the check command.
$ARG1$ = check_newfiles.config
Re: Search Directory
How would you do it if you want to monitor multiple directories on multiple remote Windows agents?
Would I have to place the check_newfiles.config locally on the remote Windows agent?
Thanks.
Would I have to place the check_newfiles.config locally on the remote Windows agent?
Thanks.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Search Directory
You would place both files on the remote machine, then if it is NRPE you are using you would have to add the command to the nrpe.cfg and then change the Nagios machine to use check_nrpe with the command name you specify in the remote nrpe.cfg
You can make a new file in the format of check_newfiles.config and you would use the name of the new file in your $ARGn$
You can make a new file in the format of check_newfiles.config and you would use the name of the new file in your $ARGn$
Re: Search Directory
Ok, so I'm receiving the following message and have the following configuration (attached).
First message:
ExternalCommands: failed to create process (scripts\check_newfiles.sh --config scripts\check_newfiles\$ARG1$): it is not an exe file (check NSC.log for more info) - failed to lookup error code: 193( reson: 87)
So I renamed it to check_newfiles.exe and received the second message:
ExternalCommands: failed to create process (scripts\check_newfiles.exe --config scripts\check_newfiles\$ARG1$): failed to lookup error code: 216( reson: 87)
First message:
ExternalCommands: failed to create process (scripts\check_newfiles.sh --config scripts\check_newfiles\$ARG1$): it is not an exe file (check NSC.log for more info) - failed to lookup error code: 193( reson: 87)
So I renamed it to check_newfiles.exe and received the second message:
ExternalCommands: failed to create process (scripts\check_newfiles.exe --config scripts\check_newfiles\$ARG1$): failed to lookup error code: 216( reson: 87)
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Search Directory
I'm sorry I didn't catch your last post said "Windows" machines.
For that you would need a different setup, you can use something like
http://www.nsclient.org/nscp/wiki/CheckFiles
For that you would need a different setup, you can use something like
http://www.nsclient.org/nscp/wiki/CheckFiles