check_file_exists_glob ERROR: The FILE name must be specifie
Re: check_file_exists_glob ERROR: The FILE name must be spec
-d must be specified, to determine the directory where the file is...
Re: check_file_exists_glob ERROR: The FILE name must be spec
Hi Scott,
i've tried another script:
https://exchange.nagios.org/directory/P ... ts/details
check_command check_file_exists!/waslog/core*
define service {
use generic-service
host_name {{ connectpeople.addon1.name }}
check_interval 300
service_description Check File Exists
check_command check_file_exists!/waslog/core*
define command{
command_name check_file_exists
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c check_file_exists -a '-n $ARG1$'
}
nrpe.cfg:
command[check_file_exists]=/usr/lib64/nagios/plugins/check_file_exists -n $ARG1$
It seems to be working. I have to test it a little bit more. Do you know this script? Is it possible to let it search for several files, or do i have to make several commands?
Regards,
Paul.
i've tried another script:
https://exchange.nagios.org/directory/P ... ts/details
check_command check_file_exists!/waslog/core*
define service {
use generic-service
host_name {{ connectpeople.addon1.name }}
check_interval 300
service_description Check File Exists
check_command check_file_exists!/waslog/core*
define command{
command_name check_file_exists
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c check_file_exists -a '-n $ARG1$'
}
nrpe.cfg:
command[check_file_exists]=/usr/lib64/nagios/plugins/check_file_exists -n $ARG1$
It seems to be working. I have to test it a little bit more. Do you know this script? Is it possible to let it search for several files, or do i have to make several commands?
Regards,
Paul.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_exists_glob ERROR: The FILE name must be spec
I don't believe it has that ability built-in but you could modify the script to suit your needs
Re: check_file_exists_glob ERROR: The FILE name must be spec
Does anyone know how to adjust the script so nagios can monitor several files?
I want to monitor javacore, core and heap.dmp files. Recieve a warning if one of these files appears in de dir /waslog.
The script works nog for just one file-name...
Thnx,
Paul.
I want to monitor javacore, core and heap.dmp files. Recieve a warning if one of these files appears in de dir /waslog.
The script works nog for just one file-name...
Thnx,
Paul.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_exists_glob ERROR: The FILE name must be spec
Here's a freebie based on you specifications.
Please note, we do not always write custom plugins for people but this one seemed easy enough.
Any required modification will be yours to figure out
Code: Select all
#! /bin/bash
#
# Author : Scott Wilkerson (Nagios Enterprises)
#
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
. $PROGPATH/utils.sh
if [ `ls -l /waslog/{javacore,core,heap.dmp} 2>/dev/null | wc -l ` -gt 0 ]
then
echo "CRITICAL - /waslog/{javacore,core,heap.dmp} : EXISTS"
exit $STATE_CRITICAL
else
echo "OK : /waslog/{javacore,core,heap.dmp} Does NOT exists "
exit $STATE_OK
fi
Any required modification will be yours to figure out
Re: check_file_exists_glob ERROR: The FILE name must be spec
Thnx Scott,
I Will try this out Tomorrow, and let you know.
Regards,
Paul.
I Will try this out Tomorrow, and let you know.
Regards,
Paul.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_exists_glob ERROR: The FILE name must be spec
sounds goodwelbp00 wrote:Thnx Scott,
I Will try this out Tomorrow, and let you know.
Regards,
Paul.
Re: check_file_exists_glob ERROR: The FILE name must be spec
Hi Scott.
It works fine! Just changed the file-names with a wildcard: /waslog/{javacore*,core*,heap*
nrpe.cfg:
command[check_file_exists]=/usr/lib64/nagios/plugins/check_file_exists $ARG1$
cfg:
define command{
command_name check_file_exists
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c check_file_exists -a '$ARG1$'
}
Thnx so much for your patience and help!
Best regards,
Paul.
It works fine! Just changed the file-names with a wildcard: /waslog/{javacore*,core*,heap*
nrpe.cfg:
command[check_file_exists]=/usr/lib64/nagios/plugins/check_file_exists $ARG1$
cfg:
define command{
command_name check_file_exists
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c check_file_exists -a '$ARG1$'
}
Thnx so much for your patience and help!
Best regards,
Paul.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_exists_glob ERROR: The FILE name must be spec
Glad you got it working!welbp00 wrote:Hi Scott.
It works fine! Just changed the file-names with a wildcard: /waslog/{javacore*,core*,heap*
nrpe.cfg:
command[check_file_exists]=/usr/lib64/nagios/plugins/check_file_exists $ARG1$
cfg:
define command{
command_name check_file_exists
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c check_file_exists -a '$ARG1$'
}
Thnx so much for your patience and help!
Best regards,
Paul.
Locking thread