Test check works in CCM, but fails once applied
Re: Test check works in CCM, but fails once applied
At this point, the command is stopping before it leaves nagios. the log on the desktop is empty (after deleted old data). no new logs with the current command config is being created.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Test check works in CCM, but fails once applied
OK so this will work:
Command:
Service:
Make note that I put the full file location in $ARG1$ and removed the filter.
Because you are only targeting a specific file, it is better to do it this way. It has to do with how the client parses all files in this directory multiple times. The more files in the directory the longer it takes to run.
Otherwise you would do something like:
Command:
Service:
Also take note of the syntax I changed:
'perf-syntax=%{file} Last Written: %(written_l)'
Bash tries to do something different when it sees ${ so this is why the developer also allows %{
Let us know how this goes.
Command:
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c Check_Files -a path="$ARG1$" "ok=count>= 1" "warn=written< -$ARG2$" "crit=written< -$ARG3$ or count= 0" 'perf-syntax=%{file} Last Written: %(written_l)'Code: Select all
$ARG1$ = C:\\temp\\test.txt
$ARG2$ = 1h
$ARG3$ = 1dBecause you are only targeting a specific file, it is better to do it this way. It has to do with how the client parses all files in this directory multiple times. The more files in the directory the longer it takes to run.
Otherwise you would do something like:
Command:
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c Check_Files -a path="$ARG1$" file="$ARG2$" "ok=count>= 1" "warn=written< -$ARG2$" "crit=written< -$ARG3$ or count= 0" 'perf-syntax=%{file} Last Written: %(written_l)'Code: Select all
$ARG1$ = C:\\temp\\
$ARG2$ = test.txt
$ARG3$ = 1h
$ARG4$ = 1d'perf-syntax=%{file} Last Written: %(written_l)'
Bash tries to do something different when it sees ${ so this is why the developer also allows %{
Let us know how this goes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Test check works in CCM, but fails once applied
Thank you very much for helping me! that did resolve the issue. the only question now is when the files doesn't exist, i want it to report a critical. right now it reports unknown. any help on that would be great 
Re: Test check works in CCM, but fails once applied
You can have check_files exit with a code of 2 instead of however it is exiting now. Does that make sense?
Former Nagios Employee.
me.
me.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Test check works in CCM, but fails once applied
I think all you need to do is define the "empy-state", add this to the check command:TJ.AHC wrote:Thank you very much for helping me! that did resolve the issue. the only question now is when the files doesn't exist, i want it to report a critical. right now it reports unknown. any help on that would be great
Code: Select all
'empty-state=critical'As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.