README.txt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Licensed to the Apache Software Foundation (ASF) under one
  2. or more contributor license agreements. See the NOTICE file
  3. distributed with this work for additional information
  4. regarding copyright ownership. The ASF licenses this file
  5. to you under the Apache License, Version 2.0 (the
  6. "License"); you may not use this file except in compliance
  7. with the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. Configuration Recipe for monitoring ZooKeeper using Nagios
  15. ----------------------------------------------------------
  16. I will start by making the assumption that you already have an working Nagios install.
  17. WARNING: I have wrote these instructions while installing and configuring the plugin on my desktop computer running Ubuntu 9.10. I've installed Nagios using apt-get.
  18. WARNING: You should customize the config files as suggested in order to match your Nagios and Zookeeper install.
  19. WARNING: This README assumes you know how to configure Nagios and how it works.
  20. WARNING: You should customize the warning and critical levels on service checks to meet your own needs.
  21. 1. Install the plugin
  22. $ cp check_zookeeper.py /usr/lib/nagios/plugins/
  23. 2. Install the new commands
  24. $ cp zookeeper.cfg /etc/nagios-plugins/config
  25. 3. Update the list of servers in zookeeper.cfg for the command 'check_zookeeper' and update the port for the command 'check_zk_node' (default: 2181)
  26. 4. Create a virtual host in Nagios used for monitoring the cluster as a whole -OR- Create a hostgroup named 'zookeeper-servers' and add all the zookeeper cluster nodes.
  27. 5. Define service checks like I have illustrated bellow or just use the provided definitions.
  28. define service {
  29. use generic-service
  30. host_name zookeeper-cluster
  31. service_description ...
  32. check_command check_zookeeper!<exported-var>!<warning-level>!<critical-level>
  33. }
  34. define service {
  35. hostgroup_name zookeeper-servers
  36. use generic-service
  37. service_description ZK_Open_File_Descriptors_Count
  38. check_command check_zk_node!<exported-var>!<warning-level>!<critical-level>
  39. }
  40. Ex:
  41. a. check the number of open file descriptors
  42. define service{
  43. use generic-service
  44. host_name zookeeper-cluster
  45. service_description ZK_Open_File_Descriptor_Count
  46. check_command check_zookeeper!zk_open_file_descriptor_count!500!800
  47. }
  48. b. check the number of ephemerals nodes
  49. define service {
  50. use generic-service
  51. host_name localhost
  52. service_description ZK_Ephemerals_Count
  53. check_command check_zookeeper!zk_ephemerals_count!10000!100000
  54. }
  55. c. check the number of open file descriptors for each host in the group
  56. define service {
  57. hostgroup_name zookeeper-servers
  58. use generic-service
  59. service_description ZK_Open_File_Descriptors_Count
  60. check_command check_zk_node!zk_open_file_descriptor_count!500!800
  61. }