Permalink
Browse files

improved instructions for Nagios and some screenshots

  • Loading branch information...
1 parent 4b0d3d9 commit 3b39583a2a8516993746642da3255b5dc8f13120 @andreisavu committed Jun 20, 2010
View
@@ -6,6 +6,11 @@ I will start by making the assumption that you already have an working Nagios in
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.
+WARNING: You should customize the config files as suggested in order to match your Nagios and Zookeeper install.
+
+WARNING: This README assumes you know how to configure Nagios and how it works.
+
+WARNING: You should customize the warning and critical levels on service checks to meet your own needs.
1. Install the plugin
@@ -15,11 +20,11 @@ $ cp check_zookeeper.py /usr/lib/nagios/plugins/
$ cp zookeeper.cfg /etc/nagios-plugins/config
-3. Update the list of servers in zookeeper.cfg. It should contain all the ZooKeeper servers in the cluster.
+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)
-4. Create a virtual host in Nagios used for monitoring the cluster as a whole.
+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.
-5. Define service checks like this:
+5. Define service checks like I have ilustrated bellow or just use the provided definitions.
define service {
use generic-service
@@ -28,6 +33,13 @@ define service {
check_command check_zookeeper!<exported-var>!<warning-level>!<critical-level>
}
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Open_File_Descriptors_Count
+ check_command check_zk_node!<exported-var>!<warning-level>!<critical-level>
+}
+
Ex:
a. check the number of open file descriptors
@@ -48,4 +60,12 @@ define service {
check_command check_zookeeper!zk_ephemerals_count!10000!100000
}
+c. check the number of open file descriptors for each host in the group
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Open_File_Descriptors_Count
+ check_command check_zk_node!zk_open_file_descriptor_count!500!800
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,10 @@
+
+# A group containing all the ZooKeeper nodes
+
+define hostgroup {
+ hostgroup_name zookeeper-servers
+ alias ZooKeeper Servers
+ members localhost
+}
+
+
View
@@ -0,0 +1,51 @@
+# ZooKeeper Node specific services
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Open_File_Descriptors_Count
+ check_command check_zk_node!zk_open_file_descriptor_count!500!800
+}
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Ephemerals_Count
+ check_command check_zk_node!zk_ephemerals_count!10000!100000
+}
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Avg_Latency
+ check_command check_zk_node!zk_avg_latency!500!1000
+}
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Max_Latency
+ check_command check_zk_node!zk_max_latency!1000!2000
+}
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Min_Latency
+ check_command check_zk_node!zk_min_latency!500!1000
+}
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Outstanding_Requests
+ check_command check_zk_node!zk_outstanding_requests!20!50
+}
+
+define service {
+ hostgroup_name zookeeper-servers
+ use generic-service
+ service_description ZK_Watch_Count
+ check_command check_zk_node!zk_watch_count!100!500
+}
+
View
@@ -2,6 +2,14 @@
# 'check_zookeeper' command definition
define command {
command_name check_zookeeper
- command_line /usr/lib/nagios/plugins/check_zookeeper.py -s localhost:2181 -o nagios -k '$ARG1$' -w '$ARG2$' -c '$ARG3$'
+ command_line /usr/lib/nagios/plugins/check_zookeeper.py -s "localhost:2181,localhost:2182,localhost:2183" -o nagios -k '$ARG1$' -w '$ARG2$' -c '$ARG3$'
+ # ATTENTION: you should update the list of servers defined above
+}
+
+# 'check_zk_node' command definition
+define command {
+ command_name check_zk_node
+ command_line /usr/lib/nagios/plugins/check_zookeeper.py -s $HOSTADDRESS$:2181 -o nagios -k '$ARG1$' -w '$ARG2$' -c '$ARG3$'
+ # ATTENTION: you should update the port. default: 2181
}

1 comment on commit 3b39583

@sap2000

Just now installed Zookeeper. Next thing is nagios check wih check_zookeeper.py
What should be the value to -k argument? where can I find the key?
Thanks.

Please sign in to comment.