Page 2 of 4

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 4:07 am
by welbp00
Okay, something else:

I have split up the directory to be checked, because one dir needs to be checked every day, the other one only once a week.
The last one shows a status Pending in Nagios. That's not wat i want. Is het possible to not let it show?

Or should i go back to the config with two dir's in the command?

This is wat i have now:

Basic.cfg:

define command{
command_name check_newest_file_age
command_line /usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -t 300 -c check_newest_file_age $ARG1$ $ARG2$
}

Services.cfg:

define service {
use generic-service
host_name linux-server
check_interval 300
check_period onlymondays
notification_period onlymondays
service_description Controle backup-log
check_command check_newest_file_age! -a '-d "/gpfs/fileSystemConnections55ONT/filesystemconnections6data#/Search-bck/latest/" -w 7 -c 8 -t days'

define service {
use generic-service
host_name linux-server
check_interval 300
service_description Controle herstart log
check_command check_newest_file_age! -a '-d "/waslog/cp_init/" -w 7 -c 8 -t days'
}

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 7:24 am
by scottwilkerson
You can't have it not show, but you can set the initial state to be OK

Add the following to the service

Code: Select all

initial_state            o

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 8:44 am
by welbp00
Ok, where do i put that?

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 8:52 am
by scottwilkerson
welbp00 wrote:Ok, where do i put that?
In the service definitions, such as:

Code: Select all

define service {
use generic-service
host_name linux-server
check_interval 300
check_period onlymondays
notification_period onlymondays
initial_state            o
service_description Controle backup-log
check_command check_newest_file_age! -a '-d "/gpfs/fileSystemConnections55ONT/filesystemconnections6data#/Search-bck/latest/" -w 7 -c 8 -t days'

define service {
use generic-service
host_name linux-server
check_interval 300
initial_state            o
service_description Controle herstart log
check_command check_newest_file_age! -a '-d "/waslog/cp_init/" -w 7 -c 8 -t days'
}

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 10:25 am
by welbp00
I have put the initial_state in, but nagios still shows "pending"

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 10:28 am
by scottwilkerson
welbp00 wrote:I have put the initial_state in, but nagios still shows "pending"
Did you restart Nagios?

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 12:17 pm
by welbp00
Yes, i did.

Re: How to config plugin check_newest_file_age

Posted: Wed May 08, 2019 2:31 pm
by scottwilkerson
welbp00 wrote:Yes, i did.
Hmm, it may have to be set on the first time it is loaded.

I can only suggest not sending a passive result setting the status to OK

Re: How to config plugin check_newest_file_age

Posted: Thu May 09, 2019 2:16 am
by welbp00
Oke, i will wait until monday, to see if the check will run, and to see if the state Pending will disapear.

Thnx for the help so far!

Re: How to config plugin check_newest_file_age

Posted: Thu May 09, 2019 6:57 am
by scottwilkerson
welbp00 wrote:Oke, i will wait until monday, to see if the check will run, and to see if the state Pending will disapear.

Thnx for the help so far!
Sounds good!