File: index.rst

package info (click to toggle)
shinken-mod-retention-mongodb 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 172 kB
  • ctags: 17
  • sloc: python: 181; sh: 15; makefile: 4
file content (179 lines) | stat: -rw-r--r-- 4,683 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
.. _distributed_retention_modules:
.. _packages/distributed-retention-modules:

==================================
The distributed retention modules 
==================================

The high availability allow the Arbiter to send a configuration to a spare scheduler, but a spare scheduler does not have any saved states for hosts and services. It will have to recheck them all. It's better to use a distributed retention module so spares will have all the information they need to start with an accurate picture of the current states and scheduling :)


Non distributed retention modules 
==================================


If you are just running tests on a single server, use the pickle or memcache retention modules You can also use MongoDB if you already have it installed for use with the WebUI.


MongoDB 
========


MongoDB is a scalable, high-performance, open source NoSQL database written in C++.

Step 1: Install MongoDB:

We will use mongodb package from 10gen repository, so we start by adding it in apt sources list:
  
::

  echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' > /etc/apt/sources.list.d/10gen.list
  apt-get update
  
And we install it:
  
::

  apt-get install mongodb-10gen
  
And we install pymongo, the python interface to MongoDB, with easy_install to avoid packages versions problems (like here `forums.monitoring-fr.org/index.php?topic=5205.0`_):
  
::

  apt-get remove python-pymongo
  easy_install pymongo
  
And finally we start MongoDB :
  
::

  /etc/init.d/mongodb start
  
Step 2: define a mongodb_retention module in your shinken-specific.cfg file:

  
::

  define module {
    module_name retention-mongodb
    module_type mongodb_retention
    uri mongodb://localhost/?safe=false
    database shinken
  }
  
Step 3: Declare a retention module for your scheduler(s) :)

Example:
  
::

  #The scheduler is a "Host manager". It get hosts and theirs
  #services. It scheduler checks for them.
  define scheduler{
       scheduler_name   scheduler-1   ; just the name
       address  localhost             ; ip or dns address of the daemon
       port     7768                  ; tcp port of the daemon
  
       #optionnal: modules for things as retention
       modules    retention-mongodb
       }
  
Step 4: Restart the Arbiter, and your Scheduler will now save its state between restarts. :)


Memcached 
==========

Memcached is a distributed memory resident key/value server. It's very easy to install:
  
::

  sudo apt-get install memcached 
  sudo /etc/init.d/memcached start
  
The shinken module also needs the python-memcache package to talk to this server.
  
::

  sudo apt-get install python-memcache
  
To use it, 

Step 1: define a memcache_retention module in your shinken-specific.cfg file:

  
::

  define module{
       module_name      MemcacheRetention
       module_type      memcache_retention
       server           127.0.0.1
       port             11211
  }
  
Step 2: Declare a retention module for your scheduler(s) :)

Example:

  
::

  define scheduler{
       scheduler_name   scheduler-1   ; just the name
       address  localhost             ; ip or dns address of the daemon
       port     7768                  ; tcp port of the daemon
  
       #optional: modules for things as retention
       modules    MemcacheRetention
       }
  
Step 3: Restart the Arbiter, and your Scheduler will now save its state between restarts. :)


Redis 
======

Redis is a distributed key/value server (on disk and in-memory). It's very easy to install:
  
::

  sudo apt-get install redis-server
  sudo /etc/init.d/redis-server start
  
The shinken module also need the python-redis package to talk to this server.
  
::

  sudo apt-get install python-redis
  
Step 1: define a redis_retention module in your shinken-specific.cfg file:

  
::

  define module{
       module_name      RedisRetention
       module_type      redis_retention
       server           127.0.0.1
  }
  
Step 2: Declare a retention module for your scheduler(s) :)

Example:
  
::

  #The scheduler is a "Host manager". It get hosts and theirs
  #services. It scheduler checks for them.
  define scheduler{
       scheduler_name   scheduler-1   ; just the name
       address  localhost             ; ip or dns address of the daemon
       port     7768                  ; tcp port of the daemon
  
       #optionnal: modules for things as retention
       modules    RedisRetention
       }
  
Step 3: Restart the Arbiter, and your Scheduler will now save its state between restarts. :)

.. _forums.monitoring-fr.org/index.php?topic=5205.0: http://forums.monitoring-fr.org/index.php?topic=5205.0