continuent-monitors-nagios 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +134 -7
  3. data/bin/tungsten_nagios_policy +6 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2302ed384f4741778d499ec80bba5c571a55227
4
- data.tar.gz: 82ddf98af190fbda192cf15b63c38d4c92154920
3
+ metadata.gz: ecc7266eb50a3ef4861019ae0e285796519324cd
4
+ data.tar.gz: 845aecebb16c08949ca3b8db8f26d9bd744c8b49
5
5
  SHA512:
6
- metadata.gz: c6cf042cf427da93be17409ed7e8c5cf73d1d4634b1e1db8b132b5d8acd0d25df3e44f8b6693e222532c44e5052218c787a289a156301880215439b5a24b91af
7
- data.tar.gz: d60d5d2bc9d37ab076f0568c6975e8cf92252c16d6a1e23bcda552c5f84e2b4d9069a5ffa27bf7f232128d226c57b6338abc6808edc2a690e6ada1b6f8c4fbf5
6
+ metadata.gz: efd057da7e628fc532129390106973bdb63b039a2009743ee5d307709938a3f4f54052c264e91b9bf8e657ff85e6a16e88ae8999531f254c1cb548cc93e7b44f
7
+ data.tar.gz: 3d7573fdf3117d3b026512a10b3a1cef3800ba5510b405854fcc0d4bde833cbfba29c1ecbdd67d8ce29c55ea6eccd7c3364b08195e2dbcb920c9301049c3bcbf
data/README.md CHANGED
@@ -3,19 +3,146 @@ continuent-monitors-nagios
3
3
 
4
4
  A Ruby Gem containing Nagios checks for Continuent Tungsten and Tungsten Replicator
5
5
 
6
- ## Installation
6
+ # Installation
7
7
 
8
- ```gem install continuent-monitors-nagios```
8
+ * Install the Ruby gem
9
+
10
+ ```sudo gem install continuent-monitors-nagios```
11
+ * Install the Nagios NRPE service
12
+ * Add the IP of your Nagios server to the ```/etc/nagios/nrpe.cfg``` configuration file. For example:
9
13
 
10
- ## Example Nagios Service Check
14
+ ```allowed_hosts=127.0.0.1,192.168.2.20```
15
+ * Add the Tungsten check commands that you want to execute to the ```/etc/nagios/nrpe.cfg``` configuration file. For example:
11
16
 
12
- ```
13
- check_by_ssh -H $HOSTADDRESS$ -t 30 -o="StrictHostKeyChecking=no" -C "sudo -u tungsten /usr/bin/tungsten_nagios_latency -w 60 -c 120 --directory=/opt/continuent/"
14
- ```
17
+ ```command[tungsten_nagios_online]=/usr/bin/tungsten_nagios_online```
18
+
19
+ If the commands need to be executed with superuser privileges, the ```/etc/sudo``` or ```/etc/sudoers``` file must be updated to enable the commands to be executed as root through sudo as the nagios user. This can be achieved by updating the configuration file, usually performed by using the visudo command:
20
+
21
+ ```nagios ALL=(tungsten) NOPASSWD: /usr/bin/tungsten_nagios_*```
22
+
23
+ In addition, the sudo command should be added to the Tungsten check commands within the Nagios ```/etc/nagios/nrpe.cfg```, for example:
24
+
25
+ ```command[tungsten_nagios_online]=/usr/bin/sudo -u tungsten /usr/bin/tungsten_nagios_online```
26
+ * Start the NRPE service:
27
+
28
+ ```shell> sudo /etc/init.d/nagios-nrpe-server start```
29
+ * Add an entry to your Nagois ```services.cfg``` file for each service you want to monitor:
30
+
31
+ ```define service {
32
+ host_name database
33
+ service_description check_tungsten_online
34
+ check_command check_nrpe! -H $HOSTADDRESS$ -t 30 -c check_tungsten_online
35
+ retry_check_interval 1
36
+ check_period 24x7
37
+ max_check_attempts 3
38
+ flap_detection_enabled 1
39
+ notifications_enabled 1
40
+ notification_period 24x7
41
+ notification_interval 60
42
+ notification_options c,f,r,u,w
43
+ normal_check_interval 5
44
+ }```
45
+
46
+ # Global Options
47
+
48
+ --directory
49
+ Use this installed Tungsten directory as the base for all operations
50
+
51
+ --quiet, -q
52
+
53
+ --info, -i
54
+
55
+ --notice, -n
56
+
57
+ --verbose, -v
58
+
59
+ --help, -h
60
+ Display this message
61
+
62
+ --json
63
+ Provide return code and logging messages as a JSON object after the script finishes
64
+
65
+ --net-ssh-option=key=value
66
+ Set the Net::SSH option for remote system calls. Valid options can be found at http://net-ssh.github.com/ssh/v2/api/classes/Net/SSH.html#M000002
67
+
68
+ # Global Outputs
69
+
70
+ Each of these will usually be appended with a text message depending on the individual script being run.
71
+
72
+ * OK:
73
+ * WARNING:
74
+ * CRITICAL:
75
+ * UNKNOWN:
76
+
77
+ # Available Checks
78
+
79
+ Use the ```--help``` option for each command to see the full list of available options.
80
+
81
+ ## tungsten_nagios_backups
82
+ Compare the age of the last backup with that given in the option max-backup-age.
83
+
84
+ Returns OK with message 'Not running check because this node is not the coordinator' if the host on which this is being run is not the current cluster coordinator.
85
+ Returns OK if a backup is found to have the same or lesser age and CRITICAL otherwise.
86
+ Returns an error message under the following circumstances:
87
+ Script is run on a host that does not have a running Manager or a running Replicator.
88
+ A backup is not found in the configured loacation.
89
+
90
+ Available options:
91
+
92
+ --service String
93
+ Where String is the replication service or cluster to check
94
+
95
+ --max-backup-age String
96
+ Where String is the maximum allowed age in seconds of a backup on any machine. The default value is 86400.
97
+
98
+ ## tungsten_nagios_connector
99
+
100
+ Check the availability of the Connector.
101
+
102
+ Returns one of:
103
+ OK: The connection was successfully created
104
+ CRITICAL: The server is not a Continuent Tungsten Connector
105
+ CRITICAL: The Continuent Tungsten Connector is not running
106
+ CRITICAL: A connection to the Tungsten Connector could not be created
107
+
108
+ Available options:
109
+ --defaults-file String
110
+ The defaults file to use when connecting to MySQL
111
+
112
+ --statement String
113
+ The command to run against the Tungsten Connector. The default command is "tungsten connection status".
114
+
115
+ ## tungsten_nagios_latency
116
+
117
+ Check that all applied latency values are under a given number of seconds.
118
+
119
+ ## tungsten_nagios_monitor_threads
120
+
121
+ Check that the number of Java threads for one of the VMware Continuent services is under a given value.
122
+
123
+ ## tungsten_nagios_online
124
+
125
+ Check that all replication services and datasources are ONLINE.
126
+
127
+ ## tungsten_nagios_policy
128
+
129
+ Check that the cluster policy is set to AUTOMATIC.
130
+
131
+ ## tungsten_nagios_progress
132
+
133
+ Check that the VMware Continuent Replicator process is successfully applies a heartbeat event created by the script.
134
+
135
+ ## tungsten_nagios_relative_latency
136
+
137
+ Check that all relative latency values are under a given number of seconds.
138
+
139
+ ## tungsten_nagios_services
140
+
141
+ Check that all configured VMware Continuent services are running.
15
142
 
16
143
  ## Other useful projects
17
144
 
18
145
  * https://github.com/Ericbla/check_jstat
19
146
 
20
147
  ## Compatibility
21
- These checks only work on the continuent-tungsten-2.x series they are not compatible with continuent-tungsten-1.x.
148
+ These checks only work on VMware Continuent 2.0 and later.
@@ -39,7 +39,7 @@ class ContinuentNagiosMonitorPolicy
39
39
  critical("The Continuent Tungsten Manager is not running")
40
40
  end
41
41
 
42
- status = TI.status()
42
+ status = TI.status(opt(:service))
43
43
  if status.policy() == "AUTOMATIC"
44
44
  ok("Cluster is in #{status.policy()} mode")
45
45
  else
@@ -51,6 +51,11 @@ class ContinuentNagiosMonitorPolicy
51
51
  super()
52
52
 
53
53
  description("Check that the local cluster is running in the AUTOMATIC policy")
54
+
55
+ add_option(:service, {
56
+ :on => "--service String",
57
+ :help => "The replication service or cluster to check"
58
+ })
54
59
  end
55
60
 
56
61
  def script_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: continuent-monitors-nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Continuent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-01 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: continuent-tools-monitoring