Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using Nagios to check duplicate processes.

define service
{         
    use                             local-service    
    host_name                       xxx
    service_description             xxx Duplicate Processes
    check_interval                  1
    max_check_attempts              1
    contact_groups                  admins
    event_handler                   restart-dependent-processes
    check_command                   check_procs_duplicate!2!3!2!2!2

}

check_procs_duplicate checks if there are any duplicate processes and returns the state - e.g. CRITICAL.

The event handler kills the duplicate processes and it's dependent processes and starts one instance of the process and dependent process. At the end of this again Nagios checks if there are any duplicate processes and sets the state accordingly - OK/WARNING/CRITICAL.

The event handler takes more time to start the processes and during this time if someone manually starts the process, the state will remain in CRITICAL itself.

During the next interval, Nagios will again check for duplicate processes and it will find it again CRITICAL.

The event handler will not get executed now, as the previos and current both the states are CRITICAL.

Any pointers about how to fix this issue?

share|improve this question
    
Please show us the restart-dependent-processes and check_procs_duplicate definitions. –  quanta Sep 7 '12 at 6:25
add comment

1 Answer 1

You might want to consider making it a volatile service. See the docs page on Volatile Services.

What you're dealing with isn't strictly a volatile service, but a check_interval of 1 and max_check_attempts of 1 is almost the same thing.

If you make the service volatile, it should effectively run the event handler any time it's CRITICAL, not just when the state "changes".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.