Is this the best way to monitor deliberate status change
Posted: Mon Jul 30, 2012 5:34 am
Hi
I'm new to Nagios monitoring and am wondering if I am wanting to do something that is not do-able.
QUESTION
=========
Is there a better way of doing this so that...
I only have one service listed in the table where during office hours its reporting OK if the proxy server is UP and
I only have one service listed in the table where during NONT office hours it os reporting OK if the proxy server is DOWN
Situation
========
I have a proxy server running on a virtual machine.
I only want our proxy UP during office hours so I have scheduled the vm to be shutdown at the end of office hours.
All works well.
Requirements
============
What I would like to do is make nagios check:
1 - proxy server vm is UP during office hours (notifying if it is down)
2 - proxy server vm is DOWN out of office hours (notifying if it is up)
Current Solution
==============
I have defined the two timeperiods OffHrs and NonOffHrs in /etc/nagios3/timeperiods.cfg
My host definition is
define host{
use generic-host
host_name myproxy
check_period 24x7
notification_period 24x7
}
.. and I have defined TWO services ..
define service{
use generic-service
host_name myproxy
service_description OfficeHrs - VM should be UP
check_period 24x7
notification_period OffHrs
check_command check-kvm-guest-up!myproxy
}
define service{
use generic-service
host_name myproxy
service_description NonOfficeHrs - VM should be DOWN
check_period 24x7
notification_period NonOffHrs
check_command check-kvm-guest-down!myproxy
}
Results
=======
HOST SERVICE STATUS STATUS INFORMATION
----------------------------------------------------------------------------------------------------------------
myproxy NonOfficeHrs - VM should be DOWN CRITICAL [ ... ] Domain 'myproxy' is UP
OfficeHrs - VM should be UP OK [ ... ] Domain 'myproxy' is UP
Kind Regards
Ritchie
I'm new to Nagios monitoring and am wondering if I am wanting to do something that is not do-able.
QUESTION
=========
Is there a better way of doing this so that...
I only have one service listed in the table where during office hours its reporting OK if the proxy server is UP and
I only have one service listed in the table where during NONT office hours it os reporting OK if the proxy server is DOWN
Situation
========
I have a proxy server running on a virtual machine.
I only want our proxy UP during office hours so I have scheduled the vm to be shutdown at the end of office hours.
All works well.
Requirements
============
What I would like to do is make nagios check:
1 - proxy server vm is UP during office hours (notifying if it is down)
2 - proxy server vm is DOWN out of office hours (notifying if it is up)
Current Solution
==============
I have defined the two timeperiods OffHrs and NonOffHrs in /etc/nagios3/timeperiods.cfg
My host definition is
define host{
use generic-host
host_name myproxy
check_period 24x7
notification_period 24x7
}
.. and I have defined TWO services ..
define service{
use generic-service
host_name myproxy
service_description OfficeHrs - VM should be UP
check_period 24x7
notification_period OffHrs
check_command check-kvm-guest-up!myproxy
}
define service{
use generic-service
host_name myproxy
service_description NonOfficeHrs - VM should be DOWN
check_period 24x7
notification_period NonOffHrs
check_command check-kvm-guest-down!myproxy
}
Results
=======
HOST SERVICE STATUS STATUS INFORMATION
----------------------------------------------------------------------------------------------------------------
myproxy NonOfficeHrs - VM should be DOWN CRITICAL [ ... ] Domain 'myproxy' is UP
OfficeHrs - VM should be UP OK [ ... ] Domain 'myproxy' is UP
Kind Regards
Ritchie