How to config plugin check_newest_file_age

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
welbp00
Posts: 50
Joined: Fri Mar 08, 2019 5:48 am

Re: How to config plugin check_newest_file_age

Post 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'
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to config plugin check_newest_file_age

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
welbp00
Posts: 50
Joined: Fri Mar 08, 2019 5:48 am

Re: How to config plugin check_newest_file_age

Post by welbp00 »

Ok, where do i put that?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to config plugin check_newest_file_age

Post 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'
}
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
welbp00
Posts: 50
Joined: Fri Mar 08, 2019 5:48 am

Re: How to config plugin check_newest_file_age

Post by welbp00 »

I have put the initial_state in, but nagios still shows "pending"
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to config plugin check_newest_file_age

Post by scottwilkerson »

welbp00 wrote:I have put the initial_state in, but nagios still shows "pending"
Did you restart Nagios?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
welbp00
Posts: 50
Joined: Fri Mar 08, 2019 5:48 am

Re: How to config plugin check_newest_file_age

Post by welbp00 »

Yes, i did.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to config plugin check_newest_file_age

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
welbp00
Posts: 50
Joined: Fri Mar 08, 2019 5:48 am

Re: How to config plugin check_newest_file_age

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to config plugin check_newest_file_age

Post 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!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked