we try to monitor the file age on some of our workstations. Works fine with NSClient++ - but we do not want to get any CRITICALs when the computer is shut down.
For the host, we do have a dummy check, returning OK every check. But when the workstation is offline, the check for the file age fails with a 'connection refused'.
Do you have any hints to avoid those CRITICALs?
If the service is associated with the host(name), if the check-host-alive (or whatever you've configured) test fails, the service alerts won't be sent. Remember to add a margin of error in your max_checks to account for a situation where the computer is shutting down, but still responding to pings (or whatever you use for check-host-alive).
Alternately, if your file-age-checker only issues WARNINGs, not CRITICALs, where WARNINGs are file-age-out-of-bounds errors, while CRITICALs are host-unreachable errors, just mask off the CRITICALs:
That said, what you should really do, if that's your goal, is to rewrite the plugin to return UNKNOWN for that circumstance, in which case it'd be:
Are the workstations switched off during predictable times? i.e, are they only going to be on from 9am-5pm, or something similar? If so, you can define a time period in Nagios and apply it to the workstations; then they'll only get checked within that time period.
Have you tried with the -u option in check_nrpe?