Merge "Add 'long_output' field to status API"

This commit is contained in:
Jenkins 2015-05-27 18:38:14 +00:00 committed by Gerrit Code Review
commit c6b4694ed8
4 changed files with 25 additions and 3 deletions

View File

@ -49,6 +49,9 @@ class LiveHost(types.Base):
plugin_output = wsme.wsattr(wtypes.text, mandatory=False)
"""Plugin output of the last check"""
long_output = wsme.wsattr(wtypes.text, mandatory=False)
"""Plugin long ouput of the last check"""
@classmethod
def sample(cls):
return cls(
@ -61,5 +64,6 @@ class LiveHost(types.Base):
acknowledged=True,
last_check=1429220785,
last_state_change=1429220785,
plugin_output='PING OK - Packet loss = 0%, RTA = 0.02 ms'
plugin_output='PING OK - Packet loss = 0%, RTA = 0.02 ms',
long_output='The ping was great\nI love epic ping-pong games'
)

View File

@ -43,6 +43,9 @@ class LiveService(types.Base):
plugin_output = wsme.wsattr(wtypes.text, mandatory=False)
"""Plugin output of the last check"""
long_output = wsme.wsattr(wtypes.text, mandatory=False)
"""Plugin long ouput of the last check"""
@classmethod
def sample(cls):
return cls(
@ -54,4 +57,5 @@ class LiveService(types.Base):
last_state_change=1429220785,
plugin_output='HTTP OK - GOT NICE RESPONSE',
acknowledged=True,
long_output='Serves /var/www/\nServes /home/webserver/www/'
)

View File

@ -31,6 +31,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"last_chk": 1.429405764e+09,
"last_state_change": 1.429405765316929e+09,
"plugin_output": "OK - localhost: rta 0.033ms, lost 0%",
"long_output": "This is\na\nlong\noutput",
"state": "OK",
"state_type": "HARD",
"problem_has_been_acknowledged": True,
@ -44,6 +45,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"last_chk": 1.429405763e+09,
"last_state_change": 1.429405765317144e+09,
"plugin_output": "OK - 127.0.0.1: rta 0.032ms, lost 0%",
"long_output": "Another very\nlong\noutput",
"state": "OK",
"state_type": "HARD",
"problem_has_been_acknowledged": True,
@ -57,6 +59,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"last_chk": 1.429405764e+09,
"last_state_change": 1.429405765317063e+09,
"plugin_output": "OK - localhost: rta 0.030ms, lost 0%",
"long_output": "What a;\nlong;\noutput;",
"state": "OK",
"state_type": "HARD",
"problem_has_been_acknowledged": True,
@ -75,7 +78,8 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"state": 'OK',
"last_check": 1429220785,
"last_state_change": 1429220785,
"plugin_output": 'HTTP OK - GOT NICE RESPONSE'
"plugin_output": 'HTTP OK - GOT NICE RESPONSE',
"long_output": 'This has\n a long\noutput'
},
{
"host_name": 'someserver',
@ -84,7 +88,8 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"state": 'OK',
"last_check": 1429220785,
"last_state_change": 1429220785,
"plugin_output": 'Hi there'
"plugin_output": 'Hi there',
"long_output": 'My output;\nis better;\nthan yours;'
},
]
@ -102,6 +107,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"parents": ['parent.com'],
"last_state_change": 1429405765,
"plugin_output": "OK - localhost: rta 0.033ms, lost 0%",
"long_output": "This is\na\nlong\noutput",
"last_check": 1429405764,
"state": "OK",
"acknowledged": True,
@ -112,6 +118,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"parents": ['parent.com'],
"last_state_change": 1429405765,
"plugin_output": "OK - 127.0.0.1: rta 0.032ms, lost 0%",
"long_output": "Another very\nlong\noutput",
"last_check": 1429405763,
"state": "OK",
"acknowledged": True,
@ -122,6 +129,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"parents": ['parent.com'],
"last_state_change": 1429405765,
"plugin_output": "OK - localhost: rta 0.030ms, lost 0%",
"long_output": "What a;\nlong;\noutput;",
"last_check": 1429405764,
"state": "OK",
"acknowledged": True,
@ -158,6 +166,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"last_state_change": 1429812192,
"acknowledged": True,
"plugin_output": "OK - localhost: rta 0.044ms, lost 0%",
"long_output": "This is\na\nlong\noutput",
"last_check": 1429812191,
"state": "OK",
"host_name": "localhost",
@ -174,6 +183,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
'last_state_change': 1429823532,
'plugin_output': ('TCP OK - 0.000 second '
'response time on port 7760'),
"long_output": 'My output;\nis better;\nthan yours;',
'last_check': 1429823531,
'state': 'OK',
'host_name': 'ws-arbiter',

View File

@ -31,6 +31,7 @@ class TestStatusServices(functionalTest.FunctionalTest):
"last_chk": 1429220785,
"last_state_change": 1429220785,
"plugin_output": 'HTTP OK - GOT NICE RESPONSE',
"long_output": 'The response\nwas really\nnice',
"problem_has_been_acknowledged": True,
},
{
@ -41,6 +42,7 @@ class TestStatusServices(functionalTest.FunctionalTest):
"last_chk": 1429220785,
"last_state_change": 1429220785,
"plugin_output": 'Hi there',
"long_output": 'I am;\nthe servicessomthing;\noutput;',
"problem_has_been_acknowledged": False,
},
]
@ -60,6 +62,7 @@ class TestStatusServices(functionalTest.FunctionalTest):
"last_check": 1429220785,
"last_state_change": 1429220785,
"plugin_output": 'HTTP OK - GOT NICE RESPONSE',
"long_output": 'The response\nwas really\nnice',
'acknowledged': True,
},
{
@ -70,6 +73,7 @@ class TestStatusServices(functionalTest.FunctionalTest):
"last_check": 1429220785,
"last_state_change": 1429220785,
"plugin_output": 'Hi there',
"long_output": 'I am;\nthe servicessomthing;\noutput;',
'acknowledged': False,
},
]