changed task parsing and handling
This commit is contained in:
parent
4be1a6ecb9
commit
a670770dde
7 changed files with 82 additions and 73 deletions
|
|
@ -1,74 +1,59 @@
|
|||
{
|
||||
"tasks": {
|
||||
|
||||
"mail":{
|
||||
"host": "a.mx.systemchaos.org",
|
||||
"port": 25,
|
||||
"from": "linspector@systemchaos.org",
|
||||
"username": "you@hanez.org",
|
||||
"password": "uffff"
|
||||
}
|
||||
|
||||
},
|
||||
"members":{
|
||||
"homer":{
|
||||
"name": "Homer Simpson",
|
||||
"comment": "Security Inspector",
|
||||
"tasks": [
|
||||
{"class":"mail", "type": "donut", "args": {"rcpt": "homer_j_simpson@example.sp"}},
|
||||
{"class":"mail", "type": "donut", "args": {"rcpt": "homer_j_simpson@example.sp"}}
|
||||
"root":{
|
||||
"name": "root",
|
||||
"_tasks": [
|
||||
{ "class":"jabber", "type": "jabber", "args": { "rcpt": "hanez@systemchaos.org" }}
|
||||
]
|
||||
}
|
||||
},
|
||||
"periods": {
|
||||
"doh": {"seconds": 10, "comment": "OMG, this means work"},
|
||||
"moes_time": {"minute":"0", "hour": "12", "day_of_week": "4", "comment": "much better"},
|
||||
"marges_birthday": { "date": "2017-2-24 04:00:00"}
|
||||
"fast": { "seconds": 15 },
|
||||
"medium": { "seconds": 120 },
|
||||
"slow": { "seconds": 480 }
|
||||
},
|
||||
"hostgroups":{
|
||||
"power_plant":{
|
||||
"members": ["homer"],
|
||||
"hosts": ["powerplant.example.com"],
|
||||
"processors":[
|
||||
{"class": "mongodb", "args":{ "host": "mongodb.example.org", "user": "homer", "password": "useless", "database": "default" }}
|
||||
],
|
||||
"a":{
|
||||
"members": ["hanez"],
|
||||
"hosts": [ "a", "b", "c", "d", "e"],
|
||||
"services":[
|
||||
{
|
||||
"class": "ping",
|
||||
"fails": {"donut": 2000},
|
||||
"periods": ["doh"],
|
||||
"threshold": 50
|
||||
},
|
||||
{
|
||||
"class": "ping",
|
||||
"fails": {"donut": 1000},
|
||||
"periods": ["doh"],
|
||||
"threshold": 100
|
||||
},
|
||||
{
|
||||
"class": "tcpconnect",
|
||||
"args": {"port": 23232},
|
||||
"periods": ["doh"],
|
||||
"fails": {"donut": 0},
|
||||
"threshold": 0,
|
||||
"comment": "my personal reminder, hehe"
|
||||
},
|
||||
{
|
||||
"template": "tcpconnect_80",
|
||||
"threshold": 10,
|
||||
"periods": ["moes_time"],
|
||||
}
|
||||
{ "class": "dummy", "args": { "sleep": 1, "fail": 1 }, "periods": ["fast"], "threshold": 3 },
|
||||
]
|
||||
}
|
||||
},
|
||||
"layouts":{
|
||||
"main":{"hostgroups": ["power_plant"], "enabled": true}
|
||||
"main":{
|
||||
"hostgroups": [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o" ],
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"core":{
|
||||
"instance_name": "Master Monitor 01 (monitor01.systemchaos.org)",
|
||||
"max_logfile_size": 1024000,
|
||||
"max_logfile_count": 4,
|
||||
"max_worker_threads": 8,
|
||||
"members":[ "root" ],
|
||||
"tasks":{
|
||||
"jabber":{
|
||||
"host": "example.org",
|
||||
"port": 5222,
|
||||
"username": "USERNAME",
|
||||
"password": "PASSWORD"
|
||||
},
|
||||
"mail":{
|
||||
"host": "localhost",
|
||||
"port": 25,
|
||||
"from": "linspector@example.org"
|
||||
"max_worker_threads": 1000,
|
||||
"threshold_handling": "reset",
|
||||
"shutdown_wait": "False",
|
||||
"members":[ "linspector", "root" ],
|
||||
"jsonrpc_backend": "True",
|
||||
"backends": {
|
||||
"jsonrpc": {
|
||||
"_comment": "https://github.com/linspector/linspector/wiki/Configuration-Core-Backends-JsonRPC",
|
||||
"host": "127.0.0.1",
|
||||
"port": 10123,
|
||||
"username": "linspector",
|
||||
"password": "linspector"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue