Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 488
  • Last Modified:

Nagios: Set status to OK after x Hours (passive check)

Nagios V 3.3.1

Is there a way to set a passive check's status to OK after the duration hits X hours?
0
mw-hosting
Asked:
mw-hosting
  • 6
  • 5
1 Solution
 
arnoldCommented:
I have not used it in a while, but I think on the secondary server you can set the period during which the active check is being performed.  i.e. secondary server checks stop checking the host after a certain Time.

rereading your question do you want the
server A master

server B secondary
host A

are you trying to achieve the result that if host A is down for X hours, its status will auto change to OK?
0
 
mw-hostingAuthor Commented:
It is a set of service checks that I would want to set to OK status after 24 hours.
0
 
arnoldCommented:
Could you provide a complete description of what you have and what you want to achieve?
Are you looking for server B to only check server A for 24 hours and then assume that it is OK?

host a went down. host a recovered at 8 am, you now want server B to check host a only until 8 am the following morning?

What happens during the 24 hours, does the host A being reflected as Ok or Not?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mw-hostingAuthor Commented:
Could you provide a complete description of what you have and what you want to achieve?
I have a load balancer that sends snmp traps to nagios when a server drops from a pool (critical alert) and when a server joins the pool (OK)
My problem is these pools have a maintenance server that is a hot stand by, so when is gets removed from the pool, the check never recovers.
I need to manually update the check to OK status.  I want to have the check go to OK status after a few hours, probably 24 hours

Are you looking for server B to only check server A for 24 hours and then assume that it is OK? No

host a went down. host a recovered at 8 am, you now want server B to check host a only until 8 am the following morning? No

What happens during the 24 hours, does the host A being reflected as Ok or Not?  It is in a Critical state until I manually update it.  They are service checks on a host.
0
 
arnoldCommented:
Can you use dependencies?

You have a nagios server that is sent traps by a loadbalancer.
 
Does the maintenance server get added and then the actual server is removed/worked on. once the original is restored the maintenance is removed, but nagios is reflecting the absence of the maintenance server from the pool?

0
 
mw-hostingAuthor Commented:
I can use whatever will get this to work.

Yes, it basically goes like this

poolA: Critical  (serverA dropped from pool)
poolA: OK (maintenance server added to pool)
poolA: OK (serverA added to pool)
poolA: Critical (maintenance server dropped from pool)

Alert stays that way until I submit a passive check though nagios.
0
 
arnoldCommented:
Use dependency such that as long as serverA is in the pool maintenance server status is not important.
http://nagios.sourceforge.net/docs/3_0/dependencies.html

I'm not sure what information your configuration supposed to notify you of.
I can understand the event notifying you of an issue with serverA.
Who knocks maintenance server from the pool?
Does the loadbalancer kicks it out of the pool?
0
 
mw-hostingAuthor Commented:
The Load Balancer kicks it out of the pool, because it is a hot stand-by that gets triggered with the servers drop from the pool and gets dropped when a server returns to the pool.
0
 
arnoldCommented:
I think you can define a rule for the maintenance server that the status of the Maintenance server is of importance only when server A is out of the pool. If server A is in the pool, the status of the maintenance will be assumed as up/etc.
0
 
mw-hostingAuthor Commented:
I was able to get this working by adding the following to the checks

   check_command           check-host-alive
   check_interval          86400
   max_check_attempts      1


This keeps active checks enabled, and it will wait 24 hours after a critical alert before running the check_command, which here just pings the load balancer.  Thus, clearing the check.

Thanks for your help with this.
0
 
mw-hostingAuthor Commented:
I solved this one my own.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now