Skip to content

Commit ee06ad4

Browse files
committed
Enh: remove pycurl dep
1 parent 945a6cd commit ee06ad4

File tree

3 files changed

+57
-76
lines changed

3 files changed

+57
-76
lines changed

README.md

+54-70
Original file line numberDiff line numberDiff line change
@@ -185,22 +185,22 @@ The evaluation is done like this:
185185

186186
For example here is a cpu check on a linux server:
187187

188-
{
189-
"check": {
190-
"interval": "10s",
191-
"apply_on": "linux",
188+
check:
189+
interval: 10s
190+
apply_on: linux
192191
193-
"ok_output": "'OK: cpu is great: %s%%' % (100-{collector.cpustats.cpuall.%idle})",
192+
ok_output: "'OK: cpu is great: %s%%' % (100-{collector.cpustats.cpuall.%idle})"
194193
195-
"critical_if": "{collector.cpustats.cpuall.%idle} < {configuration.thresholds.cpuidle.critical}",
196-
"critical_output": "'Critical: cpu is too high: %s%%' % (100-{collector.cpustats.cpuall.%idle})",
194+
critical_if: "{collector.cpustats.cpuall.%idle} < {configuration.thresholds.cpuidle.critical}"
195+
critical_output: "'Critical: cpu is too high: %s%%' % (100-{collector.cpustats.cpuall.%idle})"
197196

198-
"warning_if": "{collector.cpustats.cpuall.%idle} < {configuration.thresholds.cpuidle.warning}",
199-
"warning_output": "'Warning: cpu is very high: %s%%' % (100-{collector.cpustats.cpuall.%idle})",
197+
warning_if: "{collector.cpustats.cpuall.%idle} < {configuration.thresholds.cpuidle.warning}"
198+
warning_output: "'Warning: cpu is very high: %s%%' % (100-{collector.cpustats.cpuall.%idle})"
200199
201-
"thresholds" : {"cpuidle" : { "warning": 5, "critical": 1} }
202-
}
203-
}
200+
thresholds :
201+
cpuidle :
202+
warning: 5
203+
critical: 1
204204

205205

206206

@@ -213,19 +213,15 @@ The parameter for this is:
213213

214214
Here is an example
215215

216-
{
217-
"check": {
218-
"apply_on": "linux",
219-
"script": "$nagiosplugins$/check_mailq -w $mailq.warning$ -c $mailq.critical$",
220-
"interval": "60s",
216+
check:
217+
apply_on: linux
218+
script: "$nagiosplugins$/check_mailq -w $mailq.warning$ -c $mailq.critical$"
219+
interval: 60s
221220

222-
"mailq" : {
223-
"warning": 1,
224-
"critical": 2
225-
}
226-
}
227-
}
228-
221+
mailq:
222+
warning: 1
223+
critical: 2
224+
229225

230226
NOTE: the $$ evaluation is not matching the previous checks, we will fix it in a future version but it will break the current version configuration.
231227

@@ -236,17 +232,19 @@ You can be notified about check state changed with handlers. currently 2 are man
236232

237233
You must define it in your local configuration:
238234

239-
{
240-
"handler": {
241-
"type": "mail",
242-
"severities": [ "ok", "warning", "critical", "unknown" ],
243-
"contacts": [ "[email protected]" ],
244-
"addr_from": "[email protected]",
245-
"smtp_server": "localhost",
246-
"subject_template": "email.subject.tpl",
247-
"text_template": "email.text.tpl"
248-
}
249-
}
235+
handler:
236+
type: mail
237+
severities:
238+
- ok
239+
- warning
240+
- critical
241+
- unknown
242+
contacts:
243+
244+
addr_from: "[email protected]"
245+
smtp_server: localhost
246+
subject_template: "email.subject.tpl"
247+
text_template: "email.text.tpl"
250248

251249
* type: email
252250
* severities: raise this handler only for this new states
@@ -293,11 +291,8 @@ You can export all your nodes informations (new, deleted or change node) into yo
293291

294292
You must add in the agent installed on your shinken arbiter daemon the following local configuration:
295293

296-
{
297-
"shinken": {
298-
"cfg_path": "/etc/shinken/agent"
299-
}
300-
}
294+
shinken:
295+
cfg_path: "/etc/shinken/agent"
301296

302297
* cfg_path: a directory where all your nodes will be sync as shinken hosts configuration (cfg files)
303298

@@ -312,13 +307,11 @@ If you enable the DNS interface for your agent, it will start an internal DNS se
312307

313308
You must define a dns object in your local configuration to enable this interface:
314309

315-
{
316-
"dns":{
317-
"enabled" : true,
318-
"port" : 6766,
319-
"domain" : ".kunai"
320-
}
321-
}
310+
dns:
311+
enabled : true
312+
port : 6766
313+
domain : ".kunai"
314+
322315

323316
* enabled: start or not the listener
324317
* port: UDP port to listen for UDP requests
@@ -346,19 +339,16 @@ The statsd daemon part will agregate counters for 10s and will then export the m
346339

347340
In order to enable the statsd listener, you must define the statsd in your local configuration:
348341

349-
{
350-
"statsd": {
351-
"enabled" : true,
352-
"port" : 8125,
353-
"interval" : 10
354-
}
355-
}
356-
342+
statsd:
343+
enabled : true
344+
port : 8125
345+
interval : 10
346+
357347
* enabled: launch or not the statsd listener
358348
* port: UDP port to listen
359349
* interval: store metrics into memory for X seconds, then export them into graphite for storing
360350

361-
**TODO**: change the ts tag that enable this feature to real *role*
351+
**TODO**: change the ts tag that enable this feature to real *role*/addons
362352

363353

364354
### Store your metrics for long term into Graphite
@@ -367,14 +357,11 @@ You can store your metrics into a graphite like system, that will automatically
367357

368358
In order to enable the graphite system, you must declare a graphite object in your local configuration:
369359

370-
{
371-
"graphite": {
372-
"enabled" : true,
373-
"port" : 2003,
374-
"udp" : true,
375-
"tcp" : true
376-
}
377-
}
360+
graphite:
361+
enabled : true
362+
port : 2003
363+
udp : true
364+
tcp : true
378365

379366
* enabled: launch or not the graphite listener
380367
* port: TCP and/or UDP port to listen metrics
@@ -394,12 +381,9 @@ You can get notified about a node change (new node, deleted node or new tag or c
394381

395382
All you need is to enable it on your local node configuration:
396383

397-
{
398-
"websocket": {
399-
"enabled" : true,
400-
"port" : 6769
401-
}
402-
}
384+
websocket:
385+
enabled : true
386+
port : 6769
403387

404388
* enabled: start or not the websocket listener
405389
* port: which TCP port to listen for the websocket connections

kunai/ts.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import os
22
import time
33
import threading
4-
import socket
54
import base64
65
import cPickle
7-
import hashlib
86
import json
97

108
from kunai.stats import STATS
119
from kunai.log import LoggerFactory
1210
from kunai.threadmgr import threader
13-
from kunai.util import to_best_int_float
1411
from kunai.now import NOW
1512
from kunai.dbwrapper import dbwrapper
1613
from kunai.gossip import gossiper

technical_spec_and_todo.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ You don't need to read it unless you want to give a look at the internal of "thi
77

88

99

10-
11-
12-
1310
################################# CLI SPEC
1411

1512
#### Start (forground)
@@ -370,6 +367,9 @@ Besoins:
370367
### Packs
371368
* Pack Azure
372369
* linux: enlever la dépendance à sysstat
370+
* ipmi (hardware stuff)
371+
* smart (disques)
372+
* raid linux (md)
373373

374374

375375
### Core

0 commit comments

Comments
 (0)