I Want to do the same type of monitoring on 50 servers.
Please let me know how to apply the same type of on a group of servers.
Monitoring the Group of Servers
Re: Monitoring the Group of Servers
So I have a group of 4 machines all supporting an ElasticSearch cluster. Naturally, I would like to monitor all of them in roughly the same way without configuring each one individually.
I do this by first defining individual host objects:
Where esprod00-03 represents the 4 machines I'd like to monitor in roughly the same way. Once I have those basic host objects defined, I can group all of those hosts together in a hostgroup like so:
Now that all the hosts are grouped together into a single hostgroup named esprod, I can easily assign services to each host in that hostgroup by assigning the services at the hostgroup level:
By leveraging the hostgroup_name directive in my service definitions, I can apply many services to many hosts under a single hostgroup. This saves an awful lot of time when dealing with hundreds of servers that all have roughly the same monitoring requirements.
More on hostgroups:
https://assets.nagios.com/downloads/nag ... #hostgroup
I do this by first defining individual host objects:
Code: Select all
define host{
use linux-server
host_name esprod00
address esprod00
check_command check_elasticsearch!checkapi!!
}
define host{
use linux-server
host_name esprod01
address esprod01
check_command check_elasticsearch!checkapi!!
}
define host{
use linux-server
host_name esprod02
address esprod02
check_command check_elasticsearch!checkapi!!
}
define host{
use linux-server
host_name esprod03
address esprod03
check_command check_elasticsearch!checkapi!!
}
Code: Select all
define hostgroup{
hostgroup_name esprod
members esprod00,esprod01,esprod02,esprod03
}
Code: Select all
define service{
use elasticsearch-prod
hostgroup_name esprod
service_description CPU Usage
check_command check_elasticsearch!checkcpu!-w 80 -c 90
}
define service{
use elasticsearch-prod
hostgroup_name esprod
service_description Memory Usage
check_command check_elasticsearch!checkmem!-w 80 -c 90
}
define service{
use elasticsearch-prod
hostgroup_name esprod
service_description Heap Usage
check_command check_elasticsearch!checkheap!-w 90 -c 98
}
define service{
use elasticsearch-prod
hostgroup_name esprod
service_description Cluster Status
check_command check_elasticsearch!checkclusterstatus!
}
define service{
use elasticsearch-prod
hostgroup_name esprod
service_description Ping
check_command check_ping!500.0,30%!1000.0,60%
}
More on hostgroups:
https://assets.nagios.com/downloads/nag ... #hostgroup
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Monitoring the Group of Servers
@mcpra Thanks for the detailed steps.
It should be helpful. I will implement it and if anything comes will let you know.
It should be helpful. I will implement it and if anything comes will let you know.
Re: Monitoring the Group of Servers
Thanks @mcapra!
@amitgupta19, Let us know how it goes or if this answered your question once you've tried it!
@amitgupta19, Let us know how it goes or if this answered your question once you've tried it!
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Monitoring the Group of Servers
Sure i will update, once i try this solution.