ClusterGroup Confusion
-
- Posts: 72
- Joined: Wed Feb 06, 2019 3:22 pm
ClusterGroup Confusion
I have two servers that have the same services running. But the service only runs on one server at a time. I was trying to use cluster services but I am not sure how to apply it.
https://assets.nagios.com/downloads/nag ... sters.html
I can't figure out how to apply this. Can you give me a write up that explain how to poll for 1 service on 2 servers. I need it to detect if it is active on one server or the other.
I can give you all my information through private message if need be.
https://assets.nagios.com/downloads/nag ... sters.html
I can't figure out how to apply this. Can you give me a write up that explain how to poll for 1 service on 2 servers. I need it to detect if it is active on one server or the other.
I can give you all my information through private message if need be.
-
- Posts: 72
- Joined: Wed Feb 06, 2019 3:22 pm
Re: ClusterGroup Confusion
Monitor
Host1 Host2
- -
Service A running Service A manual
I need the check to monitor the service on both servers. So when we fail the service over it wouldn't flag due to it constantly running on either server. But it would flag if it failed on both servers.
I can't come up with the configuration based off that website link supplied
Host1 Host2
- -
Service A running Service A manual
I need the check to monitor the service on both servers. So when we fail the service over it wouldn't flag due to it constantly running on either server. But it would flag if it failed on both servers.
I can't come up with the configuration based off that website link supplied
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: ClusterGroup Confusion
Per the doc, you need to already be monitoring the services (you may choose to not alert on them), then you would setup a new service with the following
You would replace the following with your host:service
I set the warning and critical levels both to 1 as you need to surpass 1 to trigger a warning or critical
The command would translate to the following if both were in a warning state
Code: Select all
define service {
...
check_command check_service_cluster!"DNS Cluster"!1!1!$SERVICESTATEID:host1:DNS Service$,$SERVICESTATEID:host2:DNS Service$,$SERVICESTATEID:host2:DNS Service$
}
Code: Select all
host1:DNS Service
host2:DNS Service
The command would translate to the following if both were in a warning state
Code: Select all
[root@localhost ~]#/usr/local/nagios/libexec/check_cluster -l "DNS Cluster" -w 1 -c 1 -d 1,1
CLUSTER CRITICAL: DNS Cluster: 0 ok, 2 warning, 0 unknown, 0 critical
[root@localhost ~]# echo $?
2
-
- Posts: 72
- Joined: Wed Feb 06, 2019 3:22 pm
Re: ClusterGroup Confusion
Before I do that don't I need to create a new cfg file?
API_Servers.cfg
But then for define host do I add two servers? How would I do that in the cfg?
Example:
define host {
host_name 990-APIA-1, 991-APIA-1
address 172.24.32.98, 172.24.32.99
I'm confused on this.
API_Servers.cfg
But then for define host do I add two servers? How would I do that in the cfg?
Example:
define host {
host_name 990-APIA-1, 991-APIA-1
address 172.24.32.98, 172.24.32.99
I'm confused on this.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: ClusterGroup Confusion
Lets step back, are you currently monitoring these services individually?
-
- Posts: 72
- Joined: Wed Feb 06, 2019 3:22 pm
Re: ClusterGroup Confusion
Yes.
APIA-A
Services are running and being monitored
APIA-B
Services set to manual and being monitored
Alarms are flagging on APIA-B, Notifications set to off.
(If I move services to the other server then you would flip flop the setup)
APIA-A
Services are running and being monitored
APIA-B
Services set to manual and being monitored
Alarms are flagging on APIA-B, Notifications set to off.
(If I move services to the other server then you would flip flop the setup)
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: ClusterGroup Confusion
You would have to have a host configured that you would store the newly created cluster services.
We will call this clusterhost
then you would create a service configuration for each of the cluster services, and in that the check_command would look like the following if the services were called "DNS Service"
We will call this clusterhost
then you would create a service configuration for each of the cluster services, and in that the check_command would look like the following if the services were called "DNS Service"
Code: Select all
check_command check_service_cluster!"DNS Cluster"!1!1!$SERVICESTATEID:APIA-A:DNS Service$,$SERVICESTATEID:APIA-B:DNS Service$,$SERVICESTATEID:host2:DNS Service$
-
- Posts: 72
- Joined: Wed Feb 06, 2019 3:22 pm
Re: ClusterGroup Confusion
So I can just name it anything right? Then what would I put for the addresses?
-
- Posts: 72
- Joined: Wed Feb 06, 2019 3:22 pm
Re: ClusterGroup Confusion
Basically, how would I set it up to include two or more hosts?
define host {
host_name APIA-1
address 172.24.32.98
check_command check_ncpa!-t xxxxxx -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contact_groups admins
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
define host {
host_name APIA-1
address 172.24.32.98
check_command check_ncpa!-t xxxxxx -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contact_groups admins
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: ClusterGroup Confusion
anythingnickanderson1982 wrote:So I can just name it anything right? Then what would I put for the addresses?
I thought you wanted to check services?nickanderson1982 wrote:Basically, how would I set it up to include two or more hosts?
define host {
host_name APIA-1
address 172.24.32.98
check_command check_ncpa!-t xxxxxx -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contact_groups admins
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
See the Monitoring Service Clusters section in
https://assets.nagios.com/downloads/nag ... sters.html